事件处理 如果你真想写,你一定可以写出来这又不是多难 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 //Oval.javaimport java.awt.*;import java.awt.event.*;import javax.swing.*;public class Oval extends JFrame implements ActionListener{ Color c=Color.red; public Oval(){ setSize(400,300); this.getContentPane().setLayout(new FlowLayout()); JButton b=new JButton("选色"); this.getContentPane().add(b); b.addActionListener(this); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setVisible(true); } public static void main(String[] args){ new Oval(); } public void paint(Graphics g){ super.paint(g); g.setColor(c); g.fillOval(50,80,300,200); } public void actionPerformed(ActionEvent e){ JColorChooser jcc=new JColorChooser(c); Color sc=jcc.showDialog(this,"",c); if(sc!=null){ c=sc; } repaint(); }} 是父类对象还是子类对象? 急急急 关于从数据库中提取数据 求解。。。。输入问题? 请高人指教java这个版本jdk-1_5_0_04-nb-4_1-win.exe的一个问题 救救一个女大学生!!! 请教为jvm内存分配的方法,或解决内存溢出的方法。谢! delphi里往一个表里添加数据很简单,哪位大侠会用jbuilder7来添加数据啊? RMI是什么?JAVA中支持SOCKET的类是什么? 请教:weblogic6.0 与 JBuilder4的结合问题 java调用c开发的动态链接库时,当动态链接库是指针时,在java程序中应如何相应改变 ServerSocket提问,100分
import java.awt.*;
import java.awt.event.*;import javax.swing.*;public class Oval extends JFrame implements ActionListener{
Color c=Color.red;
public Oval(){
setSize(400,300);
this.getContentPane().setLayout(new FlowLayout());
JButton b=new JButton("选色");
this.getContentPane().add(b);
b.addActionListener(this);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
}
public static void main(String[] args){
new Oval();
}
public void paint(Graphics g){
super.paint(g);
g.setColor(c);
g.fillOval(50,80,300,200);
} public void actionPerformed(ActionEvent e){
JColorChooser jcc=new JColorChooser(c);
Color sc=jcc.showDialog(this,"",c);
if(sc!=null){
c=sc;
}
repaint();
}
}