jdk 1.4.2 怎样该外观呀? 呵呵,你创建一个带有Frame的应用程序就影能够看出来。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());http://java.sun.com/j2se/1.4.2/docs/guide/swing/1.4/Post1.4.html#1.4.2 import java.awt.*;import javax.swing.*;import javax.swing.border.*;import javax.accessibility.*;public class BoxDemo extends JFrame{ public BoxDemo(){ super("BOX"); JPanel bnPanel=new JPanel(); JButton button1 = new JButton("Button1"); JButton button2 = new JButton("Button2"); bnPanel.setLayout(new BoxLayout(bnPanel, BoxLayout.Y_AXIS)); bnPanel.add(Box.createRigidArea(new Dimension(10, 10))); bnPanel.add(button1); bnPanel.add(Box.createRigidArea(new Dimension(10, 10))); bnPanel.add(button2); bnPanel.add(Box.createRigidArea(new Dimension(10, 10))); Container cp=getContentPane(); cp.setLayout(new GridLayout(2, 1)); cp.add(labelPanel); cp.add(bnPanel); pack(); } public static void main(String[] args) { //Make sure we have nice window decorations. JFrame.setDefaultLookAndFeelDecorated(true); //Create and set up the window. JFrame frame = new BoxDemo(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.pack(); frame.setVisible(true); }} //错了一点,应该是这样import java.awt.*;import javax.swing.*;import javax.swing.border.*;import javax.accessibility.*;public class BoxDemo extends JFrame{ public BoxDemo(){ super("BOX"); JPanel bnPanel=new JPanel(); JButton button1 = new JButton("Button1"); JButton button2 = new JButton("Button2"); bnPanel.setLayout(new BoxLayout(bnPanel, BoxLayout.Y_AXIS)); bnPanel.add(Box.createRigidArea(new Dimension(10, 10))); bnPanel.add(button1); bnPanel.add(Box.createRigidArea(new Dimension(10, 10))); bnPanel.add(button2); bnPanel.add(Box.createRigidArea(new Dimension(10, 10))); Container cp=getContentPane(); cp.setLayout(new GridLayout(2, 1)); //cp.add(labelPanel); cp.add(bnPanel); pack(); } public static void main(String[] args) { //Make sure we have nice window decorations. JFrame.setDefaultLookAndFeelDecorated(true); //Create and set up the window. JFrame frame = new BoxDemo(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.pack(); frame.setVisible(true); }} JFrame.setDefaultLookAndFeelDecorated(true); ??好像不是很漂亮的说,有点难看不是 XP 风格,有点像 Linux 的 jdk有外观吗?jdk不是就一堆文件吗?哪有操作截面呀?我都是用2000的命令符和Editplus做jdk的,哪位达人告诉我jdk的界面在哪?怎么用? 不好意思。可能我问的不清楚 ,我是说运行JAVA程序时的程序界面。 component.paint(Graphics)如何使用?什么原理? 如何在多个线程执行完后再执行某个方法 (请教高手)在框架上工作 JAVA问题 Icon图标使用问题 如何替换“?”符号阿?,急哦 请问如何算出固定日期距离今天的日期还有多少天? 请教关于modifier的问题。 100分求:中断线程--分数不够我再开2个帖子 关于一对一匹配的"天梯系统"的规则, 大家来帮我优化一下吧... 那位大哥告诉我java 控制台有啥用? 两个Java程序之间该如何交流是好?
import javax.swing.*;
import javax.swing.border.*;
import javax.accessibility.*;public class BoxDemo extends JFrame
{
public BoxDemo(){
super("BOX"); JPanel bnPanel=new JPanel();
JButton button1 = new JButton("Button1");
JButton button2 = new JButton("Button2");
bnPanel.setLayout(new BoxLayout(bnPanel,
BoxLayout.Y_AXIS));
bnPanel.add(Box.createRigidArea(new Dimension(10, 10)));
bnPanel.add(button1);
bnPanel.add(Box.createRigidArea(new Dimension(10, 10)));
bnPanel.add(button2);
bnPanel.add(Box.createRigidArea(new Dimension(10, 10))); Container cp=getContentPane();
cp.setLayout(new GridLayout(2, 1));
cp.add(labelPanel);
cp.add(bnPanel);
pack();
}
public static void main(String[] args) {
//Make sure we have nice window decorations.
JFrame.setDefaultLookAndFeelDecorated(true); //Create and set up the window.
JFrame frame = new BoxDemo();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.pack();
frame.setVisible(true);
}
}
import java.awt.*;
import javax.swing.*;
import javax.swing.border.*;
import javax.accessibility.*;public class BoxDemo extends JFrame
{
public BoxDemo(){
super("BOX"); JPanel bnPanel=new JPanel();
JButton button1 = new JButton("Button1");
JButton button2 = new JButton("Button2");
bnPanel.setLayout(new BoxLayout(bnPanel,
BoxLayout.Y_AXIS));
bnPanel.add(Box.createRigidArea(new Dimension(10, 10)));
bnPanel.add(button1);
bnPanel.add(Box.createRigidArea(new Dimension(10, 10)));
bnPanel.add(button2);
bnPanel.add(Box.createRigidArea(new Dimension(10, 10))); Container cp=getContentPane();
cp.setLayout(new GridLayout(2, 1));
//cp.add(labelPanel);
cp.add(bnPanel);
pack();
}
public static void main(String[] args) {
//Make sure we have nice window decorations.
JFrame.setDefaultLookAndFeelDecorated(true); //Create and set up the window.
JFrame frame = new BoxDemo();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.pack();
frame.setVisible(true);
}
}
不是 XP 风格,有点像 Linux 的