Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.*;
- import javax.swing.*;
- public class Test extends JFrame {
- public Test() {
- super("Program");
- CreateAndShowGui();
- }
- private void CreateAndShowGui() {
- 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());
- 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);
- setSize(400, 200);
- setVisible(true);
- }
- public static void main(String[] args) {
- SwingUtilities.invokeLater(new Runnable() {
- public void run() {
- UIManager.put("swing.boldmetal", Boolean.FALSE);
- new Test();
- }
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment