Last active
March 10, 2019 12:16
-
-
Save ezhov-da/85bbf9e8bbbd0ee11bd604b8339ea2e9 to your computer and use it in GitHub Desktop.
фон для JFrame
This file contains 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 javax.swing.*; | |
import java.awt.*; | |
/** | |
* Created by ezhov_da on 18.04.2018. | |
*/ | |
class JFrameTest extends JFrame { | |
private JLabel label; | |
public JFrameTest() { | |
setTitle("Example"); | |
setSize(400, 400); | |
setLocationRelativeTo(null); | |
setDefaultCloseOperation(EXIT_ON_CLOSE); | |
setContentPane(new JLabel(new ImageIcon("image.jpg"))); | |
setLayout(new FlowLayout()); | |
label = new JLabel("Test"); | |
add(label); | |
setVisible(true); | |
} | |
public static void main(String args[]) { | |
new JFrameTest(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment