java - Swing GroupLayout show only one component? How to fix that? -


So, I have the original frame with group layout and 3 component. Something like this should look like in principle

[------ label ------]
[button] [button]

But it only shows me the last used button component (button "BJDon" to fit the entire window). Theres my code:
frame file:

  The public class extends the mainframe JFrame {GroupLayout layout = new GroupLayout (getContentPane ()); Jebton Bizarro = new pocket ("0"); Jebton B Jeden = New Jebton ("1"); JAlabel label = new JLab ("LABEL"); Mainframe () {this.setBounds (200, 200, 640, 480); Layout.setHorizontalGroup (layout.createSequentialGroup) .addComponent (label) .addGroup (layout.createSequentialGroup) .addComponent (bZero) .addComponent (bJeden))); This.setVisible (true); }}   

main file:

  public square key {public static zero main (string [] args) {MainFrame mf = new mainframe ( ); }}   

How to fix it?

Set layout for T content pane

  mainframe () {GetContentPane () SetLayout (layout); This.setBounds (200, 200, 640, 480); ...    

Comments