本文整理了Java中javax.swing.JFrame.setShape()
方法的一些代码示例,展示了JFrame.setShape()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JFrame.setShape()
方法的具体详情如下:
包路径:javax.swing.JFrame
类名称:JFrame
方法名:setShape
暂无
代码示例来源:origin: stackoverflow.com
JFrame frame = new JFrame("Testing");
frame.getContentPane().setBackground(Color.RED);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setLayout(new GridBagLayout());
frame.add(new JLabel("Boo!"));
frame.setSize(200, 200);
frame.setLocationRelativeTo(null);
frame.setUndecorated(true);
frame.setShape(new Ellipse2D.Double(0, 0, 200, 200));
frame.setVisible(true);
代码示例来源:origin: stackoverflow.com
JFrame frame = new JFrame();
frame.setUndecorated(true);
frame.setShape(new RoundRectangle2D.Double(10, 10, 100, 100, 50, 50));
frame.setSize(300, 200);
frame.setVisible(true);
代码示例来源:origin: stackoverflow.com
JFrame frame = new JFrame("Testing");
frame.setUndecorated(true);
frame.setBackground(new Color(0, 0, 0, 0));
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// This is the secret here...
JPanel content = new JPanel(new BorderLayout());
content.setOpaque(false);
content.setBorder(new EmptyBorder(1, 1, 1, 1));
content.add(new CirclePane());
frame.setContentPane(content);
frame.pack();
int width = frame.getWidth();
int height = frame.getHeight();
frame.setShape(new Ellipse2D.Double(0, 0, width, height));
frame.setLocationRelativeTo(null);
frame.setVisible(true);
代码示例来源:origin: com.metsci.glimpse/glimpse-docking
Area shape = new Area( new Rectangle( 0, 0, w, h ) );
shape.subtract( new Area( new Rectangle( leftBorder, topBorder, w - ( leftBorder + rightBorder ), h - ( topBorder + bottomBorder ) ) ) );
frame.setShape( shape );
break;
内容来源于网络,如有侵权,请联系作者删除!