Decrease space between two Jpanel in the netbeans prototyper

Asked

Viewed 629 times

-1

Good afternoon, everyone.

I am using netbeans 7.4 to create a simple screen. It turns out that on this screen (frame0 by default), I added two panels (Jpanel). One to be the header and one to be the rest of the screen.

I chose the layout of the panels as Etchedborder, and I was dragging the two until adjusting in proportion to the whole frame.

But the problem is that between the top panel and the bottom panel is a fixed space. I can’t get it down.

To try to adjust, I drag the top edge of the bottom panel until I touch the bottom edge of the top panel. But when released, netbeans automatically puts that space.

Can anyone tell me how to deactivate, or adjust this space by the same prototyper? Thank you.

  • One comment off: don’t use Java for desktop.

  • @Patrick: why not to use java on the desktop?

  • Because of the "compilation" of Java. Reverse engineering is greatly facilitated due to this.

2 answers

1

This is normal, and varies according to the layout manager you are using. If you want total control on your Swing components (Netbens) click with the right button on top of your Jframe and go to "Set Layout" and select "Null" or any other you know (Absolute for example).

Note: Managers are very complex and have a lot to talk about in just one answer. In short it is not good to use "null" layout due to incompatibility and deformation of components on different screens or systems, I suggest you study this topic of Swing to build a consistent front.

Att.

0

It has to do with the layout, as Joshua said. To add an appropriate layout: right click on the place where you want to place the Jpanels, choose set layout (as you want header and body) you can choose the Borderô Layout and put the Jpanel for the "header" in the North and the other in the Center.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.