[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ProgSoc] Java....




> If I make a class which extends JWindow, and make it do all kinds of JButton
> stuff, etc. It works fine.
> But if I change it so it extends JPanel instead of JWindow, and then add it
> to a JWindow, nothing appears.
> (..and change all the .getContentPane().add() references to just .add() )

In the second case, i take it u r not extending 'JWindow'. Create a new
class extends JWindow and add your JPanel to that. Then somewhere in the
new JWindow constructor make sure u r calling

this.enableEvents(AWTEvent.WINDOW_EVENT_MASK);

Otherwise nothing will come up. Also make sure ur calling
.setShowing(true) after u've added the JPanel(). That oughta do it. 

Paul. 

-
You are subscribed to the progsoc mailing list. To unsubscribe, send a
message containing "unsubscribe" to progsoc-request@nospam.progsoc.uts.edu.au.
If you are having trouble, ask owner-progsoc@nospam.progsoc.uts.edu.au for help.