Cara pushScreen Constructor GUI

5 views
Skip to first unread message

oyiym

unread,
Jan 31, 2013, 2:25:27 AM1/31/13
to blackberry...@googlegroups.com
Permisi, mohon maaf apabila pertanyaan saya aneh. sanya sedang mengalami kebingungan dengan kasus ini, searching di internet gak menghasilkan jawaban yang tepat karena saya juga gak tau pasti apa nama problem ini mungkin karena saya newbie kali ya :(, jadi saya putuskan untuk bertanya di forum ini. untuk itu mohon pencerahannya ya para master :)
begini saya punya dua class yang pertama katakan class Aa yang mengextends UiApplication
berikut scriptnya:
public class Aa extends UiApplication
{
   
public static void main(String[] args)
   
{
       
Aa theApp = new Aa();      
        theApp
.enterEventDispatcher();
   
}
   
   
public Aa()
   
{        
        pushScreen
(new Bb());
   
}    
}

dan class Bb sebagai Main Screen:
public class Bb extends MainScreen
{  
int current_index=0;
BottomPanel bottomPanel;

public Bb(int current_index)
{  
   
this.current_index=current_index;
   bottomPanel
=new BottomPanel(current_index);
}

public  void createGUI()
{      
setTitle
("Test");

VerticalFieldManager vertical=new VerticalFieldManager(USE_ALL_WIDTH)
{
   
protected void sublayout(int maxWidth, int maxHeight)
   
{              
       
super.sublayout(Display.getWidth(), 150);
        setExtent
(Display.getWidth(), 150);
   
}
};
vertical
.setBackground(BackgroundFactory.createSolidBackground(Color.GREEN));
ButtonField button=new ButtonField("Click");
vertical
.add(button);      
add
(vertical);

setStatus
(bottomPanel);    
}
}

Dan error yang terjadi yaitu pada class Aa saat pushScreen(new Bb()); karena constructor bb mengandung parameter dan maksud saya apakah bisa Aa mem-pushScreen public void createGUI pada Bb? lalu gimana caranya.
ini pesan errornya:
The constructor Bb() is undefined

Thanks in advance :)



Anton W Pramono

unread,
Jan 31, 2013, 2:34:28 AM1/31/13
to blackberry...@googlegroups.com
pushScreen(new Bb()); <<< initialnya

public Bb(int current_index) <<< ini constructornya pake parameter
{   
   
this.current_index=current_index;
   bottomPanel
=new BottomPanel(current_index);
}

Jadi? ya dikasih parameter pushScreennya
pushScreen(new Bb(0)); <<< add parameter int 


Dicoba ya.
Salam



2013/1/31 oyiym <fajr...@gmail.com>




--
Website: bbdevid.com | Blog & news: bbdevid.tumblr.com
Share artikel anda di post.bbdevid.com
Alternatif bertanya di tanya.bbdevid.com kumpulkan poin nya untuk ditukarkan dengan hadiah yg menarik :)
---
You received this message because you are subscribed to the Google Groups "Indonesia Blackberry Developer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blackberry-devel...@googlegroups.com.
To post to this group, send email to blackberry...@googlegroups.com.
Visit this group at http://groups.google.com/group/blackberry-developer?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Anton W PramonoComplete Your BlackBerry Existence

Muhammad Hakim

unread,
Jan 31, 2013, 2:35:02 AM1/31/13
to blackberry...@googlegroups.com
tambahin konstruktor di kelas Bb

public Bb(){
}

yang bakal ngehasilin halaman putih

atau di konstruktor kelas Aa push screennya kayak gini:

public Aa(){
   pushScreen(new Bb(0));
}


bonus:
coba mas Fajry belajar bahasa java sedikit dulu :)


2013/1/31 oyiym <fajr...@gmail.com>

--
Website: bbdevid.com | Blog & news: bbdevid.tumblr.com
Share artikel anda di post.bbdevid.com
Alternatif bertanya di tanya.bbdevid.com kumpulkan poin nya untuk ditukarkan dengan hadiah yg menarik :)
---
You received this message because you are subscribed to the Google Groups "Indonesia Blackberry Developer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blackberry-devel...@googlegroups.com.
To post to this group, send email to blackberry...@googlegroups.com.
Visit this group at http://groups.google.com/group/blackberry-developer?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Best Regards,
hakim
Blog | Blackberry App | Android App | hakimlabs | bbm: 2874A357
السلام عليكم ورحمة الله وبركاته

Ardhian Ekawijana

unread,
Jan 31, 2013, 3:57:41 AM1/31/13
to blackberry...@googlegroups.com
bikin dua konstruktor ajah.. ntar tinggal pilih yang mau di pake

2013/1/31 Muhammad Hakim <haki...@gmail.com>
Reply all
Reply to author
Forward
0 new messages