Layout 1 « Layout « Java Swing Q&A





1. Which Layout Manager do you use?    stackoverflow.com

What java GUI layout manager does everyone use? Lately, I have been using MigLayout, which has some powerful component controls. Just wanted to see what other developers ...

2. Java Swing: Libraries, Tools, Layout Managers    stackoverflow.com

What libraries/tools do you have in your Java Swing Tool set?

  • XUL
  • Layout Managers
  • Packagers/Installers
  • Books
  • etc.....

3. java swing - layout oddness when using different layout managers    stackoverflow.com

Bit of oddness, seen if I do the following:

import javax.swing.*;
public class FunkyButtonLayout {
    public static void main(String[] args) {
        JFrame frame ...

4. Java GUI layout problems    stackoverflow.com

I'm writing a small Java GUI program, and I'm having some issues with Java not laying things out properly. I haven't done much Java GUI code lately, so I'm having trouble ...

5. GUI creation code layout theory?    stackoverflow.com

This question is not so much a "How to create a gui", but more of a "where to create the gui". I have some java code that checks to make sure the ...

6. Windows Layout Look and Feel    stackoverflow.com

I am looking for the Windows Look and Feel Design Guidelines (but not the one for Windows Vista!) that details the ideal gap between elements, etc. I found the ...

7. Letting a Java Swing program layout itself again    stackoverflow.com

I always have trouble with Java layouts, but the main thing bugging me now is that when the content changes, in particular changes it sizes, it's not laid out again properly. ...

8. alternatives/improvements to JSplitPane    stackoverflow.com

I had a fairly simple dialog with a pair of JPanels of roughly equal size, contained in a JSplitPane. Now I'm looking at adding a 3rd JPanel and I'm not so ...

9. Swing listen for child layout changes    stackoverflow.com

I have a JPanel and when its layout changes, I need to re-layout the parent. This can easily be done with panel.getParent().validate(), but the problem is, I don't always know if ...





10. Layout: From Swing to Dojo    stackoverflow.com

I've had some experience in Swing and now I'm trying my hand at writing an ajax app in dojo. I'm particularly having a problem with layout. In Swing I'm used to ...

11. Using different layouts in GUIs    stackoverflow.com

This is what my program should look like and I'm a bit confused on where I should use different layouts. I have a Window class which calls the Panel class and ...

12. Which Swing layout(s) do you recommend?    stackoverflow.com

There are 8 layout managers in the Java library alone, and then there's a bunch of 3rd party products as well. The other day, I tried to use SpringLayout and... well, it ...

13. A java sidebar with GridBagLayout    stackoverflow.com

I am attempting to draw a sidebar for a project that I am working on. I chose to use GridBagLayout because I became frustrated with the limitations of BoxLayout. Could someone ...

14. Swing layout problem    stackoverflow.com

Hello I'd like to get this swing layout inside a JPanel: JLabel - JTextField - JComboBox as the panel resizes I'd like the textField to expand but not the other two. Everything must ...

15. Java Swing layout issue    stackoverflow.com

I added child panel to parent panel by using method 'parent.addTab(child)' and added one JLabel in the child panel but setBounds method is not working in child panel. This JLabel ...

16. swing: appropriate layout manager for simple situation?    stackoverflow.com

I have a JPanel that I want to use to contain 3 vertical components:

  1. a JLabel
  2. a JTextField
  3. a JScrollPane
I want all 3 components to fill the JPanel's width. I want the JLabel and ...





17. Changing layouts in SWING    stackoverflow.com

I have written a program with flow layout, in Java, using Swing Framework. How do I change it to use group layout?

18. Multiple Layout Managers in Java    stackoverflow.com

Is there way to use more than 1 layout manager in Java. Right now I'm using a gridLayout to implement a chess board but beneath it I would like to put ...

19. Need help with Layouts in Swing    stackoverflow.com

I'm using Java Swing and I have the following problem: I have a class TnaiPanel that extends JPanel. In this class I am creating 3 components and then lay them out in ...

20. Best Practice Guide: Swing    stackoverflow.com

Does anybody know Swing related GUI guidelines - specifically on how to design Swing apps and which components I should use? I'm not looking for an official standard, but pragmatic tips ...

21. Java layout ignored properties documentation    stackoverflow.com

Is there a table documenting which properties each java layout ignores (max size, min size, etc)?

22. Creating GUI for Bantumi game    stackoverflow.com

I've written backend for simple Bantumi game. Now I'd like to create a simple GUI for it, so that it would look like this : alt text How to ...

23. Problem using FormLayout in Swing    stackoverflow.com

Hi I am using the FormLayout. I just discovered it and it's powerful layout manager. I would like to layout 4 components (outlined, properties, tgraph, library) in 3 columns. I ...

24. Building a Monopoly Board with GridBagLayout    stackoverflow.com

I have been building a Java version of Monopoly in my spare time and am having some trouble understanding layouts etc for Swing. Each one of my spaces on the board is ...

25. Question about GridBagLayout in Java    stackoverflow.com

When I am using GridBagLayout , whenever the window is resized the component locations change to the fit new size .. Now I want to change the location of a component after ...

26. Variable Layout in Swing    stackoverflow.com

How would you go about getting a decent looking gui generated when you don't know how many components you will have and how big they will be? A user, for instance, enters ...

27. Why is addSeparator() not working with my JToolBar?    stackoverflow.com

I am having trouble getting a JSeparator to show up inside of a JToolBar. My toolbar is created as follows :

public class ToolBar extends JToolBar {
    super();

  ...

28. Inserting Boxes in Netbeans designer    stackoverflow.com

I'm trying to insert some spacers into a layout on JPanel. I've got 3 buttons and I'd like to put something similar to Box.createRigidArea(new Dimension(10, 0)) between them. Netbeans 6.9.1 doesn't ...

29. GridBagLayout goes crazy    stackoverflow.com

I have a GridBagLayout, but one label (maxSizeLbl) goes crazy and an other one (maxDateLbl) isnt visible, anyone knows what I've done wrong? Here is the Picture: alt text And here is ...

30. Help regarding java swing/GridBagLaytout    stackoverflow.com

I'm currently trying to implement a Swing/GUI that could be regarded as a RDF editor. For each property , I can add/remove one ore more widgets storing the values (JTextField, JScrollPane+JTextArea, JCombo, ...

31. Improving Swing layout    stackoverflow.com

I have a following code :

import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.Label;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;

public class Main extends JPanel implements ActionListener {

    protected JTextArea output;
 ...

32. java swing library with layout defined in XML    stackoverflow.com

Is there a swing library that can take its layout from an XMl file?

33. Java-Swing: A problem using layout managers!    stackoverflow.com

I'm working on a JDialog (by hand, no GUI builders) and I'm having a problem doing the layout.
I have this:
alt text
My problem is that I don't know what ...

34. Force immediate layout and paint in Swing    stackoverflow.com

I cannot seem to force a layout in Swing. I have a JComponent added to a JLayeredPane and I set a border on the JComponent. Then, I want to immediately re-draw ...

35. java GridBagLayout anchor    stackoverflow.com

Learing GridBagLayout, The issue here is, the name label and combox don't show up on the top of the panel, but I have set its anchor to NORTH. Why ?

import java.awt.GridBagConstraints;
import ...

36. Understanding layout managers -- I'm not, please enlighten me    stackoverflow.com

I'm just not understanding why things are being resized when I call the validate() and repaint() methods. I'm struggling to understand this. Essentially, my program is meant to display ...

37. 960.gs layout issue    stackoverflow.com

I am trying to learn 960 grid system. My left body text appears on the right and vice versa for the other text. My intention is to have these two ...

38. Problem with the layouts in making a JAVA GUI    stackoverflow.com

Here is a screenshot of my JFrame. This will be the main window to my application. enter image description here So the problem is that all the buttons ...

39. Issues with GridLayout    stackoverflow.com

In my application i am looking to fill the JPanel with buttons generated dynamically. I am using GridBagLayout for that. 1.) When i setup the layout manager to fill just ...

40. how to use the layout managers in swing java    stackoverflow.com

I'm new to layout managers like Flow, borders, ...
I mostly use setBounds() to set the position of my components. I read on an article that using setBounds is not an good practice ...

41. Argument of setHorizontalGroup()    stackoverflow.com

The method setHorizontalGroup is defined as: setHorizontalGroup(GroupLayout.Group group) .I dont understand it's argument after going through this :

layout.setHorizontalGroup(
layout.createSequentialGroup()
  .addComponent(c1)
  .addComponent(c2)
  .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
       .addComponent(c3)
 ...

42. J2ME Form Layout    stackoverflow.com

I'm trying to make a menu like shown below. I have some items that extends CustomItem and consists of an Image and some Text. Now I want to position them as ...

43. IntelliJ Idea GUI Forms: Null Layout    stackoverflow.com

Hey all, I'm migrating from Netbeans to IntelliJ. Now I'm trying to create a GUI form, and, unlike Netbeans, IntelliJ doesn't let you use a "Null Layout". Is there any way ...

44. Java gui layout    stackoverflow.com

How can I make a gui layout in java which is column based? by that i mean: JLabel
JTextField
JLabel
JTextField
JLabel
JTextField I want them all stacked on to of each other, rather than side ...

45. Swing: proper layout manager interaction with upper-level layout manager?    stackoverflow.com

I'm experimenting with a custom LayoutManager and I don't understand the subtleties of using it within a component that itself has an upper-level layout manager. enter image description here Below is ...

46. Form layout to call JColorChooser    stackoverflow.com

I'm writing a Java Swing program that needs to enable the user to select 8 different colors from a Settings form. This is quite straightforward as far as it goes with ...

47. Java layout problem    stackoverflow.com

I've got 3 classes in my program.

public class Field extends JLabel{

    private int x, y;

    public Field(int x, int y){
      ...

48. Why is it frowned upon to use a null layout in SWING?    stackoverflow.com

Recently, I started creating a program for the company I work for. Just as backgound info, I'm still a student and a beginner programmer, so my solution is probably not recommended ...

49. more efficient layout than Box    stackoverflow.com

I've got some very old code which uses a Box to list some information. I create it like so:

Box patterns = Box.createVerticalBox();
Very (very) often, new items are added and old items ...

50. Problems with my GridLayout    stackoverflow.com

I have a GridLayout 2 rows by 5 columns, and I want to make the height of the first row to something like 50, and the second row to 200. I ...

51. Can I customize the layout & look n' feel of a flickr page    stackoverflow.com

I am wondering if I can customize elements on a flickr page like background image, font color the way I customize a Youtube channel or a twitter page. Thx in advance. ...

52. How to debug Java Swing Layouts    stackoverflow.com

There is one method which prints layout information for particulat components. I knew one method is there but I forgot the name. When you call that method for Swing component it displays ...

53. how to generate this layout in java swing    stackoverflow.com

I am wondering if anyone can help me with the generation of this layout: enter image description here I have wasted a lot of time. What I want is: 1) The sizes of ...

54. Layout Java help    stackoverflow.com

Hi guys can anyone help? I need to do a layout for my program in java to look something like this http://i1184.photobucket.com/albums/z321/Rbn_Veiga/Picture111.jpg

55. Layout Manager preferredSize Java    stackoverflow.com

I'm still trying to learn how layout managers work. I made a Frame with two JPanels. The first one contains a textArea with a boxLayout. The second one contains a flow layout with ...

56. Online Java GUI Builder? At least Layout Manager    stackoverflow.com

I cannt find one online and I am suprised there isn't one... but is there an online Java GUI Layoutmanager at least?

57. Swing layout problem    stackoverflow.com

I'm lost in the Swing laying out nightmare :( I'm going to expose my problem, but I'm looking for advices as well as the clear solution. My problem : I want to ...

58. java which layout manager suitable for this task?    stackoverflow.com

I have a JPanel parent with 3 JPanel children inside. They all currently make use of GridLayout and together represent a UML class. Problem is that when I add a ...

59. Building simple GUI using swing library in Java 1.6    stackoverflow.com

I'm new to Java so please be patient with me. I'm trying to build a simple GUI using swing library. I don't understand why my table is erasing everything that previously ...

60. Java GridBagLayout automated construction    stackoverflow.com

I designed a GUI using GridBagLayout and GridBagConstraints. It contains a variable number of rows, each with one of a few possible column layouts. To test the code, I ...

61. Unusual gaps while using JSeperator - Java    stackoverflow.com

I have been working on a Swing GUI and getting some unusual and unwanted gaps after adding JSeperator, Any idea how to remove them? Or any other option to how to ...

62. JViewports with null Layouts?    stackoverflow.com

I got a JViewport correctly scrolling using the default layout manager (using viewport.setViewPosition), but when I call setLayout(null) this no longer works. Any ideas? I can give code if needs be, but it's ...

63. Java Swing Layout    stackoverflow.com

I would like the following lay out...

  • JButtons on top along side eachother.
  • The JTextArea should be under the buttons.
  • The JTextArea should also have a scrollbar.
    ...for the code below.
    JPanel jp = ...

64. Should I use a layout manager even if it seems unnecessary?    stackoverflow.com

I have a JPanel, on it are added an image and label, in that order. It is very unlikely that more will be added to the panel. The default formatting looks fine when ...

65. Layout suggestions for GUI?    stackoverflow.com

So I want to make a new JList and a new JPanel at the bottom, but I'm not too familiar with the BoxLayout, FlowLayout and the like. What do you suggest ...

66. Two layouts, one GUI ?    bytes.com

I currently created a GUI using the GridLayout in order to have JLabels and JTextFields side-by-side. However, below the button, I would like to have a FlowLayout or something to display ...

67. I need layout/font help with NetBeans IDE 6.7.1 - Swing GUI Forms: JApplet Forms    forums.netbeans.org

I'm using NetBeans IDE 6.7.1 to design a series of java applets for use in a number of webpages. The panels (and nearly each swing control) in the applets should have ...

68. GUI Layout problem    forums.netbeans.org

I have a form which I am having trouble aligning. Once a GUI object is placed in the design tool, I can't always change it's location. It seems that it is ...

69. gridbag layout gui    forums.netbeans.org

No. But you can select every component in the Inspector window and scroll down to the section "Layout" in the properties window where the grid bag constraints can be set manually ...

70. Netbeans GUI Builder Layout Inaccurate - Error Prone - Problems    forums.netbeans.org

Dear Boffins I believe there is a fault with the accuracy of the netbeans GUI Builder. In particular, I believe the layout aspect of the netbeans Swing Builder contains bugs. I'm ...

71. GUI builder without layout manager    forums.netbeans.org

I am using NetBeans 6.8. Can I make NetBeans's GUI Builder not to generate setLayout(..)? Components I used have their own layout manager that do not to when use them. In ...

72. Replacement for "Swing Layout Extension Integration" module in 6.9    forums.netbeans.org

Hi, In Netbeans 6.9 "Swing Layout Extensions Integration" platform module appears as deprecated (I guess that's what the strikethrough text means). So why is it deprecated and what can I use ...

73. Migrating from Swing Layout Extensions Module to Java6 Swing?    forums.netbeans.org

I have a Netbeans Platform/Module Suite application that uses a bunch of Swing GUI elements initially created in the GUI editor of Netbeans 6.5 and 6.8, for Java 1.5. I'm in ...

74. new to layouts/GUIS... please offer guidance    forums.netbeans.org

Posted: Thu Oct 07, 2010 8:23 am Post subject: new to layouts/GUIS... please offer guidance ok so i'm still in the middle of this blkjack 21 game i am trying to make. the first thing i wanted to do was to center the card deck in the middle of the Panel which rests on top of the Frame ...

75. Why does NB package swing-layout-1.0.4.jar - even when not used?    forums.netbeans.org

I have a Java SE project that does not use any NB-specific layouts. It does use a single third-party library: jGraph. When I do a clean/build, the dist/ directory contains the project jar file and a library directory with jgraphx.jar in it - as well as swing-layout-1.0.4.jar. Why is it including the latter?? Is there a way to prevent that? thnx, ...

76. Problem running jar file (library swing-layout)    forums.netbeans.org

If the program runs in the IDE, it works perfectly. But if the program is open using the Jar file generated from NetBeans, then it doesn't work well.

77. How to generate my own GUI layout ?    seamframework.org

78. Layouts    coderanch.com

If you want three different sets of buttons to appear, you need to create three different sets of buttons using new Button(). Right now you're only creating one set of buttons and trying to add it to three different panels, which doesn't work. Each component you create should only be added once to a container. If you want nine buttons, there ...

79. layout problem    coderanch.com

80. Layout managers    coderanch.com

Mohnish, Here is what RHE has to say on your topic: "Why Java Uses Layout Managers There are two reasons why Java's AWT uses layout managers. The first reason is a bit theoretical, and you may or may not find yourself convinced by it. The second reason is thoroughly practical. The theory lies in the position that precise layout (that is, ...

81. gridlayout and null layout??    coderanch.com

82. layout    coderanch.com

import java.awt.*; import java.io.*; public class mframe extends Frame{ Button bn,bs,be,bw,bc; public mframe(){ super("maha"); Button bn = new Button("North"); Button bs = new Button("South"); Button be = new Button("East"); Button bw = new Button("West"); Button bc = new Button("Center"); setLayout(new FlowLayout()); //add(bn); add(bs); add(be); add(bn); add(bn);} try{ add("North",bn); setSize(300,300); setVisible(true); System.out.println("Added north and sleepling"); Thread.sleep(2000); add("East",be); setSize(300,300); setVisible(true); System.out.println("Added East and ...

83. which layout manager to use    coderanch.com

Hi all, I've 4 comboboxes, 4 labels for comboboxes and one text field and two buttons. I am planning to add all these to panel. I'll add panel to a frame. I'm planning to use borderlayout for frame. Which layout manager will be suitabel for panel, if I add the above specified components to it. I don't want to use absolute ...

84. Help with Layout    coderanch.com

I'm a newbie trying o create a calculator with the display only on top (p1), and the number keys 0-9 (p2) and operators x,-,+,=,/ in the row below it. I keep getting all three in a row. There must be an obvious answer, but since I'm gree, I would really appreciate your help. Thanks in advance....here's the code. import java.awt.*; import ...

85. confusion with some layout methods    coderanch.com

86. GridBag Layout    coderanch.com

87. custom Layout Managers    coderanch.com

Does anyone know of a good archive of custom layout managers? Right now I'm writing a layout manager of my own, but it struck me that the one I'm writing seems pretty useful, so someone else may have written it already. Otherwise, if it isn't already written, I'll open source it anywhere someone will take it. I'm writing a layout manager ...

88. Layout    coderanch.com

The drawing of your layout doesn't look exactly right... I think that some of the spaces you inserted for spacing were eaten... Anyway... I think this was the layout you wanted... if not, post back what needs to be fixed... import java.awt.*; import java.awt.event.*; import javax.swing.*; public class TestLayout { private JFrame theFrame; private JPanel theBoard; private JTextField theTextField; private JTextArea ...

89. How to create a custom layout manager    coderanch.com

90. layout manager graphic problem    coderanch.com

Is it possible for a layout manager to do graphics stuff (draw lines, circles, etc) on its parent container during the layoutContainer() method? I'd like to add some lines and circles every time a container is laid out (resized, etc.), so it seemed that putting that stuff directly into the layout manager was the best idea. However, the lines flash, then ...

91. my brand spanking new layout manager    coderanch.com

JavaRanch Java Forums Java Swing / AWT / SWT / JFace Author my brand spanking new layout manager Micah Wedemeyer Ranch Hand Joined: Jun 11, 2001 Posts: 68 posted Nov 08, 2001 09:54:00 0 I've been working on a custom layout manager for a long time now, and I'm almost done. I call it OrbitLayout and it displays ...

92. Overlay layout    coderanch.com

94. Desktop Layout    coderanch.com

Hi, I'm trying to create an application which has the look of Windows Explorer: I want toolbar at the top Middle area to be kept free And a status bar at the bottom _______________________________________________ File Edit View etc... ----------------------------------------------- TOOLBAR ----------------------------------------------- This is where internal frames will appear.. _______________________________________________ STATUS BAR ----------------------------------------------- Can this be done using GridBag Layout as I ...

95. Custom Layout Manager    coderanch.com

I'm not terribly experienced at creating custom layout managers, but inexperience hasn't stopped me from making something up yet... I understand what you mean. I don't know how the existing layout managers provide that behavior. Have you tried looking at the source code for one of the existing layout managers that has the behavior you want to use? Otherwise, in a ...

96. Layout Managers    coderanch.com

97. Which is the best layout?    coderanch.com

98. how to re_ layout?    coderanch.com

99. Layout    coderanch.com

100. Layout again    coderanch.com