Skip to main content

All Questions

Tagged with
0 votes
2 answers
863 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 ...
JCGdev's user avatar
  • 39
1 vote
0 answers
737 views

How to manually resize a Pane/Rectangle in JavaFX with a mouse drag?

I have a standard JavaFX Pane object that I want the user to be able to stretch or compress from any of the four sides. Only problem is I'm not so sure how to go about it. I already have code that ...
TheProgrammer's user avatar
0 votes
0 answers
96 views

Resizing JScrollPane based on JDialog size

I have a resizable JDialog and 4 big components inside: a JLabel on the top left; a JTable on the left; a fixed JPanel on the top; a JScrollPane with a JPanel in a GridLayout inside it. JScrollPane ...
andy_X91's user avatar
0 votes
2 answers
121 views

JSwing components don't appear until frame is resized [duplicate]

bit of an issue. I'm trying to make a JSwing frame with a label, textfield, and two buttons. When the routine first runs, the buttons and the textframe are invisible. When I resize the frame, the ...
SBM1926's user avatar
  • 37
0 votes
1 answer
918 views

Java - how do I resize my 2D Game?

I'm developing a 2D game but i get stuck on the resizing. So as you can see in the code below, I draw all the game things into a BufferedImage. After that i get the graphics from my JPanel and draw ...
AvarionDE's user avatar
  • 160
0 votes
1 answer
1k views

Component won't display unless window is resized - Java

I have problem with image visibility after click the button. I have the main class with frame: package superworld; import java.awt.*; import javax.swing.*; public class SuperWorld { public ...
Vekka's user avatar
  • 151
0 votes
2 answers
2k views

Window Resize event

I have a program that scales an image to the size of the screen. I currently have a component listener listening for a componentResized event, but this is not what I want. I would like the method to ...
Chris Smith's user avatar
  • 3,012
0 votes
0 answers
882 views

Java Swing - How to create custom components with auto size adjustment to the parent

I'm trying to build a custom triangle component that has the same features as a JComponent (like a JButton per say). The porpoise of the program will be to add triangle on a mouse click exactly where ...
fly's user avatar
  • 57
4 votes
3 answers
4k views

componentResized event for Component in Java, but only execute when mouse released

I need to do some calculations when one of my Components (a Canvas) gets resized. Unfortunately the calculations can take a few hundred milliseconds which causes the resize to lag heavily while being ...
Se Norm's user avatar
  • 1,755
1 vote
3 answers
2k views

Resizable Java component

I would like to have a Java component which has a resize icon on the bottom right of the component so that when I drag that icon, the component will automatically resize with it. By resize icon, I ...
sv_in's user avatar
  • 14k