tags:

views:

56

answers:

2

Hi, I am trying to make a desktop application in netbeans. The GUI form that i have made, is longer than the size of the desktop screen, so the contents in the lower parts are not visible. Please help me to get ride of this problem.Here I'm pasting the picture.

alt text

+4  A: 

Either you can adjust your components to fit in size or you can use scroll pane as base component and put all components on it so there will be a scroll bar

Here is demo for scrollpane

org.life.java
+1 use a JScrollPane, or alternatively put your form components into two columns.
Qwerky
@Qwerky yeah thats what i meant by adjusting component
org.life.java
+1  A: 

The solution described by org.life.java says it all. I am just elaborating that solution and adding one more option to try:

There could be three ways to achieve a usable window in this case:

  1. Design the form components in a JPanel instead of JFrame. Then add the newly designed JPanel in a new JFrame inside a JScrollPane
  2. Use the space available on the right side of the window to arrange the controls and reduce the height of the JFrame
  3. Use JTabbedPane to keep the components in separate tabs like General, Address, Contacts and shift the corresponding components in tabs
  4. In option 2 and 3 the Submit button shall be kept on the JFrame in the bottom area so it remains visible all the time.

with regards
Tushar Joshi, Nagpur

UPDATE:

After implementing the first point in my suggestions I created a JPanel through NetBeans IDE and named it ComponentsPanel. Then I created a JFrame and added one JScrollPane and JButton to that frame. I also added ComponentsPanel earlier created with all the text fields into the JScrollPane. The result looks like as follows:

alt text

After scrolling the scroll pane the window will look like as below:

alt text

Tushar Joshi
thanks a lot sir, the solution is very effective and useful... thanks again....
Ryan