本文整理汇总了Java中javax.swing.JFrame.setDefaultLookAndFeelDecorated方法的典型用法代码示例。如果您正苦于以下问题:Java JFrame.setDefaultLookAndFeelDecorated方法的具体用法?Java JFrame.setDefaultLookAndFeelDecorated怎么用?Java JFrame.setDefaultLookAndFeelDecorated使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JFrame
的用法示例。
在下文中一共展示了JFrame.setDefaultLookAndFeelDecorated方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createAndShowGUI
import javax.swing.JFrame; //导入方法依赖的package包/类
/**
* Create the GUI and show it. For thread safety,
* this method should be invoked from the
* event-dispatching thread.
*/
public static SimpleTableDemo createAndShowGUI(
LazyReplicatedMap<String,StringBuilder> map, String title) {
//Make sure we have nice window decorations.
JFrame.setDefaultLookAndFeelDecorated(true);
//Create and set up the window.
JFrame frame = new JFrame("SimpleTableDemo - "+title);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//Create and set up the content pane.
SimpleTableDemo newContentPane = new SimpleTableDemo(map);
newContentPane.setOpaque(true); //content panes must be opaque
frame.setContentPane(newContentPane);
//Display the window.
frame.setSize(450,250);
newContentPane.setSize(450,300);
frame.pack();
frame.setVisible(true);
return newContentPane;
}
示例2: main
import javax.swing.JFrame; //导入方法依赖的package包/类
public static void main(String[] args) {
UIManager.put("swing.boldMetal", Boolean.FALSE);
JDialog.setDefaultLookAndFeelDecorated(true);
JFrame.setDefaultLookAndFeelDecorated(true);
Toolkit.getDefaultToolkit().setDynamicLayout(true);
System.setProperty("sun.awt.noerasebackground", "true");
try {
UIManager.setLookAndFeel(new MetalLookAndFeel());
} catch (UnsupportedLookAndFeelException e) {
System.out.println(
"Metal Look & Feel not supported on this platform. \n"
+ "Program Terminated");
System.exit(0);
}
JFrame frame = new MetalworksFrame();
frame.setVisible(true);
}
示例3: init
import javax.swing.JFrame; //导入方法依赖的package包/类
public void init() {
JFrame.setDefaultLookAndFeelDecorated(true);
try {
UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
} catch (ClassNotFoundException | InstantiationException |
IllegalAccessException | UnsupportedLookAndFeelException ex) {
throw new RuntimeException("Test Failed. MetalLookAndFeel not set "
+ "for frame");
}
frame = new JFrame("JFrame Maximization Test");
frame.pack();
frame.setSize(450, 260);
frame.setVisible(true);
}
示例4: initialize
import javax.swing.JFrame; //导入方法依赖的package包/类
public void initialize() throws Exception {
String skin = ObjectUtils.toString(config.get("UISkin")).trim();
String theme = ObjectUtils.toString(config.get("UITheme")).trim();
if(skin.equalsIgnoreCase("default")) //java default
return;
UIManager.setLookAndFeel(new SubstanceLookAndFeel());
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);
if(StringUtils.isNotEmpty(theme))
SubstanceLookAndFeel.setCurrentTheme(theme);
else if(StringUtils.isNotEmpty(skin))
SubstanceLookAndFeel.setSkin((SubstanceSkin)newInstance(skin));
String watermark = ObjectUtils.toString(config.get("UIWatermark")).trim();
if(StringUtils.isNotEmpty(watermark))
SubstanceLookAndFeel.setCurrentWatermark((SubstanceWatermark)newInstance(watermark));
String buttonShaper = ObjectUtils.toString(config.get("UIButtonShaper")).trim();
if(StringUtils.isNotEmpty(buttonShaper))
SubstanceLookAndFeel.setCurrentButtonShaper((SubstanceButtonShaper)newInstance(buttonShaper));
String borderPainter = ObjectUtils.toString(config.get("UIBorderPainter")).trim();
if(StringUtils.isNotEmpty(borderPainter))
SubstanceLookAndFeel.setCurrentBorderPainter((SubstanceBorderPainter)newInstance(borderPainter));
String gradientPainter = ObjectUtils.toString(config.get("UIGradientPainter")).trim();
if(StringUtils.isNotEmpty(gradientPainter))
SubstanceLookAndFeel.setCurrentGradientPainter((SubstanceGradientPainter)newInstance(gradientPainter));
}
示例5: main
import javax.swing.JFrame; //导入方法依赖的package包/类
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/*
* Create and display the form
*/
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
SubstanceLookAndFeel.setSkin(new CremeCoffeeSkin());
MainFrame frame = new MainFrame();
frame.initActionPerform();
frame.initListSelectionListener();
frame.setVisible(true);
}
});
}
示例6: main
import javax.swing.JFrame; //导入方法依赖的package包/类
public static void main(String[] args) {
//Call frame to build UI
JFrame.setDefaultLookAndFeelDecorated(true);
AleFrame frame = new AleFrame();
frame.setVisible(true);
frame.setResizable(false);
}
示例7: main
import javax.swing.JFrame; //导入方法依赖的package包/类
public static void main(String[] args) {
JFrame.setDefaultLookAndFeelDecorated(false);
Screenwriter a = new Screenwriter();
}
示例8: main
import javax.swing.JFrame; //导入方法依赖的package包/类
public static void main(String[] args) {
JFrame.setDefaultLookAndFeelDecorated(true);
/*
* NAA.
* This is procedural and imperative approach
* https://stackoverflow.com/questions/26092495/jframe-setting-the-row-and-column-in-a-gridlayout
JFrame frame = new JFrame("GridLayout Test");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setLayout(new GridLayout(3, 2));
frame.add(new JButton("Button 1"));
frame.add(new JButton("Button 2"));
frame.add(new JButton("Button 3"));
frame.add(new JButton("Button 4"));
frame.add(new JButton("Button 5"));
frame.add(new JButton("Button 6"));
frame.add(new JButton("Button 7"));
frame.add(new JButton("Button 8"));
frame.pack();
frame.setVisible(true);
*/
/*
* Let's try "wrapping" JFrame into a class and using a more object-oriented approach.
* Learning objectives:
* - Encapsulation
* e.g., Use board to keep its own implementation details
* - Inheritance
* e.g., inherit traits from parent "super" class like JFrame
* - Assigning behaviors
* e.g., allow board to have behaviors
*/
Board board = new Board(4,4);
// stay open until close JFrame
}
示例9: main
import javax.swing.JFrame; //导入方法依赖的package包/类
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
initLookAndFeel();
JFrame.setDefaultLookAndFeelDecorated(true);
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
fmPrincipal = new FramePrincipal();
fmPrincipal.setVisible(true);
}
});
}
示例10: main
import javax.swing.JFrame; //导入方法依赖的package包/类
public static void main(String[] args) {
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);
try {
UIManager.setLookAndFeel(new SubstanceOfficeBlue2007LookAndFeel());
} catch (UnsupportedLookAndFeelException e) {
e.printStackTrace();
}
System.out.println(111);
initSetting();
MenuFrame.open();
}
示例11: createAndShowGUI
import javax.swing.JFrame; //导入方法依赖的package包/类
/**
* Create the GUI and show it. For thread safety, this method should be
* invoked from the event-dispatching thread.
*/
private static void createAndShowGUI() {
// Make sure we have nice window decorations.
JFrame.setDefaultLookAndFeelDecorated(true);
// Create and set up the window.
InternalFrameDemo frame = new InternalFrameDemo();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// Display the window.
frame.setVisible(true);
}
示例12: test
import javax.swing.JFrame; //导入方法依赖的package包/类
@Test
public void test() {
JTouchBar jTouchBar = JTouchBarTestUtils.constructTouchBar();
assertNotNull(jTouchBar);
JFrame.setDefaultLookAndFeelDecorated(true);
final JFrame frame = new JFrame("JTouchBar");
frame.pack();
frame.setVisible(true);
jTouchBar.show(frame);
}
示例13: main
import javax.swing.JFrame; //导入方法依赖的package包/类
/**
* @param args the command line arguments
*/
public static void main(String args[])
{
try
{
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
JFrame.setDefaultLookAndFeelDecorated(true);
// UIManager.setLookAndFeel(new WindowsLookAndFeel());
//</editor-fold>
} catch (Exception ex)
{
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable()
{
@Override
public void run()
{
Main m = new Main();
m.setResizable(false);
m.setVisible(true);
}
});
}
示例14: init
import javax.swing.JFrame; //导入方法依赖的package包/类
public void init(){
JFrame.setDefaultLookAndFeelDecorated(true);
f = new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setPreferredSize(new Dimension(FRAME_WIDTH, FRAME_HEIGHT));
f.setTitle("群控");
f.setResizable(true);
f.setLocationRelativeTo(null);
jpControl = new JPanel();
jbSendZone = new JButton("发送朋友圈");
jpControl.add(jbSendZone);
jpDevice = new JPanel();
// jpDevice.setLayout(new FlowLayout(FlowLayout.LEADING, 20, 5));
jpDevice.setLayout(new WrapLayout(WrapLayout.LEFT));
Iterator<Entry<String, Thread>> iter = Devices.devices.entrySet().iterator();
int port = 1313, count=0;
while(iter.hasNext()){
Map.Entry<String, Thread> entry = (Map.Entry<String, Thread>)iter.next();
String serial = entry.getKey();
JPanel jp = new JPanel();
DrawImageThread dit = new DrawImageThread(serial, port++, jp);
dit.start(); //启动绘制线程
entry.setValue(dit); //在device list中保存线程句柄
count++;
jpDevice.add(jp);
}
jspDevice = new JScrollPane(jpDevice);
jspDevice.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
jsp = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, jpControl, jspDevice);
jsp.setDividerLocation(0.3);
jsp.setDividerSize(10);
jsp.setOneTouchExpandable(true);
f.add(jsp);
f.pack();
f.setVisible(true);
}