Skip to main content

All Questions

Tagged with
0 votes
1 answer
83 views

How do set position of JPanel anywhere on screen

I need to have a number of JPanels, and I cannot position them where I want to as they either disappear as I try and change things like boundaries for example. Any help is appreciated Here is the code ...
Dylan Caughey's user avatar
0 votes
0 answers
27 views

The gridlayout vgap changes on its own, how can I make it always the same?

I am making a messaging app where a server and a client communicate with each other by sending messages. I have a main panel where the messages are printed, and it is set with gridlayout and put on a ...
damby's user avatar
  • 3
0 votes
3 answers
118 views

Horizontal JScrollPane inside vertical JScrollPane

Good afternoon! It is necessary to make a list (vertical) from lists of events (horizontal). There are at least 2 problems: the area of the list of events (horizontal scrolling) expands beyond the ...
IvanNaStackOF's user avatar
2 votes
1 answer
273 views

Check Layout of JPanel

I Have the following code piece: JPanel panel = new JPanel(new GridBagLayout()); I would like to check, if my panel has a GridBagLayout assigned to it. I got it working like this: if(panel.getLayout(...
Moritz Schmidt's user avatar
0 votes
0 answers
48 views

Create a Java swing / awt Layout with JLabels of different heights

I hava a JLabel (lets call it main) and during Runtime I am adding multiple JLabels to it. Sometimes these JLabels contain an Image, sometimes a JTextArea. The Problem is, because of the different ...
Lazy's user avatar
  • 11
0 votes
0 answers
69 views

Java swing window gets corrupted when resized

I am having this issue with the JDialog, that gets corrupted when resized or when in general is smaller than a certain size. To develop, all components are placed using GridBagLayout. Here is an ...
Dmitriy Ryabin's user avatar
-1 votes
1 answer
219 views

Java Swing how to draw polygons with coordinate params when layout is not absolute

I am trying to make a little GUI using swing. I would like it to draw a polygon on a JPanel that has a GridBagLayout. How do I do this? Can I give the polygon coordinates to draw from? Are the ...
Michael Tracey's user avatar
0 votes
2 answers
34 views

About layouts using awt and swing

So I was trying to go for a basic calculator layout made with GridBagLayout and after going through a few documents I came up with this: import java.awt.*; import javax.swing.*; public class Test { ...
Kenneth's user avatar
0 votes
1 answer
219 views

Which coordinates does fillRect() use?

This is my first project with AWT/Swing. I'm trying to design a simple cellular automaton. I had some problems choosing a layout manager, now I'm using GridLayout because is the closest I got to what ...
Alex V.'s user avatar
  • 46
0 votes
0 answers
120 views

Java JFrame layout keep changing on reopen

So I have this weird thing happening to one of my JFrames in my Java app, it seems like after I reopen the layout the positioning of my components just change out of no where. I'm used to work with ...
chawki challadia's user avatar
1 vote
0 answers
48 views

How do I re-initialize a panel with a GridLayout?

I'm writing a small Calendar application which lets my manage important dates and events of my study. I'm working with java.awt. A single month is drawn onto a panel with a 7*7 BorderLayout. When the ...
hensing1's user avatar
  • 187
3 votes
1 answer
59 views

How to draw cells of layouts and their edges in Swing?

In Swing(also AWT), LayoutManagers determine the size and position of the Components within a Container without drawing edges and lines... for some educational goals, how to draw these lines?(e.g. ...
OwlPlusPlus's user avatar
0 votes
0 answers
80 views

Java AWT placing a Textfield in Panel fails

i Have a strange problem with a specific textFiled in my simple form in Java awt. My code and result look as following: import java.awt.GridLayout; import java.awt.Label; import java.awt.Panel; ...
Adam S's user avatar
  • 9
0 votes
1 answer
2k views

CardLayout method show() not working in awt

I am trying to run CardLayout but don't know why show() of CardLayout is not working. I am getting error. package java_files; import java.awt.*; import java.awt.event.*; //import javax.swing....
Harnirvair Singh's user avatar
0 votes
1 answer
894 views

JavaFX 8 - Layout swapping or similar/equivalent functionality to Qt's StackedWidget?

I've been asked to write a conversion program in JavaFX, but i need to allow the user to set different options depending on the conversion direction. In reaction to swapping the conversion direction, ...
Force Gaia's user avatar

15 30 50 per page
1
2 3 4 5