All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.spun.swing.PaintablePanel Maven / Gradle / Ivy

There is a newer version: 24.9.0
Show newest version
package com.spun.swing;

import javax.swing.JPanel;
import java.awt.Graphics;

public class PaintablePanel

extends JPanel { private final P paintable; public PaintablePanel(P paintable) { this.paintable = paintable; setPreferredSize(paintable.getSize()); paintable.registerRepaint(() -> this.repaint()); } @Override public void paint(Graphics g) { paintable.paint(g); } public P get() { return paintable; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy