i am trying to add a custom window in blackberry but before this i am trying to add a custom label in that popup screen for my satisfaction that i can add or cant . so at the time when i am adding that i am facing the problem of IllegalArguementException error , so can you please tell me how can i solve that problem . i am doing like this .
see this is my MYScreen class which i am using to add pop-up . so pop-up is added when ever i clicked that press button , which is added in the Screen .
public final class MyScreen extends MainScreen implements FieldChangeListener
{
private ButtonField btn;
public MyScreen()
{
setTitle("MyTitle");
btn = new ButtonField ("press");
btn.setChangeListener(this);
add(btn) ;
}
public void fieldChanged(Field field, int context)
{
if ( field == btn )
{
Dialog.inform("hello");
pop_manager manager_object = new pop_manager(0);
UiApplication.getUiApplication().pushScreen( new up_pop_test( manager_object ) );
}
}
}
so in this i have added , new_up_pop_test class which is :
public class up_pop_test extends PopupScreen
{
public up_pop_test( pop_manager delegate)
{
super(delegate);
add(delegate);
}
}
and pop_manager is :
public class pop_manager extends Manager
{
protected pop_manager(long style)
{
super(style);
}
protected void sublayout(int w, int h)
{
Field f = getField(0);
layoutChild( f , w/3+w/3 , 50 ) ;
setPositionChild ( f , w/33 + w/33 , w/67+w/104 );
setExtent(w,h);
}
}