例子,可以直接執行,應該是你要的
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.border.BevelBorder;
public class LabelTest extends JFrame{
public LabelTest() {
init();
}
private void init() {
setLayout(null);
JLabel l = new JLabel("凹陷的標籤");
l.setBounds(10, 20, 100, 25);
l.setBorder(new BevelBorder(BevelBorder.LOWERED));
add(l);
setSize(150, 100);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
public static void main(String[] args) {
new LabelTest().setVisible(true);
例子,可以直接執行,應該是你要的
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.border.BevelBorder;
public class LabelTest extends JFrame{
public LabelTest() {
init();
}
private void init() {
setLayout(null);
JLabel l = new JLabel("凹陷的標籤");
l.setBounds(10, 20, 100, 25);
l.setBorder(new BevelBorder(BevelBorder.LOWERED));
add(l);
setSize(150, 100);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public static void main(String[] args) {
new LabelTest().setVisible(true);
}
}