为什么我这java程序运行之后什么都没有显示
importjava.awt.*;importjavax.swing.*;importjava.awt.event.*;publicclassXiTi9_12{publi...
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class XiTi9_12
{
public static void main(String[] args)
{
Win win=new Win("EnglishToNumber");
win.setBounds(100,100,300,100);
win.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
win.setVisible(false);
}
}
class Win extends JFrame
{
JTextField text=new JTextField(5);
JLabel label=new JLabel("请在左边输入数据!");
Win(String s)
{
setTitle(s);
setLayout(new FlowLayout());
add(text);
add(label);
}
} 展开
import javax.swing.*;
import java.awt.event.*;
public class XiTi9_12
{
public static void main(String[] args)
{
Win win=new Win("EnglishToNumber");
win.setBounds(100,100,300,100);
win.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
win.setVisible(false);
}
}
class Win extends JFrame
{
JTextField text=new JTextField(5);
JLabel label=new JLabel("请在左边输入数据!");
Win(String s)
{
setTitle(s);
setLayout(new FlowLayout());
add(text);
add(label);
}
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询