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 MainClass.java

public class MainClass extends JPanel {

    public static void main(String[] a) {
        JFrame f = new JFrame();
        f.setSize(400, 400);
        f.add(new MainClass());

From source file MainClass.java

public class MainClass extends JPanel {

    public static void main(String[] a) {
        JFrame f = new JFrame();
        f.setSize(400, 400);
        f.add(new MainClass());

From source file Main.java

public class Main extends JPanel {

    public void paint(Graphics g) {

        g.fillRoundRect(150, 50, 100, 100, 50, 25);

From source file Main.java

public class Main extends JPanel {

    public void paint(Graphics g) {
        byte[] barray = { 0x41, 0x42, 0x43 };

        g.drawBytes(barray, 0, barray.length, 10, 30);

From source file Main.java

public class Main extends JPanel {

    public void paint(Graphics g) {
        char[] carray = { 'w', 'w', 'w', '.', 'j', 'a', 'v', 'a', '2', 's', '.', 'c', 'o', 'm' };

        g.drawChars(carray, 0, carray.length, 10, 60);

From source file Main.java

public class Main extends JPanel {

    public void paint(Graphics g) {
        g.setColor(Color.RED);
        g.clearRect(0, 0, 100, 100);

From source file Main.java

public class Main extends JPanel {

    public void paint(Graphics g) {
        g.setColor(Color.red);
        g.drawRect(0, 0, 100, 100);
        g.clipRect(25, 25, 50, 50);

From source file Main.java

public class Main extends JPanel {
    public Main() {
    }

    public void paintComponent(Graphics g) {
        int width = getWidth();

From source file Main.java

public class Main extends JPanel {

    public void paint(Graphics g) {
        int fontSize = 20;

        g.setFont(new Font("TimesRoman", Font.PLAIN, fontSize));

From source file OvalPanelCanvas.java

public class OvalPanelCanvas extends JPanel {
    public OvalPanelCanvas() {
    }

    public void paintComponent(Graphics g) {
        int width = getWidth();