Perhaps you need to register the code. I just recently started and would like to know how to do this. I would be grateful for any help. So, as a newbie, I can not understand the explanations for the pro in this case.
- The application, as I understand it, is not a console? Swing? Javafx? - post_zeew
- java application. which opens after compiling. - Bake
- not a console in general - Bake
- Need more information on how you build a GUI. - post_zeew
- I just work at Eclipse Mars. There just made an application. And when I make a separate Java application, I need the application window to remain in the middle and not stretch. - Bake
|
1 answer
import java.awt.Dimension; import java.awt.Toolkit; import javax.swing.JFrame; Set the current screen resolution
Dimension d = Toolkit.getDefaultToolkit().getScreenSize(); System.out.println(d.height + " " + d.width); JFrame frame = new JFrame(" test " ); frame.setSize(800, 600); Set the window location
frame.setLocation(((d.width /2)-frame.getWidth()/2) , ((d.height/2)-frame.getHeight()/2)); Remove the ability to resize the window
frame.setResizable(false); Display the frame
frame.setVisible(true); - Thank you very much! Bail out! - Bake
|