How do I recreate the layout of the swing gui made with netbeans autogenerated code?

FifthRevelathor :

I already made this in Netbeans GUI Builder:

enter image description here

But its full of auto generated code and I don't know where to place my extra codes, so I want to change it to manual code. I tried BorderLayout and I also started learning GridBagLayout but I still can't replicate it. I'm stuck here for a week and I need to pass my java system this month.

  • Can you code this for me please?
  • What layouts should I use to manually replicate the GUI?
  • How can I easily change the size of a textarea (pixels) without using [setColumns] or [setRows]?
Bashir :

All I can help you is that you can use BorderLayout as layout for your Frame.

The black screen with a Panel will be in a BoxLayout (more informations) in center of BorderLayout. The Panel will contain the elements below the black screen, you can use GirLayout (except the two buttons below the textarea)

The text area and the two Buttons on east in a BoxLayout and placed in the east of the main BorderLayout

enter image description here

(sorry for the bad drawing, but I hope it helps you to understand more the structure of layouts)

take a look here to learn more about Layouts.

for the textarea, is that you are looking for?

new JTextArea(WIDTH, HEIGHT);

create the textarea withou using setColumns or setRows

Good luck.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=26989&siteId=1