Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to add Dynamic GUI components using SWT  RSS feed

 
Malini Kesavan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI ,
I am new to SWT. Can anybody please help me out with this? I need to implement the following

Group A
text t1
text t2
List l1
Check Box c1, c2 c3

//Group A ends
Button "Add New"

Clicking on "Add New" paints the following

Group A //with in Group A
text t1_1
text t2_1
List list1_1
Check Box c1_1, c2_1 c3_1

text t1_2
text t2_2
List list1_2
Check Box c1_2, c2_2 c3_2


All the feilds should be editable.

Thanks,
Malini
 
jay vas
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I implemented what youre talking about by basically adding all possible widgets first. then, when i want a widget to change, i simply add in the widget which invokes that change, an action listener i.e.

//widget A causes widget B to apper

Button a = new Button(parent,SWT.NONE);
final Button b = new Button(parent,SWT.NONE);

b.setVisible(false);

widgetA.addActionListener(
new ActionListener()
{
public actionPerformer(actionEvent arg0)
{
b.setVisible(true);
}
}

}
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!