Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Swing help needed...
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Jodo Yodo




PostPosted: Thu Apr 07, 2005 6:20 pm   Post subject: Swing help needed...

code:
JPanel northPanel = new JPanel ();
        JPanel ratingPanel = new JPanel ();

        northPanel.setLayout (new BorderLayout ());
        northPanel.add ("North", movieBox);

        ratingPanel.setLayout (new BorderLayout ());
        ratingPanel.add ("East", currentRating);

        getContentPane ().add (northPanel);
        getContentPane ().add (ratingPanel);

        pack ();
        setVisible (true);


For some reason, it will display the panel 'ratingPanel', but never the panel 'northPanel'. When I use delete all the lines that are about 'ratingPanel', 'northPanel' shows up just fine. Why won't they both show up?
Sponsor
Sponsor
Sponsor
sponsor
rizzix




PostPosted: Thu Apr 07, 2005 8:17 pm   Post subject: (No subject)

never use "strings" literals for that kind of stuff. always use the Class provided constants.

In this case for "North" it would be BorderLayout.NORTH
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: