Skip to content

Instantly share code, notes, and snippets.

@ezhov-da
Last active March 10, 2019 12:16
Show Gist options
  • Save ezhov-da/85bbf9e8bbbd0ee11bd604b8339ea2e9 to your computer and use it in GitHub Desktop.
Save ezhov-da/85bbf9e8bbbd0ee11bd604b8339ea2e9 to your computer and use it in GitHub Desktop.
фон для JFrame
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