• Post Reply Bookmark Topic Watch Topic
  • New Topic

WindowBuilder doesn't allow to create a very big JPanel

 
Manuel Rosales Aguiar
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there, guys. I hope you can help me.

I am building a quite complex GUI using WindowBuilder. One of the elements of this GUI must have several elements in order to configure some searching stuff.
To do this, and in order to support small screen sizes as much as possible, I decided to include for this element a JScrollPane. This scroll panel has in its Viewport a JPanel in which I place all the needed elements. I am using for this panel a GroupLayout layout, so I need to place the elements manually into the graphical editor. Until now, when I needed to add more elements, I expanded the main frame to get the JPanel expanded too and place the elements where I wanted. The problem now is that eclipse doesn't allow me to expand the main frame beyond a limit to add more stuff (the maximum size is about 1200 px height, maybe it has something to do with my screen, 1920x1200). Of course, there is a scroll bar in the JScrollPane, but WindowBuilder doesn't allow me to use it in the graphical editor, and since the layout is GroupLayout, I can't add items using the Components window.

Does anybody know a way to expand more the main panel, to use the scroll bars in the WindowBuilder editor or any other way which allows me to reach the lower part of this big JPanel?

Thank you in advance, guys.
 
Rob Spoor
Sheriff
Posts: 20817
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know any class called WindowBuilder. What library does it come from?
 
Manuel Rosales Aguiar
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hum, I'm sorry, maybe I did't explain myself properly. WindowBuilder is a tool to build GUIs easily. I thought it is a common tool.

http://www.eclipse.org/windowbuilder/
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lots of people are not using any visual designer at all with Swing. I started with one too, but gradually replaced all generated forms with hand-written code. The handiwork is usually much smaller, expresses the programmer's intent better (in my opinion) and usually is also more flexible than the automatically generated code.

Unfortunately, this might also be a reason why you don't get any advice about visual designers from experienced folks.
 
Manuel Rosales Aguiar
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Martin, thanks for your response. I usually try to hand-code, but in this case the code is very large and complicated because of the kind of layout, and I'm a bit in a hurry. Anyway, after some research, I've found out that the OS usually limits the size of a panel to the size of the screen. It's not a swing or eclipse limitation, but a limitation of the OS, so nothing to do here, I have to change my idea of the window I was trying to build. Thank you anyway, guys.
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After re-reading your description, it does look like Eclipse limitation to me after all.

You obviously cannot make Eclipse window any bigger than your screen resolution, but I'd expect the editor itself to have scrollbars (his own, not your JScrollPane scrollbars) that would allow you to build forms of any size. The editor, after all, doesn't have to create its inner area as an OS window - in the same way Photoshop doesn't need to create 10000 pixels wide window to let you edit 10000 pixels wide picture.

Perhaps you could build your GUI in several smaller sections and then put them (using hand written code) on a panel, which would finally go inside a JScrollPane. This way you'd limit the hand-written code to minimum.

Edit: when using lightweight Swing controls, the components are not "visible" to the OS as individual controls, or windows. Swing takes care of drawing and handling the components itself. So you can build forms of any size and display them in a JScrollPane; OS cannot limit this in any way. Such a form could be difficult to use, though, so if you're rethinking the design, you're probably doing it right.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!