求一个APPLET的程序 一个APPLET程序,包括两个输入区和一个标签,用户输入两个整数,用DO-WHILE求最大公约数和最小公倍数 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 package hugo;import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Test { public static void main (String[] args) { new tMap("HUGO"); } } class tMap extends JFrame { TextField t1 = new TextField(10); TextField t2 = new TextField(10); Button b = new Button("ok"); TextField t3 = new TextField(10); TextField t4 = new TextField(10); tMap(String title) { super(title); this.setLayout(new FlowLayout()); this.add(t1); this.add(t2); this.add(b); this.add(t3); this.add(t4); b.addActionListener(new ActionListener1()); setBounds(100,100,400,100); setVisible(true); } class ActionListener1 implements ActionListener{ public void actionPerformed(ActionEvent e){ t3.setText("最大公约数"+getMax(t1.getText(),t2.getText())); t4.setText("最小公倍数"+getMim(t1.getText(),t2.getText())); } }}方法自己找来代进去就行了 改变gridview颜色 关于double类型的数值运算,,,求大神解答 textarea里可以加jtable吗 如何修改BufferedImage的type,如把TYPE_INT_ABGR转换成TYPE_INT_RGB????急 JAVA中的所有类,接口是不是要记????? linux下运行jar,找不到路径,大家帮我看看 javaftp遇到的问题,帮忙解决下 [简单问题]如何将JComboBox的字体改变 关于流的问题 大侠们:谁能教我JAVA 入门?不胜感激!!!! java 如何创建文件目录 socket JAVA客服端与C服务通信问题 100分求解
package hugo;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*; public class Test {
public static void main (String[] args)
{
new tMap("HUGO");
}
}
class tMap extends JFrame
{
TextField t1 = new TextField(10);
TextField t2 = new TextField(10);
Button b = new Button("ok");
TextField t3 = new TextField(10);
TextField t4 = new TextField(10);
tMap(String title)
{
super(title);
this.setLayout(new FlowLayout());
this.add(t1);
this.add(t2);
this.add(b);
this.add(t3);
this.add(t4);
b.addActionListener(new ActionListener1());
setBounds(100,100,400,100);
setVisible(true);
}
class ActionListener1 implements ActionListener{
public void actionPerformed(ActionEvent e){
t3.setText("最大公约数"+getMax(t1.getText(),t2.getText()));
t4.setText("最小公倍数"+getMim(t1.getText(),t2.getText()));
}
}}
方法自己找来代进去就行了