编译这个java程序,为什么标签可以正常显示,按纽就不可以正常显示呢? LabelTest4 application = new LabelTest4();程序完全正常!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 没有什么不妥之处啊?是不是JDK版本的问题???import java.awt.Container;import java.awt.FlowLayout;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import javax.swing.JButton;import javax.swing.JFrame;import javax.swing.JLabel;/** * <p>Title: </p> * * <p>Description: </p> * * <p>Copyright: Copyright (c) 2002</p> * * <p>Company: </p> * * @author not attributable * @version 1.0 */public class Frame1 extends JFrame{ private JLabel label1; private JButton bt; public Frame1() { super("Testing JLabel"); Container container = getContentPane(); container.setLayout(new FlowLayout()); label1 = new JLabel("Label with text"); container.add(label1); bt = new JButton("开始测试"); container.add(bt); bt.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { System.out.println("开始测试了"); } } ); setSize(275,170); setVisible(true); } // end constructor public static void main(String args[]) { Frame1 application = new Frame1(); application.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); }} Java编写的多人聊天系统 jstl 中c:when的用法 将数据库中的信息作出java GUI图形界面! 访问mysql数据库问题(急)!!! jar的问题:用jar打包怎么出错了啊? 请教java多线成问题! 苦恼,因水平低,不知如何将这个c写的函数改成java的..... 如何把解决这个问题,来看看! 直接使用access数据库 java pos 针式打印 如何为jtree的不同结点加不同的图标 java Applet 得到当前页面 textarea 框的串?
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2002</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class Frame1 extends JFrame
{
private JLabel label1;
private JButton bt;
public Frame1()
{
super("Testing JLabel");
Container container = getContentPane();
container.setLayout(new FlowLayout());
label1 = new JLabel("Label with text"); container.add(label1); bt = new JButton("开始测试");
container.add(bt);
bt.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
System.out.println("开始测试了");
}
}
); setSize(275,170);
setVisible(true);
} // end constructor public static void main(String args[])
{
Frame1 application = new Frame1();
application.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
}
}