java菜鸟求助 编写代码,实现在一个Applet窗口中添加一个按钮,当单击按钮时,在窗口的状态栏上显示“Hello World!” 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 import java.awt.GridLayout;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import javax.swing.JApplet;import javax.swing.JButton;import javax.swing.JLabel;public class AppletDemo extends JApplet implements ActionListener { JLabel show; JButton letshow; public AppletDemo() { show=new JLabel(); letshow=new JButton("show hello world"); letshow.addActionListener(this); setLayout(new GridLayout(2,1)); add(letshow); add(show); setSize(200,200); setVisible(true); } public void actionPerformed(ActionEvent e) { show.setText("hello world"); }} import javax.swing.JButton;import javax.swing.JFrame;import javax.swing.JLabel;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;public class show extends JFrame implements ActionListener { JLabel jl; JButton jb; public show () { this.setLayout(null); jl = new JLabel(); jb = new JButton("点我啊"); jb.setBounds(60, 100,80,30); jb.addActionListener(this); jl.setBounds(70, 20,100,50); this.add(jb); this.add(jl); this.setSize(200, 200); this.setLocationRelativeTo(null); this.show(); } public static void main(String args[]) { new show(); } public void actionPerformed(ActionEvent e) { jl.setText("hello world"); }}哈哈,这是我的啊 quartz作业调度打印日志的问题 java 数组比较 java中如何获取操作系统当前系统进程信息 初学者提问 小问题 安不上Visual Editor java到底用在哪些地方? 如何把自己随便画出的图形保存为jpg格式的文件? 应该是有关缓存的问题,我不想回到前n页,但n+1页以前的页面我还要,请问怎么实现…………(急) equals复写 【求eclipse jar包】 用MyEclipse连接oracle出现以下问题,请大家帮忙解决
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;import javax.swing.JApplet;
import javax.swing.JButton;
import javax.swing.JLabel;
public class AppletDemo extends JApplet implements ActionListener { JLabel show;
JButton letshow;
public AppletDemo()
{
show=new JLabel();
letshow=new JButton("show hello world");
letshow.addActionListener(this);
setLayout(new GridLayout(2,1));
add(letshow);
add(show);
setSize(200,200);
setVisible(true);
}
public void actionPerformed(ActionEvent e) {
show.setText("hello world");
}}
import javax.swing.JFrame;
import javax.swing.JLabel;import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;public class show extends JFrame implements ActionListener { JLabel jl;
JButton jb; public show () {
this.setLayout(null);
jl = new JLabel();
jb = new JButton("点我啊");
jb.setBounds(60, 100,80,30);
jb.addActionListener(this);
jl.setBounds(70, 20,100,50);
this.add(jb);
this.add(jl); this.setSize(200, 200);
this.setLocationRelativeTo(null);
this.show(); } public static void main(String args[]) {
new show();
}
public void actionPerformed(ActionEvent e) {
jl.setText("hello world");
}}哈哈,这是我的啊