GroupLayout « Layout « Java Swing Q&A





1. GroupLayout: Is it worth learning?    stackoverflow.com

I'm relatively new to java (specifically swing) and have recently been making some fairly simple applications, learning as I go. The latest one has lots of form components such as JLabels, ...

2. NoClassDefFoundError: javax/swing/GroupLayout$Group on Mac Computer    stackoverflow.com

I am having a runtime error ONLY when I test my Java program on a mac computer. It tests perfectly fine on various Windows operating systems. This is the ...

3. javax.swing.grouplayout not exist in jdk 1.5    stackoverflow.com

I developed a java application with netbeans. It used jdk 1.6. It works fine. But now the requirement is I need to build the jar for the application from the .java files in ...

4. Setting maximum width using Matisse GUI builder    stackoverflow.com

I'd like to create a GUI where some of the textfields are resizable horizontaly but maximum width is also specified. For instance the preferred width is 100 pixels, it can be ...

5. Layout manager won't work    stackoverflow.com

I have done an layout in my GUI but it did not work , all the component just appear one after another. Here is my codes :

import javax.swing.*;
public class main ...

6. what's the difference between DEFAULT_SIZE and PREFERRED_SIZE?    stackoverflow.com

I'm using Swing GroupLayout and I'm confused about the values GroupLayout.DEFAULT_SIZE and GroupLayout.PREFERRED_SIZE. I never know when to use each one of them in methods like GroupLayout.addComponent(Component, int, int, int). suppose I ...

7. Mixed alignment with Java Swing's GroupLayout    stackoverflow.com

I'm trying to build a GUI window in my application. What I'm trying to do is have a window, with a few buttons at the top, and a large text ...

8. Java's Swing seems to be changing the layout from Card Layout    stackoverflow.com

I am having some pretty strange symptoms with JPanels and CardLayout. Essentially, I have cards which act as "pages" since I can only hold 12 cells on the grid, and I ...

9. Stopping GroupLayout components from stretching vertically    stackoverflow.com

Is there an easy way to get all (or most) of the components in a GroupLayout application NOT stretch vertically? I know I can do it by forcing each component ...





10. GCJ javax.swing.GroupLayout    stackoverflow.com

I am using gnu compiler for java version 4.4.4. It doesn't come with support for javax.swing.GroupLayout. Do later versions come with this support? I have build GCC many times before on ...

11. Why doesn't my JPanel's preferred size change when its contained JScrollPane does in GroupLayout?    stackoverflow.com

Using GroupLayout and the code below, I noticed that the leftPanel is not updating it's preferred size. I thought this was supposed to be automatic and appears to work in ...

12. GroupLayout giving error with java swing    stackoverflow.com

I am getting a long list of errors. Can anyone suggest to me where I am going wrong with GroupLayout.

layout.setHorizontalGroup(
    layout.createSequentialGroup()
      ...

13. Swing GroupLayout show only one component? How to fix that?    stackoverflow.com

So, I have basic frame with GroupLayout and 3 component. It in theory should look something like that

[------label------]
[button][button]
But it shows me only last used button component (button ...

14. Changing GroupLayout to GridBagLayout    stackoverflow.com

Am creating a simple calculator GUI and I have been using netbeans IDE GUI builder. I have been trying to make sense of the GroupLayout code and unfortunately I just ...

15. problems with addGap(int) in GroupLayout.Group    stackoverflow.com

This is the snippet :

JPanel logoPanel=new JPanel();
GroupLayout logoLayout=new GroupLayout(logoPanel);
logoPanel.setLayout(logoLayout);
logoPanel.setHorizontalGroup((GroupLayout.Alignment.BASELINE).addGap(100,100));
logoPanel.setVerticalGroup((GroupLayout.Alignment.BASELINE).addGap(100,100));

These are the errors produced on cmd :
MainPageTypo.java:27: cannot find symbol
logoPanel.setHorizontalGroup((GroupLayout.Alignment.BASELINE).addGap(100,100));
             ...

16. Getting the correct sizes for JComponent after using GroupLayout    stackoverflow.com

I wanted to ask whether it is possible to get the correct sizes of an JPanel after it has been placed in another JPanel that uses GroupLayout as Layout Manager. I ...





17. How to make components normal sized in GroupLayout in Java    stackoverflow.com

I am trying to make a layout for my applet, but I cannot handle one problem - some of the elements (e.g. JComboBox) are as big as they can be - ...

18. How to center content of a GroupLayout in Java applet    stackoverflow.com

I would like to center content of a GroupLayout in Java applet. After long research I still cannot figure out how to do it. Code below shows my applet. All elements are ...

19. Gap size after placing JSeparator in Java Swing    stackoverflow.com

I have a simple problem here in Java Swing. I simplified my code to the following snippet. I am not sure how I can minimize the gap size between the horizontal ...

20. With GroupLayout, how can I align separate components to each end of one longer component? Or, can one component span multiple parallel groups?    stackoverflow.com

tl;dr: I want to do what's in the second picture (ignore the red lines) I understand how GroupLayout works, but I can't figure this out, or whether it's even possible. I initially ...

21. no GroupLayout in NetBeans 7, what's wrong?    stackoverflow.com

Something wrong, I can't choose GroupLayout in NetBeans 7, I'm using Java 1.6

java version "1.6.0_26" Java(TM) SE Runtime Environment (build 1.6.0_26-b03) NetBeans IDE 7.0.1 ...

22. NetBeans, GUI builder (group layout) centering a component    stackoverflow.com

I'm trying to design a JButton (an "Ok" button) that to look good has to be horizontally centered in the containing JFrame.
I'm using the GUI Builder with the Free ...

23. Java Swing GroupLayout Issue    stackoverflow.com

I'm trying to use GroupLayout to make something that looks like this: Example layout Consider only the first two rows of the layout. The second row has only two components. How ...

24. swing-layout-1.0.3.jar and org.jdesktop.layout.GroupLayout usage with GUI builder    forums.netbeans.org

I'm creating a maven2 -based desktop application which uses Swing Application Framework. I start by creating the project from this maven archetype: Swing Application Framework (JSR 296) Archetype Archetype for creating ...

25. How to specify minium size using GroupLayout from GUI designer ?    forums.netbeans.org

According to official Sun tutorial (http://java.sun.com/docs/books/tutorial/uiswing/layout/group.html), it is possible to make a component resizable with a command like this : group.addComponent(component, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) Maybe, I miss something, but I don't ...

26. GUI Builder using the old org.jdesktop.layout.GroupLayout?!    forums.netbeans.org

I'm using NetBeans 6.8 with JRE 1.6.0_17 on a 64-bit Mac w/ OS 10.6.2 (this is all up-to-date). I'm using the GUI Builder to create a JApplet, and it runs perfectly ...

27. Swing GUI Builder and GroupLayout    forums.netbeans.org

Hi everybody. When I use the GUI Builder, I'd like to know what are the controls grouped-togheter (horizontally and vertically). This because things like anchors apply to the group and not to the single control. Actually I look in the code... that in complex forms isn't very friendly. thanks in advance agostino p.s. Shouldn't be usefull to have more control on ...

28. Netbeans 7 CRUD Tutorial faling - with NoClassFound - javax.swing.GroupLayout    forums.netbeans.org

Hi, Is there any compatibility between Netbeans 7.0/6.9.x with >System Info: Operating System = Windows XP version 5.1 running on x86 Java; VM; Vendor = 1.6.0_24; Java HotSpot(TM) Server VM 19.1-b02; Sun Microsystems Inc. Runtime = Java(TM) SE Runtime Environment 1.6.0_24-b07 Java Home = D:\Programs\Java\jdk1.6.0_24\jre A simple CRUD application as mentioned in Tutorial ( the first step of running a Simple ...

29. Problem with GroupLayout Manager    coderanch.com

30. Syntax for GroupLayout    coderanch.com

31. Problem with GroupLayout    coderanch.com

32. Regarding GroupLayout    coderanch.com

33. using GroupLayout    coderanch.com

Sorry about not using code tags, hope this is better; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.text.*; import javax.swing.event.*; public class InputOutputPanel extends JPanel{ private JLabel inputLabel; private JTextField input; private String line; private JTextArea output; private JScrollPane jScrollPane1; public static void main(String[] args){ JFrame frame = new JFrame("input/output"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); InputOutputPanel panel = new InputOutputPanel(); frame.getContentPane().add(panel); frame.pack(); frame.setVisible(true); } public ...

34. Help in GroupLayout    coderanch.com

35. NoClassDefFoundError: with GroupLayout    coderanch.com

36. problems with groupLayout    coderanch.com

37. GroupLayout not working in a JPanel    coderanch.com

hi JavaRanch i've recently been playing around my project to try to get a nicer GUI on it, however i've hit a stumbelling point! He's the main class from my project. import java.awt.event.*; import javax.swing.*; import javax.swing.border.*; import javax.swing.text.*; import static javax.swing.GroupLayout.Alignment.*; class Main { //JMenu with a couple of functions! public static JMenuBar menuComponents(){ @SuppressWarnings("serial") class ExitAction extends AbstractAction { ...

38. How to get this attached design using Layout Managers - sans GroupLayout    coderanch.com

Hi I would like to get the attached swing layout but I'm unable to. I was trying the below code. JLabel imglabel; JTextArea imgarea; JButton imgload; ImageIcon myimage; ImageD(String s) { setTitle(s); setSize(800,800); setLayout(new BorderLayout()); imgload = new JButton("Load ImG"); imgload.setMaximumSize(new Dimension(10,20)); imgload.addActionListener(this); imglabel = new JLabel(); imgarea = new JTextArea("uneditable",40,50); imgarea.setEditable(false); add(imgload, BorderLayout.NORTH); add(imglabel, BorderLayout.EAST); add(imgarea, BorderLayout.SOUTH); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setVisible(true); } ...

39. GroupLayout in 1.5 - is it possible?    coderanch.com

40. Doubt with GroupLayout    java-forums.org

Hello everybody, i have been using GroupLayout and I encountered a little problem that i could not solve. I would like to see if any of you are able to give me a hand with this. I try to add two components to a container (one over the other in Y AXE) , using the following code layout.setHorizontalGroup(layout.createSequentialG roup() .add(layout.createParallelGroup((GroupLayout.LEADI NG))) ...

41. Repaint the entire JFrame (GroupLayout)    java-forums.org

Hi! I am implementing a program that simple enough to say, it will go through a sequence of windows (like when we are playing a game, before we can play the game, a sequence of windows will appear : introduction, setting, ...). Because the GUI in my program is a little complicated, so I choose GroupLayout with the help of NetBeans ...

42. GroupLayout Issue    java-forums.org

GroupLayout Issue Hello Everyone, I am trying to create a GroupLayout and everytime the program goes to execute it crashes. I am not sure as to why but it is related to my GroupLayout. Below is my code and the errors I'm presented with. Don't mind the JDBC stuff either. Java Code: /** * Module: GameTracker.java * Author: M. ...

43. GroupLayout    java-forums.org

It works: { GroupLayout groupLayout = new GroupLayout(jPanel); groupLayout.setHorizontalGroup( groupLayout.createParallelGroup(GroupLayout.Alignm ent.LEADING). addComponent(jLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)); groupLayout.setVerticalGroup( groupLayout.createParallelGroup(GroupLayout.Alignm ent.LEADING). addComponent(jLabel, GroupLayout.DEFAULT_SIZE, 442, Short.MAX_VALUE)); jPanel.setLayout(groupLayout); } It does not work: GroupLayout groupLayout; { groupLayout = new GroupLayout(jPanel); groupLayout.setHorizontalGroup( groupLayout.createParallelGroup(GroupLayout.Alignm ent.LEADING). addComponent(jLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)); groupLayout.setVerticalGroup( groupLayout.createParallelGroup(GroupLayout.Alignm ent.LEADING). addComponent(jLabel, GroupLayout.DEFAULT_SIZE, 442, Short.MAX_VALUE)); } . . . { jPanel.setLayout(groupLayout); } I want to create a ...

44. GroupLayout - problem with alignement    java-forums.org

45. Needing help with GroupLayout    java-forums.org

Im trying to add items to a GroupLayout, those items are generated by another class, the items are added by a for, but currently it is adding one group or the old ones are replaced by the newer, im not sure, this is my code: Java Code: import java.awt.*; import java.awt.event.*; import javax.swing.*; public class myClass extends JFrame { private static ...

46. [SOLVED] Alignment in GroupLayout    java-forums.org

layout.setHorizontalGroup( layout.createSequentialGroup() .addGap(10) .addGroup(layout.createParallelGroup() .addComponent(lbl_traitement) .addComponent(labelSave) .addComponent(labelSep) .addComponent(ligne_1er) .addComponent(ligne_der) .addComponent(label_ligne)) .addGap(10) .addGroup(layout.createParallelGroup() .addComponent(traitement) .addComponent(fichierSave) .addComponent(sep) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup() .addComponent(br_oui_bg1)) .addGroup(layout.createParallelGroup() .addComponent(br_non_bg1))) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup() .addComponent(br_oui_bg2)) .addGroup(layout.createParallelGroup() .addComponent(br_non_bg2))) .addComponent(nb_ligne)) .addGap(10) .addGroup(layout.createParallelGroup() .addComponent(boutonParcourir)) .addGap(10) ); layout.setVerticalGroup( layout.createSequentialGroup() .addGap(5) .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(lbl_traitement) .addComponent(traitement)) .addGap(5) .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(labelSave) .addComponent(fichierSave) .addComponent(boutonParcourir)) .addGap(5) .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(labelSep) .addComponent(sep)) .addGap(5) .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(ligne_1er) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(br_oui_bg1) .addComponent(br_non_bg1)))) .addGap(5) .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(ligne_der) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(br_oui_bg2) .addComponent(br_non_bg2)))) .addGap(5) ...

47. "Problem With GroupLayout", Please Help !    java-forums.org

Hi, i am having a problem with the code which i have written. It is not giving the desired output. i.e i wanted to place in first line a label and a text field and in second line also same a label and a text field. But i am getting all the four components in a line. Can any body give ...

48. java.lang.NoClassDefFoundError: javax/swing/GroupLayout$Group    java-forums.org

Okay a little vague maybe, but without a peer review the specific problem would not be identified. The question is what type of problem would manifest itself when the "jar" is executed but not in the NetBeans environment ? Are there compiler/execution options that would help to identify such a problem ? If it was environmental then why would a "non-compliant" ...

49. I cant see GroupLayout in javax.swing.    forums.oracle.com