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

Members online

No members online now.

Forum statistics

Threads
474,266
Messages
2,571,077
Members
48,772
Latest member
Backspace Studios

Latest Threads

Top