當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。