Last active
December 27, 2015 22:19
-
-
Save jrm2k6/7398128 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 javax.swing.*; | |
| import java.awt.*; | |
| import java.lang.*; | |
| class main | |
| { | |
| public static void main (String Args []) | |
| { | |
| GUIwindow guiW = new GUIwindow(); | |
| } | |
| } | |
| class GridPanel extends JPanel { | |
| GridPanel() { | |
| super(); | |
| } | |
| @Override | |
| public void paintComponent(Graphics g) { | |
| super.paintComponent(g); | |
| g.setColor(Color.decode("#0232ac")); | |
| g.fillRoundRect(0, 50, 300, 600, 50, 50); | |
| g.setColor(Color.white); | |
| g.drawString("TitleonRect", 220, 400); | |
| } | |
| } | |
| class GUIwindow extends JFrame | |
| { | |
| GridPanel grid = new GridPanel(); | |
| JTextArea screenArea = new JTextArea("", 10, 20); | |
| JScrollPane scrollBar = new JScrollPane(screenArea); | |
| GUIwindow() | |
| { | |
| setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); | |
| setSize(500,800); | |
| setTitle("Title here"); | |
| setLocationRelativeTo(null); | |
| screenArea.setLineWrap(true); | |
| screenArea.setEditable(true); | |
| grid.add(scrollBar); | |
| add(grid); | |
| setVisible(true); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment