Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Java frame is showing blank  RSS feed

 
Harold Ndou
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, i have problem with the following two java classes, driver class Reservations and Room class. When i run, it just show blank frame, can any tell me where i gone wrong.




 
Tim Cooke
Marshal
Posts: 3635
184
Clojure IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Harold, welcome to the Ranch!

When posting code it's advisable to UseCodeTags (<- click here). I've gone ahead and added some to your post for you. See how much better it looks? It makes your code easier to read which in turn improves the chances of you getting a response to your question.
 
Rob Camick
Ranch Hand
Posts: 2752
11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


You can't add multiple panels to the same location. Only the last panel added should be visible.

Try something like the following to see if it makes a difference:





A JOptionPane is a Swing component. Don't mix AWT and Swing components. I would use Swing components for your application, since there in no need to use AWT and Swing is the newer UI. To use Swing components you just add a "J" in front of the component class. (JFrame, JTextArea, JTextField, JButton...).

Read the Swing Tutorial for more information and Swing examples.
 
Harold Ndou
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rob

Thanks so much for your assistance, my program is working fine. I also change code in line 34 Reservation class to " for (int i=1; i<9; i++)".
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!