Java Swing: JLayeredPane

Publicado em: 21 Maio 2023
no canal de: Le Hoang Long Long
387
2

Playlist
   • Java Frontend  

2023 05 21 03 34 21


import java.awt.Color;
import java.awt.HeadlessException;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLayeredPane;

public class layeredpane extends JFrame {

public layeredpane() throws HeadlessException {

super("Example of LayeredPane");
setSize(300, 300);

JLayeredPane panel1 = getLayeredPane();

JButton Press = new JButton();
Press.setBackground(Color.red);
Press.setBounds(30, 30, 60, 60);

JButton middlestate = new JButton();
middlestate.setBackground(Color.white);
middlestate.setBounds(50, 50, 60, 60);

JButton bottomstate = new JButton();
bottomstate.setBackground(Color.cyan);
bottomstate.setBounds(70, 70, 60, 60);

//adding buttons to the pane
panel1.add(bottomstate, new Integer(3));
panel1.add(middlestate, new Integer(1));
panel1.add(Press, new Integer(2));

}

public static void main(String[] args) {
layeredpane p = new layeredpane();
p.setVisible(true);
p.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

}

}


Nesta página do site você pode assistir ao vídeo on-line Java Swing: JLayeredPane duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Le Hoang Long Long 21 Maio 2023, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 387 vezes e gostou 2 espectadores. Boa visualização!