Questions tagged [contentpane]
92 questions
8
votes
3 answers
Intellij, "contentPane cannot be set to null" using swing designer
I'm trying out Intellij Idea, and am trying to do some Swing development. I am running into an issue I have never experienced on Eclipse, and I am wondering if I have something set up wrong.
Here is my GUI class that is run by my driver:
package…

Quinn
- 111
- 1
- 1
- 5
5
votes
2 answers
WindowBuilder Pro – Incorrect display of content pane and element frames in the design view
I need some help with following problem:
Problem:
In the design view frames that appear around selected Swing-elements are not displayed at their correct positions. Also the content pane is not located at its right position inside the window…

Fango
- 151
- 1
- 4
4
votes
1 answer
LayoutManager of JFrame's contentPane
As mentioned here: Adding Components to the Content Pane,
The default content pane is a simple intermediate container that
inherits from JComponent, and that uses a BorderLayout as its layout
manager.
and here is a proof:
JFrame frame = new…

Eng.Fouad
- 115,165
- 71
- 313
- 417
4
votes
1 answer
getContentPane().add not working?
I'm working on an assignment of mine that a part of it requires me to put a red block in a grid layout in a JFrame. Afterwards the user should be able to change the position of that red block via arrow keys.
So far I've been able to add the red…

Can
- 4,516
- 6
- 28
- 50
3
votes
1 answer
How to update the JFrame Content Pane from calling a method?
Okay currently I am trying to make a multi-window program.
And from seeing other forums, it seems for you to do that in Java JFrame you must update its content pane by adding the new JComponent(new window/layout/idk), set the current window…

Chuck
- 75
- 1
- 2
- 10
3
votes
1 answer
Why does setContentPane() not contain repaint()?
I'm wondering about this for quite a long time now.
I usually build my SWING programs by having a JFrame with a JPanel containing the window's content set as the content pane by setContentPane(). When I want my content to be replaced by another one…

Froxx
- 957
- 4
- 14
- 27
3
votes
2 answers
Change splitter position for contentPane in borderContainer?
I have 2 contentPanes inside a BorderContainer using the Dojo Toolkit. Much like the following:

Vern Jensen
- 3,449
- 6
- 42
- 59
2
votes
1 answer
JavaFX navigationbar and contentpane
I want to use JavaFX in my new project and want something like in the screenshot below.
On the left site I need a navigation bar and on the right my content. So, I would use a VBox on the left side and maybe an AnchorPane on the right side (or…

Denis Banach
- 111
- 1
- 4
- 10
2
votes
3 answers
Why should I use java containers?
Container c = this.getContentPane();
JLabel lbl = new JLabel("Label");
c.add(lbl);
what is the difference between using the above method & this one ? knowing that both give same results
JLabel lbl = new JLabel("Label");
add(lbl);
& if I…

n0krashy
- 51
- 7
2
votes
2 answers
Trying a structure with BorderContainer (dojo)
I want a BorderContainer like the picture, two ContentPane at the top, and one in the bottom, but I'm not able to do it with the regions, so I don't know if there isn't a way to do it with the regions.
Thank you

Juanjo
- 929
- 1
- 15
- 29
2
votes
2 answers
What should I use instead of FlowLayout()?
So, my JFrame is not turning out the way I want it to, because of the FlowLayout() but I don't know what else to use to fix this. It just makes my JButton fill the entire JFrame. Is there a way I can get FlowLayout() to apply my custom sizes and…

knorberg
- 462
- 5
- 19
2
votes
1 answer
Swing ContentPane not updating after using (re)validate, repaint
A question similar to this has been asked several times. See e.g. here and here.
Yet I would really like to understand why it is that my code doesn't work. As has been answered in other versions of this question, a CardLayout would probably suffice,…
user937726
2
votes
1 answer
Content Panes in Java
I am new to programming and was just studying JFrame etc , here i read ContentPane Like this "Components go in the "content pane", not directly in the frame." when i did search COntentpane i read containment hierarch that is pretty…
user1769501
2
votes
0 answers
Dojo Cannot set href then select ContentPane in AccordionContainer
I have two ContentPanes inside an AccordionView. When a button is clicked on the first one I want to set the href on the second one and then set it as selected. To do this I run this code:
searchResultsContentPane.set("href",…

FuegoFingers
- 2,181
- 6
- 27
- 36
2
votes
1 answer
DOJO ContentPane inner DIV height changing on ContentPane resize
I'm using DOJO's ContentPane module. I have a div element in one of the panes and I need to give it a certain height - 100 pixels less than the height of the ContentPane so that the div changes its height dynamically when you change the ContentPane…

cycero
- 4,547
- 20
- 53
- 78