ok, sorry
here is the (trimmed) code that doesn't work.
I want to see the buttons and labels created in
MenuUI in my applet window (QbusMenu).
// QbusMenu
import java.net.*;
import javax.swing.*;
import java.awt.*;
public class QbusMenu extends JApplet {
MenuUI menuUI;
public void init(){
try {
System.out.println("INIT1");
menuUI = new MenuUI();
this.getContentPane().setLayout( new
BorderLayout() );
this.getContentPane().add(menuUI.getThePanel() );
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
}
// the called class MenuUI
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class MenuUI { //javax.swing.JFrame {
protected JLabel titleLabel = new JLabel("TEST");
protected JButton panelButtons = new JButton();
protected JButton menuButtons = new JButton();
private JPanel thisUI = new JPanel();
public void MenuUI() {
System.out.println("INIT2");
MenuUI("QBUS", 3, 3, 1, 8);
}
public void MenuUI(String title, int
panelButtonRowCount, int panelButtonColCount, int
menuButtonRowCount, int menuButtonColCount) {
// arguments aren't used for this example
try{
System.out.println("INIT2");
thisUI.setLayout( new BorderLayout() );
thisUI.add(titleLabel, BorderLayout.NORTH);
thisUI.add(panelButtons,
BorderLayout.CENTER);
thisUI.add(menuButtons, BorderLayout.SOUTH);
// panel end
thisUI.setSize( 240, 240);
} catch (Exception e)
{}
}
public JPanel getThePanel() {
return thisUI;
}
public void init() {
System.out.println("INIT");
}
}