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
10
votes
1 answer

How do I draw non-overlapping edge labels in networkx?

How do I draw non-overlapping edge labels in networkx? Using the option scale looks better but the edge labels are still overlapping, for instance, The related source codes are below: # build a graph G.add_edge(u, v, r=value) # plot the graph pos…
SparkAndShine
  • 17,001
  • 22
  • 90
  • 134
10
votes
1 answer

SpringUtilities cannot be resolved

I'm trying one of the Oracle's GUI examples that uses SpringUtilities. But the Eclipse gives me and error Cannot resolve to type and when I try to compile I get SpringUtilities cannot be resolved. I'm using 1.7 JDK, guess I have to add something…
Leron
  • 9,546
  • 35
  • 156
  • 257
7
votes
2 answers

Layout for label and button programmatically

I am trying to create a SpringLayout in Java, this is the code I have (got it from Oracle Java docs) import javax.swing.*; import java.awt.*; public class SpringForm { private static void createAndShowGUI() { String[] labels = {"Side1:…
noobprogrammer
  • 513
  • 5
  • 14
6
votes
0 answers

Why isn't SpringUtilities part of the core Java library?

I know SpringLayout is intended to be used by GUI builders, but this layout is useful when a developer wants to create a form-like layout. And the SpringUtilities utility class makes manual coding with the layout manager much easier. So, why isn't…
mre
  • 43,520
  • 33
  • 120
  • 170
4
votes
2 answers

Component size in SpringLayout

I use SpringLayout on my form, But as you see, its look isn't good (large and bad size)! public class t8 extends JFrame { JButton okButton, cancellButton; JTextField idTF, nameTf; JLabel idlbl, namelbl; public t8() { add(createPanel(),…
Sajad
  • 2,273
  • 11
  • 49
  • 92
3
votes
2 answers

Too much space between components in Spring layout

I want to create a JFrame by hand and use spring layout to do this. But, my finally output is not good. The space between my rows is so much, and between my radio buttons too: My code: public final class NewUserFrame1 extends JFrame { public…
Sajad
  • 2,273
  • 11
  • 49
  • 92
3
votes
1 answer

Java - JScrollPane view layout with SpringLayout

I have a JScrollPane that has a view component which uses SpringLayout. final JPanel panel = new JPanel(new SpringLayout()); // add stuff to panel here final JScrollPane scrollPane = new JScrollPane(panel, JScrollPane.VERTICAL_SCROLLBAR_NEVER,…
Ramus
  • 250
  • 1
  • 2
  • 10
2
votes
2 answers

Making sure SpringLayout doesn't shrink below a certain size

I'm trying to implement a quite simple UI using SpringLayout (partly because I, as opposed to most tutorial writers I find on the net, quite like the coding interface compared to other layout managers and partly because I want to learn how to use…
Tomas Aschan
  • 58,548
  • 56
  • 243
  • 402
2
votes
1 answer

Python NetworkX: Confining force-directed layout within circular boundary

Python NetworkX has a method spring_layout that simulates a force-directed representation of a NetworkX instance; however, this leads to an adjusted network with nodes that are not confined within a particular boundary shape (e.g., a circle). Below…
irahorecka
  • 1,447
  • 8
  • 25
2
votes
1 answer

JScrollBar Layout Manager and SpringLayout Manager not working together

public void createSpringLayout(SpringLayout spring, JLabel label, JScrollPane scrollPane, JPanel buttonPanel) { spring.putConstraint(SpringLayout.NORTH, label, 10, SpringLayout.NORTH, this); spring.putConstraint(SpringLayout.WEST, label, 10,…
2
votes
1 answer

JButton on JPanel with SpringLayout not visible

I've got a JPanel, containing an other JPanel, on which I wnat to place a JButton, using the SpringLayout. But for some reason the JButton is not drawn. However, the JButton gets drawn, if I use absolute positioning, instead of a layout manager. If…
Cedric
  • 55
  • 1
  • 6
2
votes
3 answers

Can SpringLayout do all the job

I would like to ask if SpringLayout can do anything like absolute position because I think absolute position have problem when I maximize the frame and what do I have to use if I need to set JMenu and JToolBar and JTextField and JTable all in one…
isslam akkilah
  • 418
  • 1
  • 11
  • 23
2
votes
0 answers

Spring Layout not resizing correctly

I am new to the spring layout in Java GUI building, but it seemed that using spring layout was the only way to go if I wanted to layout my GUI the way I wanted. The problem I am having, is that one of the panels of my GUI expands about a pixel or 2…
Caveman42
  • 679
  • 2
  • 13
  • 35
2
votes
3 answers

Adding JPanel to JScrollPane

I have a gui which has a Panel that contains a sequence of labels and TextFields and uses a spring layout(this is the mainPanel) and another Panel that just contains a button(buttonPanel). I am trying to make my mainPanel to have a vertical…
RagHaven
  • 4,156
  • 21
  • 72
  • 113
1
vote
3 answers

scrolling JLabel in Java

i have a little issue with jlabel. When the label displays doubles which are to large for the screen, I would like to have a scrollbar to see them anyway. I have just added a scrollbar to the whole panel, but it does not check, when a overlong…
user1140737
  • 81
  • 1
  • 2
  • 4
1
2 3 4 5