frame.setLayout(new BorderLayout()); frame.add(lpane, BorderLayout.CENTER); lpane.setBounds(0, 0, 600, 400); panelBlue.setBackground(Color.BLUE); panelBlue.setBounds(0, 0, 600, 400);
pnlText.setBounds(20, 150, 570, 90);
void start(int numofplayer_int) { JLayeredPane lpane = new JLayeredPane(); lpane.setBounds(0, 0, 1200, 750); JPanel background = new WallPaper(); //background.setBounds(0, 0, 1200, 750); background.setOpaque(true); //this.setBounds(100, 100, 400, 400); this.setBounds(0,0,1200,750); this.setOpaque(false); lpane.add(background, new Integer(0), 0); lpane.add(this, new Integer(1), 0); Utility.ChangeJLPanel(lpane); }
void start() // don't need the parameter anymore { JLayeredPane lpane = new JLayeredPane(); lpane.setBounds(0, 0, 1200, 750); JPanel background = new WallPaper(); //background.setBounds(0, 0, 1200, 750); background.setOpaque(true); // Update self //this.setBounds(100, 100, 400, 400); this.setBounds(0,0,1200,750); this.setOpaque(false); lpane.add(background, new Integer(0), 0); lpane.add(this, new Integer(1), 0); Utility.ChangeJLPanel(lpane); }
jlp.setBounds(0, 0, 1000, 500); jlp.add(button1); frame2.add(jlp);
public void createAndShowGUI() { setTitle("Transparent Panel"); setDefaultCloseOperation(EXIT_ON_CLOSE); setUndecorated(true); AWTUtilities.setWindowOpaque(this, false); JLayeredPane layeredPane = new JLayeredPane(); layeredPane.setBounds(0, 0, 315, 610); JLabel mobileImageLabel = new JLabel(new ImageIcon("C://Mobile.png")); mobileImageLabel.setBounds(0, 0, 315, 610); layeredPane.add(mobileImageLabel, Integer.valueOf(0)); JLabel textLabel = new JLabel(" Booting... "); textLabel.setVerticalAlignment(SwingConstants.TOP); textLabel.setForeground(Color.GREEN); textLabel.setBounds(26, 59, 263, 495); layeredPane.add(textLabel, Integer.valueOf(1)); setContentPane(layeredPane); setSize(315, 610); setLocation(800, 100); setVisible(true); }
@Override protected void paintComponent(Graphics g) { int width = getWidth(); int height = getHeight(); pane.setBounds(0, 0, width, height); mapPanel.setBounds(0, 0, width, height); optionView.setBounds(width - 10 - optionView.getWidth(), height - 10 - optionView.getHeight(), optionView.getWidth(), optionView.getHeight()); super.paintComponent(g); }
@Override public void layoutContainer(Container parent) { Rectangle bounds = parent.getBounds(); Insets insets = pane.getInsets(); // substract insets int w = bounds.width - insets.right - insets.left; int h = bounds.height - insets.top - insets.bottom; JLayeredPane layeredPane = pane.getLayeredPane(); if (layeredPane != null) { layeredPane.setBounds(insets.left, insets.top, w, h); // x, y, w, h } Component glassPane = pane.getGlassPane(); if (glassPane != null) { glassPane.setBounds(insets.left, insets.top, w, h); } // Note: This is laying out the children in the layeredPane, // technically, these are not our children. int contentY = 0; Container contentPane = pane.getContentPane(); if (contentPane != null) { contentPane.setBounds(0, contentY, w, h - contentY); // x, y, w, h } }
setSize(WIDTH, HEIGHT); JLayeredPane jLP = new JLayeredPane(); jLP.setBounds(0,0,800,600); ml = new MediaLocator("vfw:Microsoft WDM Image Capture (Win32):0"); try {
layeredPane.setBounds(i.left, i.top, w, h);
rootPane.getLayeredPane().setBounds(x, y, w, h);
rootPane.getLayeredPane().setBounds(x, y, w, h);
root.getLayeredPane().setBounds(i.left, i.top, w, h);
root.getLayeredPane().setBounds(i.left, i.top, w, h);
root.getLayeredPane().setBounds(i.left, i.top, w, h);
root.getLayeredPane().setBounds(i.left, i.top, w, h);
root.getLayeredPane().setBounds(i.left, i.top, w, h);
root.getLayeredPane().setBounds(i.left, i.top, w, h);
root.getLayeredPane().setBounds(i.left, i.top, w, h);