Any idea why my desktopPane doesn't show up?

here’s the code attached =)

		//////////////////////////////////////
		// Panel for Tile Game Area
		//////////////////////////////////////
		JPanel gamearea = new JPanel();
		gamearea.add(game);
		gamearea.addMouseListener(new MouseAdapter() {
		      public void mouseEntered(MouseEvent e) {
		    	  game.requestFocus(true); // also try adding the param 'true'
		      }
		 });
		//////////////////////////////////////
		// Panel for UserList and Login Button
		//////////////////////////////////////
		JPanel userlistPane = new JPanel();
		userList = new JList(new DefaultListModel());
        userList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
        userList.addMouseListener(new MouseAdapter() {
            public void mouseClicked(MouseEvent evt) {
                if (evt.getClickCount() > 1) {
                    BYTEARRAY ba = (BYTEARRAY) userList.getSelectedValue();
                    if (ba != null) {
                        String message = JOptionPane.showInputDialog(
                                Login.this, "Enter private message:");
                        doDCCMessage(ba.data(), message);
                    }
                }
            }
        });
        userList.setCellRenderer(new ListCellRenderer() {
            JLabel text = new JLabel();
            public Component getListCellRendererComponent(JList arg0,
                    Object arg1, int arg2, boolean arg3, boolean arg4) {
                byte[] data = ((BYTEARRAY) arg1).data();
                text.setText(StringUtils.bytesToHex(data,0,data.length>4?4:data.length));
                return text;
            }
        });
        userlistPane.setLayout(new BorderLayout(1,2));
        userlistPane.add(new JScrollPane(userList));
        login.setSize(100, 200);
        userlistPane.add(login, BorderLayout.SOUTH);
		userlistPane.setBackground(Color.gray);
		
        
        
		//////////////////////////////////////
		// Main Panel for Adding other Panels
		//////////////////////////////////////
		//JPanel c = new JPanel();
		Container c = getContentPane();
        c.setLayout(new BoxLayout(c, BoxLayout.X_AXIS));
        //c.setLayout(new BorderLayout());
        c.setBackground(Color.gray);
        //desktop = new JDesktopPane();
        c.add(desktop, BorderLayout.CENTER);
        c.add(gamearea, BorderLayout.CENTER);
        c.add(userlistPane, BorderLayout.EAST);

        c.setSize(600, 400);
        //... Set window characteristics
        //setContentPane(c);
        //setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setTitle("Game");
        c.setVisible(true);
        pack();

try calling setVisible on Frame instead of the panel.


 c.setVisible(true); -> setVisible(true);

also you might want to pack(); first and then display it as it will be faster.

on a differend note, blocks like

//////////////////////////////
// bla
//////////////////////////////

is an indicator for me that someone is using ide’s from the stoneage or no ide at all. That or your profiding support for those still on B/W monitors.
(next to the whole discussion that inline comments might be bad to begin with)

setting the sarcasm aside, in this case I’d would stick stuff in separate methods reguardless.

like:

protected JPanel createGameArea() {
  JPanel gameArea = new JPanel();
  gameArea.add(game);
  gameArea.addMouseListener(new MouseAdapter() {
    public void mouseEntered(MouseEvent e) {
      game.requestFocus(true); // also try adding the param 'true'
    }
  });
  return gameArea;
}

oh ok thanks for the reply as for the comments

i just want to spilt the comments bigger well for my own reference will be changing soon

and also for my teammate to find the codes

anyway thanks for your help and tips

i still can’t get the destopPane to pop up , i am jus going to try out more ways

anyway solved it by using jFrame thanks

any one has idea on how to make a certain JPanel focus in a container?

of the top of my head requestFocusInWindow();

in my reply I presumed you where using a JFrame, if I may ask what where you using before then?

was using JdesktopPane to call JInternalFrame

thanks

tried requestFocusInWindow(); doesn’t work ;