Guest User

Untitled

a guest
Jun 25th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. public static void AddObject(String type /* Available types: IMG and TXT */, int windowID /* get which window this object has to be added to */, Dimension position /* locate where we should place our object */, String txt /* text */) {
  2.  
  3. JFrame frame = (JFrame) JFrame.getFrames()[windowID];
  4.  
  5. JLabel emptyLabel = new JLabel(txt);
  6. emptyLabel.setPreferredSize(position);
  7. frame.getContentPane().add(emptyLabel, BorderLayout.CENTER);
  8. frame.pack();
  9. System.out.println("[JGL2D] Success in the making of an " + type + " object");
  10. }
Add Comment
Please, Sign In to add comment