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


Java JFrame.setUndecorated方法代码示例

本文整理汇总了Java中javax.swing.JFrame.setUndecorated方法的典型用法代码示例。如果您正苦于以下问题:Java JFrame.setUndecorated方法的具体用法?Java JFrame.setUndecorated怎么用?Java JFrame.setUndecorated使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.JFrame的用法示例。


在下文中一共展示了JFrame.setUndecorated方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: showSplash

import javax.swing.JFrame; //导入方法依赖的package包/类
/**
 * Method showSplash.
 */
private void showSplash() {
	splash = new JFrame();
	ImageIcon spl =
		new ImageIcon(App.class.getResource("resources/splash.png"));
	JLabel l = new JLabel();
	l.setSize(400, 300);
	l.setIcon(spl);
	splash.getContentPane().add(l);
	splash.setSize(400, 300);
	Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
	splash.setLocation(
		(screenSize.width - 400) / 2,
		(screenSize.height - 300) / 2);
	splash.setUndecorated(true);
	splash.setVisible(true);
}
 
开发者ID:ser316asu,项目名称:SER316-Munich,代码行数:20,代码来源:App.java

示例2: SplashScreen

import javax.swing.JFrame; //导入方法依赖的package包/类
public SplashScreen(Image productLogo, Properties properties) {
	this.properties = properties;
	this.productLogo = productLogo;
	this.productName = I18N.getGUIMessage("gui.splash.product_name");

	splashScreenFrame = new JFrame(properties.getProperty("name"));
	splashScreenFrame.getContentPane().add(this);
	SwingTools.setFrameIcon(splashScreenFrame);

	splashScreenFrame.setUndecorated(true);
	if (backgroundImage != null) {
		splashScreenFrame.setSize(backgroundImage.getWidth(this), backgroundImage.getHeight(this));
	} else {
		splashScreenFrame.setSize(550, 400);
	}
	splashScreenFrame.setLocationRelativeTo(null);

	animationTimer = new Timer(10, this);
	animationTimer.setRepeats(true);
	animationTimer.start();
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:22,代码来源:SplashScreen.java

示例3: showSplash

import javax.swing.JFrame; //导入方法依赖的package包/类
/**
 * Method showSplash.
 */
private void showSplash() {
    splash = new JFrame();
    ImageIcon spl =
        new ImageIcon(App.class.getResource("/ui/splash.png"));
    JLabel l = new JLabel();
    l.setSize(400, 300);
    l.setIcon(spl);
    splash.getContentPane().add(l);
    splash.setSize(400, 300);
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    splash.setLocation(
        (screenSize.width - 400) / 2,
        (screenSize.height - 300) / 2);
    splash.setUndecorated(true);
    splash.setVisible(true);
}
 
开发者ID:ser316asu,项目名称:SER316-Dresden,代码行数:20,代码来源:App.java

示例4: main

import javax.swing.JFrame; //导入方法依赖的package包/类
public static void main(String[] args) {
    // Main method
    Main m = new Main(); // Create the game object
    Main.m = m;
    frame = new JFrame("Game");
    frame.setResizable(false);
    frame.setUndecorated(true);
    frame.add(m.canvas);
 
    frame.pack();
    frame.addWindowListener(m);

    frame.setLocationRelativeTo(null);
    frame.setVisible(true);
    frame.requestFocus();
    m.start();
}
 
开发者ID:ritcat14,项目名称:The-Mysterious-Mind-Of-Jack,代码行数:18,代码来源:Main.java

示例5: showSplash

import javax.swing.JFrame; //导入方法依赖的package包/类
/**
 * Method showSplash.
 */
private void showSplash() {
	splash = new JFrame();
	ImageIcon spl =
		new ImageIcon(App.class.getResource("resources/splash.png"));
	JLabel jl = new JLabel();
	jl.setSize(400, 300);
	jl.setIcon(spl);
	splash.getContentPane().add(jl);
	splash.setSize(400, 300);
	Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
	splash.setLocation(
		(screenSize.width - 400) / 2,
		(screenSize.height - 300) / 2);
	splash.setUndecorated(true);
	splash.setVisible(true);
}
 
开发者ID:ser316asu,项目名称:Wilmersdorf_SER316,代码行数:20,代码来源:App.java

示例6: setDefaultMenuBar

import javax.swing.JFrame; //导入方法依赖的package包/类
void setDefaultMenuBar(final JMenuBar menuBar) {
    installDefaultMenuBar(menuBar);

    // scan the current frames, and see if any are foreground
    final Frame[] frames = Frame.getFrames();
    for (final Frame frame : frames) {
        if (frame.isVisible() && !isFrameMinimized(frame)) {
            return;
        }
    }

    // if we have no foreground frames, then we have to "kick" the menubar
    final JFrame pingFrame = new JFrame();
    pingFrame.getRootPane().putClientProperty("Window.alpha", Float.valueOf(0.0f));
    pingFrame.setUndecorated(true);
    pingFrame.setVisible(true);
    pingFrame.toFront();
    pingFrame.setVisible(false);
    pingFrame.dispose();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:21,代码来源:_AppMenuBarHandler.java

示例7: createUI

import javax.swing.JFrame; //导入方法依赖的package包/类
private static void createUI() {
    frame = new JFrame();
    frame.setUndecorated(true);
    frame.setSize(300, 300);
    frame.setLocationRelativeTo(null);
    final JDesktopPane pane = new JDesktopPane();
    final JPanel panel = new JPanel() {
        @Override
        protected void paintComponent(Graphics g) {
            g.setColor(color);
            g.fillRect(0, 0, getWidth(), getHeight());
        }
    };
    jif = new JInternalFrame();
    jif.add(panel);
    jif.setVisible(true);
    jif.setSize(300, 300);
    pane.add(jif);
    frame.add(pane);
    frame.setVisible(true);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:22,代码来源:DockIconRepaint.java

示例8: initializeFrame

import javax.swing.JFrame; //导入方法依赖的package包/类
public void initializeFrame(){

		// Main frame
		f = new JFrame("Dynamic Simulation Display");
		f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		f.setSize(DYNAMIC_FRAME_WIDTH, DYNAMIC_FRAME_HEIGHT);
		f.setUndecorated(true);
		f.setBackground(Color.BLACK);
		f.setLayout(null);
		f.setLocationRelativeTo(null);
		f.setResizable(false);
		f.add(new JLabel("test label"));

		// Add the dynamic track view panel
		f.add(dynamicTrackView);

		dynamicTrackView.addMouseListener(new MouseAdapter() {
			@Override
			public void mousePressed(MouseEvent e) {
				dynamicTrackView.showArrows = !dynamicTrackView.showArrows;
				dynamicTrackView.refresh();
			}
		});
	}
 
开发者ID:kevingilboy,项目名称:COE1186,代码行数:25,代码来源:DynamicDisplay.java

示例9: run

import javax.swing.JFrame; //导入方法依赖的package包/类
@Override
public void run() {
    final JMenuBar menubar = new JMenuBar();
    menubar.add(new JMenu(""));
    menubar.add(new JMenu(""));
    final JFrame frame = new JFrame();
    frame.setUndecorated(true);
    frame.setJMenuBar(menubar);
    frame.setSize(W / 3, H / 3);
    frame.setLocationRelativeTo(null);
    frame.setVisible(true);

    // draw menu bar using standard order.
    final BufferedImage bi1 = step1(menubar);

    // draw menu border on top of the menu bar, nothing should be changed.
    final BufferedImage bi2 = step2(menubar);
    frame.dispose();

    for (int x = 0; x < W; ++x) {
        for (int y = 0; y < H; ++y) {
            if (bi1.getRGB(x, y) != bi2.getRGB(x, y)) {
                try {
                    ImageIO.write(bi1, "png", new File("image1.png"));
                    ImageIO.write(bi2, "png", new File("image2.png"));
                } catch (IOException e) {
                    e.printStackTrace();
                }
                throw new RuntimeException("Failed: wrong color");
            }
        }
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:34,代码来源:MisplacedBorder.java

示例10: createAndShowGUI

import javax.swing.JFrame; //导入方法依赖的package包/类
private static void createAndShowGUI() {
    demoFrame = new JFrame();
    demoFrame.setSize(300, 300);
    demoFrame.setLayout(new FlowLayout());
    demoFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    demoFrame.setUndecorated(true);
    demoFrame.setBackground(new Color(0f, 0, 0, 0.1f));
    JCheckBox b = new JCheckBox("Whatever");
    demoFrame.paintAll(null);
    b.setOpaque(true);
    demoFrame.add(b);
    demoFrame.add(new JButton());
    demoFrame.setVisible(true);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:15,代码来源:ComponentResizeTest.java

示例11: initAndShowGUI

import javax.swing.JFrame; //导入方法依赖的package包/类
private void initAndShowGUI() {
    JFrame w = new JFrame();
    w.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    if (!QConfig.cfg().isDebug()) {
        w.setUndecorated(true);
    }
    // Create JavaFX panel.
    /* todo
    javafxPanel = new JFXPanel();
    javafxPanel.setPreferredSize(new Dimension(win_w, win_h));
    w.getContentPane().add(javafxPanel, BorderLayout.CENTER);
     * 
     */

    initFXscene();

    // Show frame.
    w.pack();
    w.setLocationRelativeTo(null);
    w.setVisible(true);
    if (QConfig.cfg().isDebug()) {
        w.setBounds(100, 100, 1024, 768);
    } else {
        w.setBounds(win_x, win_y, win_w, win_h);
        w.setAlwaysOnTop(true);
    }
}
 
开发者ID:bcgov,项目名称:sbc-qsystem,代码行数:28,代码来源:ABoardFX.java

示例12: displayCalibrationStatus

import javax.swing.JFrame; //导入方法依赖的package包/类
protected void displayCalibrationStatus(JFrame frame) throws Exception {
	 double[] pointsNormalized = jniGetCalibration();
	 
	 if (pointsNormalized == null)
		 throw new IOException("Can't get calibration data!");
	 
	 int zeros = 0;
	 for( double ord: pointsNormalized){
		 if( ord <= 0 || ord > 1) zeros++;
	 }
	 ArrayList<Point2D.Double> points = new ArrayList<Point2D.Double>();
	 ArrayList<Point2D.Double> invalidpoints = new ArrayList<Point2D.Double>();
	//if( zeros > 0 ) throw new IOException("zeros in points: "+zeros+"/"+pointsNormalized.length);
	 
	 int itemCount = pointsNormalized.length/4;

	 for( int i=0; i < itemCount; i++ ){
		 
		points.add(new Point2D.Double(pointsNormalized[i],pointsNormalized[i+itemCount]));
		points.add(new Point2D.Double(pointsNormalized[(2*itemCount)+i],pointsNormalized[i+(itemCount*3)]));
	 }
	 
	 Rectangle2D.Double rect = new Rectangle2D.Double(0.0,0.0,1.0,1.0);
	 
	 for(Point2D.Double p: points){
		 if( !rect.contains(p) ) invalidpoints.add(p);
	 }
	 
	 for (int i = 0; i < pointsNormalized.length; i++) {
		 if (pointsNormalized[i] < 0.0001) {
			 pointsNormalized[i] = 0.0001;
		 } else if (pointsNormalized[i] > 0.9999) {
			 pointsNormalized[i] = 0.9999;
		 } else {
    		//do nothing
		 }
	 }
    
	 Point2D.Double[] calibrationData = new Point2D.Double[itemCount+1];
	 for (int j = 0; j < itemCount; j+=2) {
		 calibrationData[j] = (new Point2D.Double(pointsNormalized[j],pointsNormalized[itemCount+j]));
		 if(j != itemCount)
			 calibrationData[j+1] = (new Point2D.Double(pointsNormalized[2*itemCount+j],pointsNormalized[3*itemCount+j]));
	 }
	 JFrame calibFrame = frame;
	 CalibrationStatusDisplay calibDisplay = 
			 new CalibrationStatusDisplay(calibFrame,calibrationPoints,calibrationData);
	 
	 calibFrame.add(calibDisplay);
    calibFrame.setUndecorated(false);
    calibFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    calibFrame.setExtendedState(JFrame.MAXIMIZED_BOTH);
    calibFrame.setMinimumSize(new Dimension(600,300));
    calibFrame.setTitle("Calibration: "+new Date());
    Insets insets = calibFrame.getInsets();
   	int width = calibFrame.getSize().width-(insets.left+insets.right);
   	int height = calibFrame.getSize().height-(insets.top+insets.bottom);
   	calibDisplay.windowDimension = new Dimension(width,height);
    calibFrame.setVisible(true);
    calibFrame.toFront();
    calibDisplay.repaint();
}
 
开发者ID:SERESLab,项目名称:iTrace-Archive,代码行数:63,代码来源:EyeXTracker.java

示例13: displayCalibrationStatus

import javax.swing.JFrame; //导入方法依赖的package包/类
protected void displayCalibrationStatus(JFrame frame) throws Exception {
	 double[] pointsNormalized = jniGetCalibration();
	 
	 if (pointsNormalized == null)
		 throw new IOException("Can't get calibration data!");
	 
	 int zeros = 0;
	 for( double ord: pointsNormalized){
		 if( ord <= 0 || ord > 1) zeros++;
	 }
	 ArrayList<Point2D.Double> points = new ArrayList<Point2D.Double>();
	 ArrayList<Point2D.Double> invalidpoints = new ArrayList<Point2D.Double>();
	//if( zeros > 0 ) throw new IOException("zeros in points: "+zeros+"/"+pointsNormalized.length);
	 
	 int itemCount = pointsNormalized.length/4;

	 for( int i=0; i < itemCount; i++ ){
		 
		points.add(new Point2D.Double(pointsNormalized[i],pointsNormalized[i+itemCount]));
		points.add(new Point2D.Double(pointsNormalized[(2*itemCount)+i],pointsNormalized[i+(itemCount*3)]));
	 }
	 
	 Rectangle2D.Double rect = new Rectangle2D.Double(0.0,0.0,1.0,1.0);
	 
	 for(Point2D.Double p: points){
		 if( !rect.contains(p) ) invalidpoints.add(p);
	 }
	 
	 for (int i = 0; i < pointsNormalized.length; i++) {
		 if (pointsNormalized[i] < 0.0001) {
			 pointsNormalized[i] = 0.0001;
		 } else if (pointsNormalized[i] > 0.9999) {
			 pointsNormalized[i] = 0.9999;
		 } else {
    		//do nothing
		 }
	 }
    
	 Point2D.Double[] calibrationData = new Point2D.Double[itemCount+1];
	 for (int j = 0; j < itemCount; j+=2) {
		 calibrationData[j] = (new Point2D.Double(pointsNormalized[j],pointsNormalized[itemCount+j]));
		 if(j != itemCount)
			 calibrationData[j+1] = (new Point2D.Double(pointsNormalized[2*itemCount+j],pointsNormalized[3*itemCount+j]));
	 }
	 JFrame calibFrame = frame;
	 CalibrationStatusDisplay calibDisplay = 
			 new CalibrationStatusDisplay(calibFrame,calibrationPoints,calibrationData);
	 
	 calibFrame.add(calibDisplay);
    calibFrame.setUndecorated(false);
    calibFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    calibFrame.setExtendedState(JFrame.MAXIMIZED_BOTH);
    calibFrame.setMinimumSize(new Dimension(600,300));
    calibFrame.setTitle("Calibration: "+new Date());
    Insets insets = calibFrame.getInsets();
    int width = calibFrame.getSize().width-(insets.left+insets.right);
    int height = calibFrame.getSize().height-(insets.top+insets.bottom);
  		calibDisplay.windowDimension = new Dimension(width,height);
    calibFrame.setVisible(true);
    calibDisplay.repaint();
}
 
开发者ID:SERESLab,项目名称:iTrace-Archive,代码行数:62,代码来源:TobiiTracker.java


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