Created
June 13, 2020 09:51
-
-
Save Rastrian/70ad464ff66ae4a8b328a02a7fa6610c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.BorderLayout; | |
import java.awt.Color; | |
import java.awt.Container; | |
import javax.swing.Action; | |
import javax.swing.JButton; | |
import javax.swing.JFrame; | |
public class ShumlabsFrame extends JFrame { | |
private static final long serialVersionUID = 1L; | |
JButton btnAplicar = new JButton("Aplicar mudanca"); | |
public ShumlabsFrame(String name) { | |
super(name); | |
Container pane = this.getContentPane(); | |
btnAplicar.addActionListener(e -> processEvent(e)); | |
pane.add(btnAplicar, BorderLayout.SOUTH); | |
} | |
public void processEvent(Action e) { | |
this.setBackground(Color.BLUE); | |
this.setOpacity(1); | |
} | |
public static void main(String[] args) { | |
ShumlabsFrame frame = new ShumlabsFrame("Shumlabs Frame"); | |
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); | |
frame.pack(); | |
frame.setVisible(true); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment