问题
I'm beginner woth java programming
I tried to make my jframe shows but it didn't
jframe.setVisible(true);
it doesn't works
回答1:
I think you didn't declare correctly your JFrame. Here is an example creating a simple frame :
public static void main(String[] args)
{
// Creating a frame
JFrame frame = new JFrame("Example");
// Setting the position and the size of the frame
frame.setBounds(0,0,800,600);
// This will terminate the program when closing the frame
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// Then you can display your frame
frame.setVisible(true);
}
来源:https://stackoverflow.com/questions/15260062/my-jframe-doesnt-shows