I am adding a bunch of JInternalFrames into a JDesktopPane, as the user selects to open various features through the menus. But I would like the in
JInternalFrame
JDesktopPane
Add this void
public void addCentered(Component jif) { desktopPane.add(jif); jif.setLocation((desktopPane.getWidth()-jif.getWidth())/2, (desktopPane.getHeight()-jif.getHeight())/2); jif.setVisible(true); }
and when adding the jInternalFrame call:
addCentered(jifName);