layout-manager

How to use MigLayout?

Hi folks, I read some information about Java layout managers and the recommendation was MigLayout. My problem is, that I didn't found any tutorial or easy step-by-step documentation. So I want to know how this all works, but I don't know how. Hope, it's not to trivial. Thanks in advance, guerda ...

Can a layout manager spawn several JPanels?

I have to build a rather large form with many controls. The controls are divided in basic controls/settings and extended controls/settings. The user can decide if he wants to see only the basic or both basic and extended controls. I've dropped all extended controls onto their own JPanel so that I can easily switch between the two views ...

How can I implement my LayoutManager without instanceOf?

For a certain layout that I'm working on, I need to make my own LayoutManager. It will lay out different components depending on what type they are: Labels in one way, Separators in another way, and everything else in a third way. I can easily implement this and to determine the different positions for different types of components, i...

How much support does GWT have for Java layout managers?

This seems to be a question where the answer is implicit, hence I can't find anything explicit. Does Google Web Toolkit only support custom layout managers, or a sub-set of the Java layout managers? For example, is it possible to take a Java Swing application using GroupLayout and get it to work with GWT? ...

How to locate JLabels to an absolute position on Java GUI

I have many JLabels (which includes ImageIcons) in a JPanel. And this JPanel is only a panel on the GUI; there are lots of other panels. I want to place labels to the exact pixel coordinates on their JPanel container. How can I do that without using GroupLayout? ...

jQuery Layout Manager

Has anyone had any experience with a jQuery-based layout manager? I know of only one (JX) but it's somewhat bloated for my needs. Any thoughts? ...

Get height of multi line text with fixed width to make dialog resize properly

I want to create a dialog that contains some kind of text element (JLabel/JTextArea etc) that is multi lined and wrap the words. I want the dialog to be of a fixed width but adapt the height depending on how big the text is. I have this code: import static javax.swing.GroupLayout.DEFAULT_SIZE; import java.awt.event.ActionEvent; import ...

Are there Constraint Layout Managers on iPhone OS?

The CA Programming Guide is talking about Constraints Layout Managers. However, the CALayer in the iPhone SDK doesn't have any constraints property or addConstraint method. They say iPhone OS just doesnt provide custom layout managers. But how about the standard ones? ...

Can I use MiGLayout with C++?

I wonder if there is a C++ port if MiGLayout or if there is a way that I can use MiGLayout with C++. ...

In Java 1.6, why does adding a Jpanel to another JPanel using the default add() not display the added panel?

I have a JFrame with a JPanel on it. I want to add another JPanel which is a preconfigured component onto the Jpanel inside my JFrame. If I do this: subPanel.setLayout(new BorderLayout()); subPanel.add(preconfiguredPanel,BorderLayout.CENTER); my Panel will show. If I do this: subPanel.add(preconfiguredPanel); my JPan...

How to make JLabels start on the next line

JPanel pMeasure = new JPanel(); .... JLabel economy = new JLabel("Economy"); JLabel regularity = new JLabel("Regularity"); pMeasure.add(economy); pMeasure.add(regularity); ... When I run the code above I get this output: Economy Regularity How can I get this output, where each JLabel starts on a new line? Thanks Economy Regular...

Which Swing layout(s) do you recommend?

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 ain't working out for me. See my other question. So... if you have a Swing app to design, and you want your layout just so, what are your preferred layout managers? Any...

A java sidebar with GridBagLayout

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 help explain what I am doing wrong. What I want is for the side bar to contain two JPanels. The code that I have places them halfway down the sidebar instead of at...

How can I set a JPanel maximum or preferred size that uses gridLayout?

Hi guys, I had problem using a very simple frame containing two JPanel. The problem is on the layout of the Center JPanel that contains four JButton. How can I set a better size for buttons or directly for JPanel that uses the GridLayout. On the picture the problem: ! Here the code: ` JFrame window = new JFrame("Horrible! LOL"); ...

Searching for a Java layoutmanager which hides elements if space is getting short

Hi, I'm searching for a Java layoutmanager which is able to automatically hide (less important) elements, defined by me, if the user scales down the window size. For example an icon in a row of a label and a JTextField, which is only there to visually enhance the form. If the user resizes the window to a minimum size, the icon should d...

Making BoxLayout move components to top while stacking left to right

Hi, I have a JPanel which uses a BoxLayout in the X_AXIS direction. The problem I have is best shown by an image: As you can see the JPanel on the left is has been centered rather than aligned at the top. I would like them both to be aligned at the top and stacked left to right, how can I achieve this with this layout manager? The cod...

how to include more than two panel in a frame?

Sir, We are working on a project.Here we encountered with a problem ie we are unable to include more than two panels on the same frame .What we want is one panel above the other. Can you please help us with this? ...

How to use RelativeLayout to make a custom component on Android

I'm trying to make a custom component based on buttons without having to deal with all the layout myself. The problem is that i can't find a way to make use of RelativeLayout to draw the thing. This is my latest attempt. A bitmap is returned by layoutManager.getDrawingCache(), but it does not show any buttons. canvas.drawColor(...) howev...

Best Practice Guide: Swing

Hi! 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 I can use to set a good standard for my projects. I haven't used too much of Swing by myself. Surely clicking a GUI with a GUI designer isn't a big...

How do I keep JTextFields in a Java Swing BoxLayout from expanding?

I have a JPanel that looks something like this: JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); ... panel.add(jTextField1); panel.add(Box.createVerticalStrut(10)); panel.add(jButton1); panel.add(Box.createVerticalStrut(30)); panel.add(jTextField2); panel.add(Box.createVerticalStrut(10)); panel.a...