当前位置: 首页>>代码示例>>Java>>正文


Java JFrame.setDefaultLookAndFeelDecorated方法代码示例

本文整理汇总了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;
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:27,代码来源:MapDemo.java

示例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);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:18,代码来源:Metalworks.java

示例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);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:17,代码来源:MaximizedFrameTest.java

示例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));
}
 
开发者ID:hulang1024,项目名称:PTEAssistant,代码行数:29,代码来源:SkinManager.java

示例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);
        }
    });
}
 
开发者ID:ajtdnyy,项目名称:PackagePlugin,代码行数:22,代码来源:MainFrame.java

示例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);
	
}
 
开发者ID:dylanwaynefoster,项目名称:AleCulator2,代码行数:10,代码来源:ABVCalc.java

示例7: main

import javax.swing.JFrame; //导入方法依赖的package包/类
public static void main(String[] args) {
	JFrame.setDefaultLookAndFeelDecorated(false);
	Screenwriter a = new Screenwriter();
	
}
 
开发者ID:beargrllys,项目名称:OverTale,代码行数:6,代码来源:ProjectMain.java

示例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
}
 
开发者ID:lukealba,项目名称:2048-java-swing,代码行数:35,代码来源:Main.java

示例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);
        }
    });
}
 
开发者ID:chcandido,项目名称:brModelo,代码行数:16,代码来源:Aplicacao.java

示例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();
}
 
开发者ID:zhangjikai,项目名称:LinkGame,代码行数:13,代码来源:Main.java

示例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);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:16,代码来源:InternalFrameDemo.java

示例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);
}
 
开发者ID:Thizzer,项目名称:JTouchBar,代码行数:14,代码来源:JTouchBarAWTTest.java

示例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);
    }
  });
}
 
开发者ID:beykery,项目名称:betacome,代码行数:34,代码来源:Main.java

示例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);
	}
 
开发者ID:larryzhuo,项目名称:JavaMinicap,代码行数:42,代码来源:MainFrame.java


注:本文中的javax.swing.JFrame.setDefaultLookAndFeelDecorated方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。