i want to place a button on upper left corner of JFrame with GridBagLayout.i write this code but it is notwork correctly
gbc.gridx=0;
gbc.gridx=0;
add(b1,gbc);
but the button place on center of JFrame why
i want to place a button on upper left corner of JFrame with GridBagLayout.i write this code but it is notwork correctly
gbc.gridx=0;
gbc.gridx=0;
add(b1,gbc);
but the button place on center of JFrame why
Read the Oracle tutorial
http://docs.oracle.com/javase/tutorial/uiswing/layout/gridbag.html
in particular, see the comment under weightx, weighty
about half way down.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.