import t。*;
import javax。swing。*;
import t。Rectangle;
import t。event。ActionListener;
import t。event。ActionEvent;
/**
* Title:
*
* Description:
*
* Copyright: Copyright (c) 2006
*
* Company:
*
* @author zwh
* @version 1。
0
*/
public class Frame1
extends JFrame {
public Frame1() {
try {
jbInit();
}
catch (Exception exception) {
intStackTrace();
}
}
private void jbInit() throws Exception {
getContentPane()。
setLayout(null);
tToolTipText("");
tText("文字位置");
tBounds(new Rectangle(111, 0, 284, 275));
tBounds(new Rectangle(12, 145, 82, 27));
tText("右边");
dActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
jButton3_actionPerformed(e);
}
});
tBounds(new Rectangle(11, 110, 83, 25));
tText("中间");
dActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
jButton2_actionPerformed(e);
}
});
tBounds(new Rectangle(11, 67, 83, 28));
tText("左边");
dActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
jButton1_actionPerformed(e);
}
});
tContentPane()。
add(jButton1, null);
tContentPane()。add(jButton2, null);
tContentPane()。add(jButton3, null);
tContentPane()。
add(jLabel1, null);
}
JLabel jLabel1 = new JLabel();
JButton jButton1 = new JButton();
JButton jButton2 = new JButton();
JButton jButton3 = new JButton();
public void jButton1_actionPerformed(ActionEvent e) {
tHorizontalAlignment(SwingConstants。
LEFT);
}
public void jButton2_actionPerformed(ActionEvent e) {
tHorizontalAlignment(SwingConstants。CENTER);
}
public void jButton3_actionPerformed(ActionEvent e) {
tHorizontalAlignment(SwingConstants。
RIGHT);
}
public static void main(String[] args) {
Frame1 f = new Frame1();
tSize(600,400);
ow();
}
}。
全部