Questions tagged [grouplayout]

GroupLayout is a Java Swing LayoutManager that hierarchically groups components in order to position them in a Container.

GroupLayout is a LayoutManager that hierarchically groups components in order to position them in a Container. GroupLayout is intended for use by builders, but may be hand-coded as well. Grouping is done by instances of the Group class. GroupLayout supports two types of groups. A sequential group positions its child elements sequentially, one after another. A parallel group aligns its child elements in one of four ways.

Relevant documentation and tutorials:

180 questions
0
votes
1 answer

Java swing java.lang.IllegalStateException

First of all i am only programming 6-7 months in a school envirement so this might be a stupid question. In class we just recently learned about AWT and SWING. So while i was reading up on it i decided to test some things out and incorporate some in…
0
votes
0 answers

Why does a Null Pointer Exception occur when I call pack() from JFrame(Swing)?

Precautions taken before asking this question I made sure that I initialized all the multidimensional ArrayList objects and their elements with valid and correct parameters to the best of my knowledge. I added the component subclasses(JRadioButton,…
user7879774
0
votes
1 answer

Why are linked components not resizable in GroupLayout?

For the GUI of a calculator application I'm making, I have a grid of JButton objects, where all of them are the same size, except one is double the width of the others. It should look something like this (except the lines would be straight): My…
Matthew Flynn
  • 191
  • 1
  • 12
0
votes
0 answers

Position the buttons and textfields of the GUI to center when maximized

I have made a JFrame form which has few buttons and text fields in it. It looks perfectly fine when running on a small window. But when I maximize it all the buttons and text fields get scattered and are not centered. Is there any way that the frame…
Sneha P
  • 31
  • 1
  • 5
0
votes
0 answers

How to getLocation of components in GroupLayout?

I have a problem. When I getLocation of button b2, it return 0-0. So can I get the location of b2? public class TestF { public static void main(String[] args) { JFrame frame = new JFrame("GroupLayout"); …
0
votes
0 answers

Java Swing simple chat frame

I am writing a simple chat. While I do my project in IntellijIdea I found it a bit complicated (GUI designer), and then I did the frame that I need in NetBeans. It looks fine, but when I resize this window, some elements (chatArea and messageArea)…
Noqrax
  • 1,049
  • 2
  • 8
  • 15
0
votes
0 answers

GroupLayout - components alignment

I have some issues with the alignment of the components in the groupLayout. I want to make a calculator type of Layout with 2 text fields at the top, right below 6 buttons, arranged in 2 columns and 3 lines and a text field for the result but the…
0
votes
1 answer

GroupLayout not aligning properly

I have been trying to make a program that allows the user to create squares and circles of a color that they can set using JSliders. I am trying to use GroupLayout to set this up, but it is not working the way that it seems it should. I want the…
Mr.Binary
  • 35
  • 6
0
votes
1 answer

Resize JDialog with JPanel and GroupLayout manager

I have JDialog which have one JPanel with GroupLayout manager. I have following code: Create JDialog: DialogPanel rectangeDialog = new DialogPanel(clickedObject); rectangeDialog.addWindowListener(new WindowAdapter() { @Override public void…
Morticia A. Addams
  • 363
  • 1
  • 7
  • 19
0
votes
1 answer

Can Components be added to groups in GroupLayout dynamically?

Can Components be added to groups in GroupLayout dynamically, after setHorizontalGroup() andsetVerticalGroup() have been called, without resetting the layout? I'm working on the GUI to a project that will help students find the best way to put…
Nick Muise
  • 303
  • 4
  • 10
0
votes
2 answers

Why is my GroupLayout giving an 'exception in main' error?

I want to use GroupLayout to get a usernameLabel/Field and passwordLabel/Field display, like so: Username: usernameField Password: passwordField The code I am using is as follows: layout.setHorizontalGroup( …
user4561003
0
votes
1 answer

Java Swing Print Dialog GroupLayout label color

I have used the UIManager to style my application UI so far. All is well except in my printing dialog, created using ServiceUI.printDialog. I see it has inherited much of my UI style e.g. the dark background and white text, but the problem is the…
petehallw
  • 1,014
  • 6
  • 21
  • 49
0
votes
0 answers

Swing designed form from GroupLayout to GridBagLayout design

I have designed a application form in Java SWING. With the internal frame to get user input. The application works fine; but fails in UI, based on different screen sizes. I have used the GroupLayout system in the Netbeans, whilst designing. After…
0
votes
1 answer

Column of GroupLayout is Unaligned

The leftmost column is what I'm referencing here: About a week ago, I convinced my dad to ditch Windows 10 in favor of Linux Mint. The transition's been quite bumpy so far, considering how he likes to have a simplistic interface. He's not willing…
0
votes
1 answer

GroupLayout z-order

everybody! I have problems with drawing my components in z-order using GroupLayout. My button works not stable (dissapears for ex. if mouse was moved). What's this? Errors in drawing? This is code to set z-order. javax.swing.GroupLayout…