} public static void main(String args[]) { GraphicJavaApplication.launch(new test(), "Vetoing Node Expansion/Collapse",300,300,300,200); } } class GraphicJavaApplication extends WindowAdapter { public static void launch(final JFrame f, String title, final int x, final int y, final int w, int h) { f.setTitle(title); f.setBounds(x,y,w,h); f.setVisible(true); f.setDefaultCloseOperation( WindowConstants.DISPOSE_ON_CLOSE); f.addWindowListener(new WindowAdapter() { public void windowClosed(WindowEvent e) { System.exit(0); } }); } }
主要是这两句
LookAndFeel.installBorder( field, "JComboBox.border" );
LookAndFeel.installColorsAndFont( field, "JComboBox.foreground", "JComboBox.background", "JComboBox.font" );
不过好像没有什么用~~~
你就当作是参考吧
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.tree.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.plaf.BorderUIResource;public class test extends JFrame {
public test() {
JTextField field = new JTextField();
getContentPane().add( field, BorderLayout.CENTER );
LookAndFeel.installBorder( field, "JComboBox.border" );
LookAndFeel.installColorsAndFont( field, "JComboBox.foreground", "JComboBox.background", "JComboBox.font" );
JComboBox jcombo = new JComboBox();
getContentPane().add( jcombo, BorderLayout.SOUTH );
}
public static void main(String args[]) {
GraphicJavaApplication.launch(new test(),
"Vetoing Node Expansion/Collapse",300,300,300,200);
}
}
class GraphicJavaApplication extends WindowAdapter {
public static void launch(final JFrame f, String title,
final int x, final int y,
final int w, int h) {
f.setTitle(title);
f.setBounds(x,y,w,h);
f.setVisible(true); f.setDefaultCloseOperation(
WindowConstants.DISPOSE_ON_CLOSE); f.addWindowListener(new WindowAdapter() {
public void windowClosed(WindowEvent e) {
System.exit(0);
}
});
}
}
不管这个东西真的不太管用就是了
可能只是对于某一些有用就是了
我实在核心技术的Swing卷里面看到的
200左右的那个地方~~~
他举的那个例子还是相当不错的
不过对于你的这个就不太行了
不管怎么样,祝好运