Questions tagged [springlayout]

SpringLayout is a flexible LayoutManager in the Java Programming Language. It lets you specify precise relationships between the edges of components under its control.

SpringLayout is a flexible LayoutManager designed for use by GUI builders. It lets you specify precise relationships between the edges of components under its control. For example, you might define that the left edge of one component is a certain distance (which can be dynamically calculated) from the right edge of a second component. SpringLayout lays out the children of its associated container according to a set of constraints.

Relevant Tutorials:

62 questions
1
vote
3 answers

How to use SpringLayout to arrange components vertically

There's clearly something I don't understand about SpringLayout. I'm trying to create a class, an extension of JPanel, that allows me to add components and have them appear vertically, all the same width. My extension of JPanel would set its…
arcy
  • 12,845
  • 12
  • 58
  • 103
1
vote
0 answers

Does JEditorPane text wrap not work with SpringLayout or am I missing something?

I need to selectively format parts of a paragraph, and JEditorPane is the only thing I could find that would do that for me. But when I have a line that wraps around in the editor pane and there is an element bound below it in SpringLayout, the…
1
vote
2 answers

Java Swing: manage multiple SpringLayout

I would like to manage a complex structure of containers as a combination of SpringLayouts (a series of stand-alone SpringLayout one inside other) In particular, a JFrame managed by a main SpringLayout that contains JPanels: every JPanel should be…
1
vote
1 answer

Width of components in SpringLayout after UI-Update equals 0

TL;DR On different DPI settings, components of my application can overlap. To get rid of that I want to check the components width, which always equals 0 after updating the UI. Simplyfied code at the end of the question. The base problem is that on…
geisterfurz007
  • 5,292
  • 5
  • 33
  • 54
1
vote
0 answers

Delayed putConstraint() is not overwriting

I'm relatively new to programming GUI's, and for my project I'm using a SpringLayout, since the others don't make much sense to me. Now if I do: layout.putConstraint(SpringLayout.NORTH, sMenu, 0, SpringLayout.SOUTH, sControls); everything works as…
Xatlor
  • 13
  • 3
1
vote
1 answer

Java Swing: SpringLayout within BorderLayout

I'm having problems with my GridLayout whereby a JTextField widens to fit an entry longer than the initial size. Another poster with this problem was told SpringLayout was the easiest solution, so that's what I'm trying. However I'm having…
1
vote
1 answer

SpringLayout with SwingBuilder

I am trying to quickly and easily layout rows and columns of buttons and labels. Having buttons and labels be the same width looks ridiculous, so I have ruled out GridLayout. I may slit my wrists if someone suggests GridBagLayout. SO I was…
Kevin Welker
  • 7,719
  • 1
  • 40
  • 56
1
vote
2 answers

How can I center align a group of Components with a Swing Layout Manager in Spring

I am trying to create a form in Swing. The form should look similar to this: ____________________________________ |___________________________________X| | | | ________________ | | label1…
Jamie P
  • 83
  • 2
  • 12
1
vote
2 answers

How can I center align a Component with SpringLayout

I am trying to create a Form in Java with Swing and I'm having difficulty with managing my layouts. I want to have a few text fields with labels in the center of a dialog and have "save" and "close" buttons in the lower right. Adding the buttons to…
Jamie P
  • 83
  • 2
  • 12
1
vote
1 answer

Java strechable JTextfield

I'm currently working on a browser in Java. I want to have a back button on the top left and to its right a JTextfield with the URL. I want the button to always have the same size but the textfield to change it's width to match the JFrame's width.…
Shujal
  • 252
  • 2
  • 6
1
vote
1 answer

Java Swing Complex Form - SpringLayout

I need help creating a Java swing form. The form is dynamically created and asks the user for various inputs. The inputs vary and could be Textfields, RadioButton, ComboBox. I'm trying to determine what is the best layout for such a form. Currently,…
John Lee
  • 1,357
  • 1
  • 13
  • 26
1
vote
1 answer

How to display HashMap data in GUI?

I have a HashMap representing a date (the key), and an amount (the value). I would like to display this information on my interface. I began by using an ArrayList and adding a new JLabel to it for each new key & value that was added…
1
vote
3 answers

How to get the input from a JFrame form?

I am trying to get the input that I submit in a JFrame form and store it in an arraylist. I am not sure how to get what input i place in the text field when my ActionEvent occurs. Can anyone tell me how to do it? my form currently looks like Here…
NeonMedusa
  • 95
  • 2
  • 6
  • 14
1
vote
1 answer

Horizontal line in spring layout

I have a program with a bunch of fields in a single panel, both labels and text fields. I needed to separate them somehow with a line to make it easier to read. I have the panel built with SpringLayout. I was wondering if there is an easy way to…
Caveman42
  • 679
  • 2
  • 13
  • 35
0
votes
0 answers

How do I make an image appear when you press a button in JPanel w/ SpringLayout?

I have been having trouble with creating ActionListeners that don't break my entire program. I want an image of a rock to show up when the user presses the rock button. Here is the code I have in my Panel class (excluding imports & class…
Todu
  • 1