All Questions
157
questions
-1
votes
1
answer
52
views
How do I scale or set the the size of an ImageIcon in Java?
I can not find a way to set the size of an ImageIcon placed in a JLabel. I i.e. want to load image with size 32x32, but paint in size of 16x16 pixel (or 144 dpi).
I can no where find a way to set the ...
1
vote
1
answer
26
views
GridBagLayout component size is dependent on JFrame size
I have the following program (simplified version of my actual program):
MyPanel.java:
public class MyPanel extends JPanel{
private JLayeredPane layeredPane;
public MyPanel(int width, int ...
-1
votes
1
answer
31
views
How to layout Components when Conponent Size is needed beforehand (Java)
So the problem is this, I have a Project where I want to layout Components in a Panel and need to know the Size of the Panel beforehand so that I can scale the Panels on the Panel accordingly.
But as ...
0
votes
2
answers
750
views
How to stop components adapting to the size of a JPanel that is inside a JScrollPane
The components inside a JPanel (which has a BoxLayout) are getting resized when there's lack of space.
The JPanel is inside a JScrollPane, but because of the fact that the components get resized, the ...
0
votes
0
answers
69
views
I can't set Properly the size of each element on my Java Swing GUI
package View;
import javax.swing.*;
import javax.swing.plaf.synth.ColorType;
import modulo.PatenteTypes;
import java.awt.*;
public class FrameLogin extends JFrame {
private static final long ...
2
votes
1
answer
220
views
Why does my box Layout change size even after setting Sizes of JPanels
I have been trying to adjust my JPanel sizes while using LayoutManager such as BoxLayout to arrange components inside that Layout in a specific order, I achieved the way I want it to look by NOT USING ...
-1
votes
2
answers
64
views
Button covering window [duplicate]
I'm very new to java and I now know how to make an empty window but there's a button and a label and the button keeps on covering the window. How do I size the button?
import java.awt.Dimension;
...
0
votes
1
answer
48
views
How can I resize the height of a JPanel?
//Attributes
//Stats GUI components
JLabel hp = new JLabel();
JLabel hpPoints = new JLabel("TEST");
JLabel chakra = new JLabel();
JLabel chakraPoints = new JLabel("TEST");
JLabel ...
0
votes
1
answer
52
views
Custom JPanel size always 0
I have been trying to understand what is happening here for a long time and I have not found the correct answer yet.
I am trying to create a JPanel from scratch; for this I have defined a group layout ...
0
votes
1
answer
183
views
JPanel getpreferredsize() returns 10 instead of size of JFrame minus borders
I am trying to get the size of a JPanel so that I can subsequently calculate the correct dimension of graphics I plan to add. Since I have set the size of the JFrame to be (300, 200), I was expecting ...
1
vote
1
answer
66
views
Change size of JButtons
I have a very big problem. I need to do vertical menu in the center of window. What could be easier? What I did:
I create JFrame and set BorderLayout to it:
JFrame jfr = new JFrame("Frame");
Then I ...
0
votes
1
answer
43
views
java swing setXXXSize() alternative?
I always see many threads here how setting an components size using setXxxSize() method where
Xxx=Preferred
Xxx=Maximum
Xxx=Minimum
Or just setSize () in general are all bad ideas but nobody ...
0
votes
0
answers
154
views
Increase JAVA square size
Good afternoon, i needs help, I wanted to increase the size of the square, when I use the angle 0 and 270 it works normally, but when the word is with the angle 90 and 180 when it increases with the ...
2
votes
1
answer
669
views
Problem resizing JDialog and JTable columns
I'm creating a JDialog window with a JTable on it and I'm trying to make it some "responsive" for different screen sizes. Due the window and the table size may change, I set by percentages the columns ...
-1
votes
1
answer
29
views
JTree editor component hides the JTree
I've create a customized JTree that renders some nodes as JTable, but when trying to edit/select the table (left click on the node) the table resizes and hides the JTree behind it.
I find it curious ...