Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Aditi Msc   on Nov 28 In Java Category.

  
Question Answered By: Willie Gomez   on Nov 28

Try using fewer methods like setMaximizedBounds, setResizable and let
java control the gui a little more.

Don't add the exitButton to the bp panel. Add it directly to the
contentPane... getContentPane().add(exitButton, BorderLayout.SOUTH);
That way the exitButton is not on the scrollpane, but will always
show up on the window.
Then add the panel  with the cards  into the scrollpane and add the
scrollpane to the contentPane (I think you do that already).

Since the contentPane is already BorderLayout, you don't need these
lines
p1 = (JPanel) getContentPane();
p1.setLayout(new BorderLayout());

Also, the JScrollPane automatically gets both Horizontal and Vertical
scrollbars, therefore you don't need the JScrollBar object

Share: 

 

This Question has 2 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Limit size of swing frame & or components Or get search suggestion and latest updates.


Tagged: