Using setLayout(null) in JFrame but problem in adding scroll bars to frame.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Rajive_Jain
Posted On:   Friday, August 16, 2002 03:35 AM

I am using a JFrame to make a form using components such as JTextField's, JLabel's etc. I am using setLayout(null)on the content pane of the JFrame (using Container content=this.getContentPane()) in order to position my components as per a paper-based form. However, since the form is long and occupies more than one screen, I need scroll bars on the side so that users can scroll down the form while they are filling in details. I'd appreciate any help or advice on how I could achieve this. Thanks.

Re: Using setLayout(null) in JFrame but problem in adding scroll bars to frame.

Posted By:   Mike_Friedrich  
Posted On:   Friday, August 16, 2002 08:47 AM

If your content pane works with a null-layout a crollpane should work too in this way.

I suggest:

Set the layout of the frame to BorderLayout, add a JScrollPane with your null-layout (center position), move your components to the scrollpane.


Regards, Mike

About | Sitemap | Contact