一个Java问题
Java code:
import java.awt.*;
import java.awt.event.*;
public class TaskList extends Frame implements ActionListener
{
private Button b1 = new Button("确定");
private Button b2 = new Button("删除");
private Button b3 = new Button("增加优先级");
private Button b4 = new Button("降低优先级");
private TextField text = new TextField(15);
private List list = new List();
private Label task_label = new Label("工作事项");
private Label priority_label = new Label("改变事件优先级");
private class WindowCloser extends WindowAdapter
{
public void windowClosing(WindowEvent e){
dispose();
System.exit(0);
}
}
public void setup(){
Panel p = new Panel(new FlowLayout());
p.add(b1);
p.add(b2);
Panel q = new Panel(new FlowLayout());
q.add(b3);
q.add(priority_label);
q.add(b4);
Panel r = new Panel(new FlowLayout());
r.add(task_label);
r.add(text);
setLayout(new GridLayout(4,1));
add(r);
add(q);
add(list);
add(p);
}
public TaskList(){
super("工作事项表");
this.setup();
b1.addActionListener(this);
b2.addActionListener(this);
相关问答:
字符流的读和写最终在底层都是通过字节流来完成的吗? 读写文本文件字符流应该就可以了吧。。
各位大哥大姐帮帮忙阿
Java流包括字节流和字符流,字节流通过IO设备以字节数据的方式读入,而字符流则是通过字节流 ......
现在遇到这样一个问题:
在java 中编写swing程序, 添加按钮jbServerStart,目的是当点击jbServerStart时,程序会自动创建两个与其他终端通信的对象,代码如下:
private Container createButtonPane ......
查API,看到FeatrueFactory有这个方法
public Feature createPolyLine(double[][] thePoints,
R ......
创建了两个类,第一个类产生一个包,调试能运行;第二个类调用第一个类产生的包,但运行出错,请高手指点一下
OutputSessionInfo.java
package ch05;
import java.io.*;
import javax.servlet.http. ......
12、分析下面的代码,其输出结果是( )。
1. public class Test {
2. public static void main (String [] args) {
3. string foo = "blue";
4. string bar = foo;
5. ......