看了你代码,我都晕了
建议用eclipse重写。。
问题太多,
建议用eclipse重写。。
问题太多,
解决方案 »
- 求助字符串分页的实现
- 100分求将html页面生成图片的代码,
- 大将帮我看看这是什么错误?
- 怎样为<input type=file>的value属性动态赋值或设置默认值
- 请问各位 SQLSERVER2000 在查询分析器里面能不能更改标识列的值
- struts框架下开发论坛编译出错,请各位大虾指教!!!
- 一个jsp:usebean运行问题 请各位帮帮忙!
- 有关在自己的程序中调用百度或是谷歌的搜索功能,还有能够获取所搜索结果页面(就是列出一条条结果的页面)的URL
- 高人指点??
- 调数据库的问题
- struts+spring+hibernate的问题:程序执行到一个地方就不向下运行了,也没有返回什么
- j2ee中session问题
import javax.swing.*;public class Info extends JFrame {
private JLabel titleLabel = new JLabel("Title:", SwingConstants.RIGHT); private JTextField title; private JLabel addressLabel = new JLabel("Address:", SwingConstants.RIGHT); private JTextField address; //private JLabel typeLabel = new JLabel("Type:", SwingConstants.RIGHT); private JTextField type; Info() {
super("Site Information");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
String response1 = JOptionPane.showInputDialog(null,
"Enter the site title:");
title = new JTextField(response1, 20); String rasponse2 = JOptionPane.showInputDialog(null,
"Enter the site address:");
address = new JTextField(rasponse2, 20); String[] choices = { "Persional", "Commercial", "Unkonwn" };
int response3 = JOptionPane.showOptionDialog(null,
"What type of site is it?", "Site Type", 0,
JOptionPane.QUESTION_MESSAGE, null, choices, choices[0]);
type = new JTextField(choices[response3], 20); JPanel pane = new JPanel();
pane.setLayout(new GridLayout(3, 2));
pane.add(titleLabel);
pane.add(title);
pane.add(addressLabel);
pane.add(address);
pane.add(type); setContentPane(pane);
} public static void main(String[] arguments) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
System.out
.println("Couldn't use the system" + "look and feel:" + e);
}
Info frame = new Info();
frame.pack();
frame.setVisible(true);
}}
import java.applet.*;
import javax.swing.*;
import java.awt.GridLayout;public class Info extends JFrame {
private JLabel titleLabel = new JLabel("Title:" + SwingConstants.RIGHT);
private JTextField title;
private JLabel addressLabel = new JLabel("Address:" + SwingConstants.RIGHT);
private JTextField address;
private JLabel typeLabel = new JLabel("Type:" + SwingConstants.RIGHT);
private JTextField type; private Info() {
super("Site Information");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
String response1 = JOptionPane.showInputDialog(null,
"Enter the site title:");
title = new JTextField(response1, 20); String rasponse2 = JOptionPane.showInputDialog(null,
"Enter the site address:");
address = new JTextField(rasponse2, 20); String[] choices = { "Persional", "Commercial", "Unkonwn" };
int response3 = JOptionPane.showOptionDialog(null,
"What type of site is it?", "Site Type", 0,
JOptionPane.QUESTION_MESSAGE, null, choices, choices[0]);
type = new JTextField(choices[response3], 20); JPanel pane = new JPanel();
pane.setLayout(new GridLayout(3, 2));
pane.add(titleLabel);
pane.add(title);
pane.add(addressLabel);
pane.add(address);
pane.add(type); setContentPane(pane); } public static void main(String[] arguments) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
System.out
.println("Couldn't use the system" + "look and feel:" + e);
}
JFrame frame = new Info();
frame.pack();
frame.show();
}}
最后这里不行的话
frame.show();
改成
frame.setVisible(true);