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

Add a GridLayout to a GroupLayout

I am trying to add a GridLayout to a GroupLayout in my Java GUI. I know that I can add components such as buttons, text boxes, panels, etc. to the GroupLayout by using .addComponent('componentName') but it does not work for adding a GridLayout.
Daniel
  • 3
  • 3
0
votes
0 answers

Java Swing GroupLayout align component with parent

I've built a JFrame with two panels aligned like this: panel1 panel2 So their width matches. But panel2's width is greater than panel1's would be. Therefore the panel is stretched but not the components inside. I've built up panel1's layout with a…
torkleyy
  • 1,137
  • 9
  • 26
0
votes
0 answers

Javax Swing wont show all components

this is a small java program im working on for fun. My issue is, the components in the SearchTab Class will not show! In initFrame(), i have a JTabbedPlane, which shows only when i comment out a lot of components in the SearchTab Class, but will not…
vpatel589
  • 1
  • 1
0
votes
1 answer

GroupLayout needs a Container for its constructor

I'm reading about Java GUI topics, while I'm reading about GroupLayout I found that it needs a Container object. However what I understood that the LayoutManager is used to layout may container, so I need to set what is the layout for my container,…
Mahmoud Emam
  • 1,499
  • 4
  • 20
  • 37
0
votes
1 answer

generating and adding jpanels to horizontal group layout using value

I am currently trying to add Jpanels to a horizontal group for a JpanelLayout. The number of custom JPanels added is defined by an int value (which will be defined by user). Im trying to add as many identical JPanels into the parent panel as…
0
votes
0 answers

Java, GUI IllegalStateException Error

I know this have been asked in someway state or form and I looked at others, but I can't find why I am getting this error message. I'm not too well studied with GUIs and this is one of my first GUI projects I am working with. Error Code: …
Matthew
  • 3,136
  • 3
  • 18
  • 34
0
votes
1 answer

How do i set the width of an JTextPane in a GroupLayout?

im trying now for some hours to set the width of my TextPane. My Code is like this : private JTextPane eingabe = new JTextPane (); private JTextPane ausgabe = new JTextPane (); private JScrollPane scrollbar_eingabe = new…
user3793935
  • 411
  • 5
  • 22
0
votes
1 answer

Alignment using GroupLayout

I am having trouble aligning my components in my panel. Currently, it looks like this: |system...power| |fuel...................| |(slider)..............| |go.....................| I want it to look like this (with fuel, slider, and go all…
0
votes
1 answer

Loading Panel with Image in jFrame: Component must be non-null

Hello I'm a newbie here, I want to add pictures in my JFrame. I used the Grouplayout and tried to load my Image with help of this JPanel-Class. But when I use ".addComponent(Image)" it gave me the following error: Exception in thread "main"…
Tom
  • 3
  • 4
0
votes
1 answer

How can I use GroupLayout to organize a 2x2 auto-sized grid

This panel is used to organize everything this method does. It is inside a JFrame and everything works perfectly except that the positioning inside this one JPanel, which has it staggered(from left to right, there is showQuestionsPanel, new line…
0
votes
1 answer

Positioning with Java GroupLayout

The below code creates the following GUI. But I would like to have TextFields "A" and "C" completely fill their respective rows (so that their right corners are aligned with the right edge of the JComboBox. Help would be much appreciated! Here's…
Simon Rubin
  • 198
  • 11
0
votes
0 answers

enter a second group layout in GUI

I'm trying to implement this GUI and I'm missing just a JTextField. I want it to be below everything, and as wide as the 2 comboboxes. Also add some height. I was trying to use it inside the GroupLayout (in the code below), but everything gets…
user3353167
  • 782
  • 2
  • 16
  • 31
0
votes
0 answers

JPanel on Components in Netbean's free design (GroupLayout)?

I'm trying to create a Navigation Menu like in Mobile apps with Netbeans's free design. I created a portrait panel and make it outside the frame. As in the below images showed when the user clicks the navigation menu button the panel comes in to…
Caffe Latte
  • 1,693
  • 1
  • 14
  • 32
0
votes
1 answer

How to add multiple buttons using Jbutton

I made this code using jbutton and it compiles. But when i run this code only "buttoneone" shows up and "quibutton" does not show up. This is pretty weird and I cannot understand why this happens. Please help. import java.awt.EventQueue; import…
0
votes
1 answer

How can I get the size of a container gap used by GroupLayout?

I have many JPanel with GroupLayout and I use addContainerGap() to add the gap on the borders. Also I have a panel with other layout (BorderLayout) and I want to add the same gap with its container as the group layout panels (I will add it through a…
PhoneixS
  • 10,574
  • 6
  • 57
  • 73