Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- java swing paint on another class
- public class MainInterface(){
- static JPanel drawBox = new JPanel;
- public MainInterface(){
- drawBox.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.RAISED));
- drawBox.setLayout(null);
- }
- }
- public class PainterClass(){
- public void paint(Graphics g){
- MainInterface.drawBox.paint(g);
- g.drawRect(100,100,100,100);
- }
- }
Add Comment
Please, Sign In to add comment