hi

how would i add the following code to the end of the JFrame, as at the top I have three JMenu and in middle nothing : -

JLabel label = new JLabel("My Status");
	
	JComboBox mycom = new JComboBox();
	mycom.addItem("Online");
	mycom.addItem("Busy");
	mycom.addItem("Away");

thanks

Recommended Answers

All 3 Replies

I'm not sure what you're saying. Are you talking something like a status bar? If you simply want it at very bottom of the frame, then put it all in a JPanel and then use the BorderLayout.CENTER swing constant.

hi

you knw im doing this instant chat system when user is logged in then there would be jmenus at the top, a space to show who is online(im not sure what to put) and at bottom i want the jlabel and comboboxes. but for some reason the code above is not even displayed in the jframe.

well, your code doesn't add the combobox or the label to anything so it wouldn't be displayed.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.