Example usage for javax.swing JPanel subclass-usage

List of usage examples for javax.swing JPanel subclass-usage

Introduction

In this page you can find the example usage for javax.swing JPanel subclass-usage.

Usage

From source file Main.java

public class Main extends JPanel {

    public void paint(Graphics g) {
        Graphics2D g2 = (Graphics2D) g;

        Rectangle r = new Rectangle(10, 10, 50, 40);

From source file Main.java

public class Main extends JPanel {
    public void paint(Graphics g) {
        g.fillRect(0, 0, 20, 20);

        Graphics2D g2 = (Graphics2D) g;

From source file Main.java

public class Main extends JPanel {
    public void paint(Graphics g) {
        g.fillRect(0, 0, 20, 20);

        Graphics2D g2 = (Graphics2D) g;

From source file Main.java

public class Main extends JPanel {

    public void paint(Graphics g) {
        Graphics2D g2 = (Graphics2D) g;

        Rectangle r = new Rectangle(10, 10, 50, 40);

From source file Main.java

public class Main extends JPanel {

    public void paint(Graphics g) {
        int w = getSize().width;
        int h = getSize().height;

From source file Rectangles.java

public class Rectangles extends JPanel {

    public void paintComponent(Graphics g) {
        super.paintComponent(g);
        Graphics2D g2d = (Graphics2D) g;

From source file Main.java

public class Main extends JPanel {

    public void paint(Graphics g) {
        Graphics2D g2 = (Graphics2D) g;

        Rectangle r = new Rectangle(10, 10, 50, 40);

From source file Main.java

public class Main extends JPanel {
    public void paint(Graphics g) {
        Graphics2D g2d = (Graphics2D) g;
        AffineTransform at = new AffineTransform();
        at.setToRotation(-Math.PI / 2.0, getWidth() / 2.0, getHeight() / 2.0);
        g2d.setTransform(at);

From source file MainClass.java

public class MainClass extends JPanel {

    public MainClass() {
        super(new GridLayout(2, 2));
        add(new JButton("w w w.j a v a 2 s . c o m"));
        add(new JButton("w w w.j a v a 2 s . com"));

From source file MainClass.java

public class MainClass extends JPanel {

    public MainClass() {
        super(new FlowLayout(FlowLayout.RIGHT, 10, 3));
        add(new JButton("w w w.j a v a 2 s . c o m"));
        add(new JButton("w w w.j a v a 2 s . com"));