Skip to content

Instantly share code, notes, and snippets.

@jrm2k6
Last active December 27, 2015 22:19
Show Gist options
  • Select an option

  • Save jrm2k6/7398128 to your computer and use it in GitHub Desktop.

Select an option

Save jrm2k6/7398128 to your computer and use it in GitHub Desktop.
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