用Java实现如图界面
//OK....
import java.awt.Dimension;
import java.awt.Toolkit;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.UIManager;
import java.awt.Rectangle;
import javax.swing.BorderFactory;
import java.awt.Color;
import javax.swing.JButton;
import javax.swing.border.TitledBorder;
import javax.swing.table.DefaultTableModel;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class Frame1 extends JFrame {
JPanel contentPane;
JButton jButton3 = new JButton();
TitledBorder titledBorder1 = new TitledBorder("");
JButton jButton7 = new JButton();
JButton jButton8 = new JButton();
JButton jButton9 = new JButton();
JPanel jPanel1 = new JPanel();
JButton jButton1 = new JButton();
JButton jButton2 = new JButton();
JButton jButton4 = new JButton();
JButton jButton5 = new JButton();
JButton jButton6 = new JButton();
private String[] columnNames = { "名称", "在目录中", "大小" };
private Object[][] rowData = new Object[][] {};
private DefaultTableModel tableModel = new DefaultTableModel(rowData,
columnNames);
JTable jTable1 = new JTable(tableModel);
private JScrollPane scrollPane = new JScrollPane(jTable1);
public Frame1() {
try {
setDefaultCloseOperation(EXIT_ON_CLOSE);
jbInit();
} catch (Exception exception) {
exception.printStackTrace();
}
}
private void jbInit() throws Exception {
contentPane = (JPanel) getContentPane();
contentPane.setLayout(null);
setSize(new Dimension(700, 520));
setTitle("Frame Title");
jButton3.setBounds(new Rectangle(573, 450, 80, 24));
jButton3.setBorder(titledBorder1);
jButton3.setText("帮助");
jButton3.addActionListener(new Frame1_jButton3_actionAdapter(this));
jButton7.setBounds(new Rectangle(262, 450, 80, 24));
jButton7.setBorder(titledBorder1);
jButton7.setText("上一步");
jButton7.addActionListener(new Frame1_jButton7_actionAdapter(this));
jButton8.setBounds(new Rectangle(362, 450, 80, 24));
jButton8.setBorder(titledBorder1);
jButton8.setText("下一步");
jButton8.addActionListener(new Frame1_jButton8_actionAdapter(this));
jButton9.setBounds(new Rectangle(472, 450, 80, 24));
jButton9.setBorder(titledBorder1);
jButton9.setText("取消");
jButton9.addActionListener(new Frame1_jButton9_actionAdapter(this));
jPanel1.setBorder(BorderFactory.createEtchedBorder());
jPanel1.setBounds(new Rectangle(1, 0, 697, 441));
jPanel1.setLayout(null);
jButton1.setBounds(new Rectangle(36, 407, 99, 24));
jButton1.setText("添加文件(A)");
jButton1.addActionListener(new Frame1_jButton1_actionAdapter(this));
jButton2.setBounds(new Rectangle(301, 407, 112, 24));
jButton2.setText("资源管理器(E)");
jButton2.addActionListener(new Frame1_jButton2_actionAdapter(this));
jButton4.setBounds(new Rectangle(164, 407, 112, 24));
jButton4.setText("添加文件夹(B)");
jButton4.addActionListener(new Frame1_jButton4_actionAdapter(this));
jButton5.setBounds(new Rectangle(552, 408, 112, 24));
jButton5.setText("全部删除(L)");
jButton5.addActionListener(new Frame1_jButton5_actionAdapter(this));
jButton6.setBounds(new Rectangle(433, 408, 112, 24));
jButton6.setText("删除(R)");
jButton6.addActionListener(new Frame1_jButton6_actionAdapter(this));
scrollPane.setBorder(BorderFactory.createLineBorder(Color.black));
scrollPane.setBounds(new Rectangle(3, 3, 686, 392));
contentPane.add(jButton3);
contentPane.add(jButton7);
contentPane.add(jButton8);
contentPane.add(jButton9);
contentPane.add(jPanel1);
jPanel1.add(jButton1);
jPanel1.add(jButton2);
jPanel1.add(jButton4);
jPanel1.add(jButton5);
jPanel1.add(jButton6);
jPanel1.add(scrollPane);
}
public void jButton1_actionPerformed(ActionEvent e) {
// 添加文件
}
public void jButton4_actionPerformed(ActionEvent e) {
// 添加文件夹
}
public void jButton2_actionPerformed(ActionEvent e) {
// 资源管理器
}
public void jButton6_actionPerformed(ActionEvent e) {
// 删除
}
public void jButton5_actionPerformed(ActionEvent e) {
// 全部删除
}
public void jButton7_actionPerformed(ActionEvent e) {
// 上一步
}
public void jButton8_actionPerformed(ActionEvent e) {
// 下一步
}
public void jButton9_actionPerformed(ActionEvent e) {
// 取消
}
public void jButton3_actionPerformed(ActionEvent e) {
// 帮助
}
public static void main(String[] args) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception exception) {
exception.printStackTrace();
}
Frame1 frame = new Frame1();
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Dimension frameSize = frame.getSize();
if (frameSize.height > screenSize.height) {
frameSize.height = screenSize.height;
}
if (frameSize.width > screenSize.width) {
frameSize.width = screenSize.width;
}
frame.setLocation((screenSize.width - frameSize.width) / 2,
(screenSize.height - frameSize.height) / 2);
frame.setVisible(true);
}
}
class Frame1_jButton3_actionAdapter implements ActionListener {
private Frame1 adaptee;
Frame1_jButton3_actionAdapter(Frame1 adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton3_actionPerformed(e);
}
}
class Frame1_jButton9_actionAdapter implements ActionListener {
private Frame1 adaptee;
Frame1_jButton9_actionAdapter(Frame1 adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton9_actionPerformed(e);
}
}
class Frame1_jButton8_actionAdapter implements ActionListener {
private Frame1 adaptee;
Frame1_jButton8_actionAdapter(Frame1 adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton8_actionPerformed(e);
}
}
class Frame1_jButton7_actionAdapter implements ActionListener {
private Frame1 adaptee;
Frame1_jButton7_actionAdapter(Frame1 adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton7_actionPerformed(e);
}
}
class Frame1_jButton5_actionAdapter implements ActionListener {
private Frame1 adaptee;
Frame1_jButton5_actionAdapter(Frame1 adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton5_actionPerformed(e);
}
}
class Frame1_jButton6_actionAdapter implements ActionListener {
private Frame1 adaptee;
Frame1_jButton6_actionAdapter(Frame1 adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton6_actionPerformed(e);
}
}
class Frame1_jButton2_actionAdapter implements ActionListener {
private Frame1 adaptee;
Frame1_jButton2_actionAdapter(Frame1 adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton2_actionPerformed(e);
}
}
class Frame1_jButton4_actionAdapter implements ActionListener {
private Frame1 adaptee;
Frame1_jButton4_actionAdapter(Frame1 adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton4_actionPerformed(e);
}
}
class Frame1_jButton1_actionAdapter implements ActionListener {
private Frame1 adaptee;
Frame1_jButton1_actionAdapter(Frame1 adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton1_actionPerformed(e);
}
}
swt还是swing阿?
怎么不说的详细点啊?
建议你用Eclipse做!