Banging my head against the window
No matter what I do, I have no control over the size of child windows. This is pretty simple, but it's ignoring me totally. Here's what I've got:
// The container stuff seems to work fine. I'll include it here in case I've done something stupid in it that's affecting the child classes.
public class MainFrame extends JFrame
{
protected JDesktopFrame m_desktop;
protected JPanel m_panel;
MainFrame()
{
m_panel = new JPanel();
m_panel.setLayout(new BorderLayout());
this.setContentPane(m_panel);
m_desktop = new JDesktopPane();
m_desktop.setDesktopManager(new DefaultDesktopManager());
m_panel.add(m_desktop);
}
public void AddChildWindow()
{
MyChild child = new MyChild();
child.setVisible(true);
m_desktop.add(child);
}
}
public class MyChild extends JInternalFrame
{
private JPanel m_panel;
private JScrollPane m_scrollPane;
private JButton m_button;
public MyChild()
{
super("Title here", true, true, true, true);
m_panel = new JPanel();
m_scrollPane = new JScrollPane();
m_button = new JButton();
this.setContentPane(m_panel);
m_panel.add(m_scrollPane);
m_scrollPane.add(m_button);
m_button.setsize(200,200);
m_button.setText("This button is very very tiny for some reason.");
}
}
What I need is the ability to add a single control to this child window (a JTable, if you must know), and be able to move the window around, and resize it, and see the control. If the control is larger than the window, I need to be able to scroll.
What am I missing? I've tried lots of setSize() methods on stuff, and things like various LayoutManagers at different points, but nothing seems to make any difference. All I see is a child window with a single, tiny button, and if I resize it, it snaps back to tiny. Moving it around doesn't make it stick, either.
Any help, hints, or examples are VERY appreciated!
Eric

