Dynamic Control Creation

A

andrewm1986

Hey all.

When a user clicks on something I want to add a new control to a panel
in my frame with an XYLayout.

This is the code I have.

GUI.Components.Component c = null; //My packages
....
c = new SomeComponentICreated();

pnlMain.add("10,10,50,20",c);
System.out.println(c.isVisible());
System.out.println(pnlMain.getComponentCount());

Output is

true
1
true
2

If I do it twice, but I cannot see my controls!

Andrew
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top