Guest User

Untitled

a guest
Aug 14th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. java swing paint on another class
  2. public class MainInterface(){
  3. static JPanel drawBox = new JPanel;
  4. public MainInterface(){
  5. drawBox.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.RAISED));
  6. drawBox.setLayout(null);
  7. }
  8. }
  9.  
  10. public class PainterClass(){
  11. public void paint(Graphics g){
  12. MainInterface.drawBox.paint(g);
  13. g.drawRect(100,100,100,100);
  14. }
  15. }
Add Comment
Please, Sign In to add comment