>Java
>Swing
I have a 600x600 panel and I want a jframe to show exactly the entire panel, how?
Currently im just setting the preferred size of the jframe to a height of 620 but there has to be a better way, right?
It's been so long since I've done swing but surely a panel can't be resized? It'll resize to the size of whatever contents you have in it. So whatever is in the panel, adjust your JFrame to the size you need I guess
fuck off to stack overflow and google
>>54858704
>being this mad
>>54858892
>trying to counter troll
you literally need help with a basic java concept.. like literally give up on programming if you come HERE for help
>>54859173
>still being that angry
Take a chill pill
>>54858128
netbeans do that shit easily, just use an IDE
>>54859247
>still being this retarded
>>54859371
I sure got you to spend your entire evening focusing on my thread ;^)
The jframe resolution is manually set I dont understand your question?
Whenbyou define your jframe you just want to define
JFrame frame = new JFrame()
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(600,600);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
Then you add your panel withframe.add(panel)
If you need more than one panel, learn how to use gridbaglayout
Also, next time you havea question abouta swing or any java component, google "oracle documentation jframe" or whatever it is you need
The best thing about java is the insanely well organized and accessible documentation
>>54858128
pack()
Also JAVA SUCKS
>swing
don't.
There is a time and a place to use java libraries and swing is not a time or place to use ever.
>>54859868
I think OP is doing exactly this, and that's what his problem is.
If your panel is 600x600 it's actually the window including the window chrome that gets 600x600, while the actual panel is missing the border dimensions.
>>54861178
what's with you guys and forgetting PACK()?
The pack method sizes the frame so that all its contents are at or above their preferred sizes. An alternative to pack is to establish a frame size explicitly by calling setSize or setBounds (which also sets the frame location). In general, using pack is preferable to calling setSize, since pack leaves the frame layout manager in charge of the frame size, and layout managers are good at adjusting to platform dependencies and other factors that affect component size.
From Java tutorial
>>54858128
Why Swing? Why not JavaFX?
>>54861594
Even oracle has given up on javaFX at this point.
>>54861621
FX was supposed to replace Swing.
>>54861713
>supposed to
Too bad it failed. Most people still use swing. Hell, even oracle's certification exam requires you to build server gui in swing.
>>54861409
I left Java a long time ago. The money was not worth it. So tell that to OP not me.
Fuck a shit up your ass and choke on dicks Java and Swing.