Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Test {
- private static void CreateAndShowGui() {
- JFrame frame = new JFrame("Program");
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- JTextPane txt = new JTextPane();
- JPanel noWrapPanel = new JPanel(new BorderLayout());
- noWrapPanel.add(txt);
- JScrollPane scroll = new JScrollPane(noWrapPanel);
- JPanel topPanel = new JPanel();
- topPanel.setLayout(new BorderLayout());
- frame.add(topPanel);
- JPanel panel = new JPanel();
- panel.setLayout(new BorderLayout());
- panel.add(scroll, BorderLayout.CENTER);
- JTabbedPane tabbedPane = new JTabbedPane();
- tabbedPane.addTab("Welcome", panel);
- topPanel.add(tabbedPane);
- frame.setSize(400, 200);
- frame.setVisible(true);
- }
- public static void main(String[] args) {
- SwingUtilities.invokeLater(new Runnable() {
- public void run() {
- UIManager.put("swing.boldmetal", Boolean.FALSE);
- CreateAndShowGui();
- }
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment