Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #19831

JComboBox model doesn't allow to add or remove

Newsgroups comp.lang.java.programmer
Date 2012-11-21 00:58 -0800
Message-ID <14c15e6e-6d2e-4555-811e-47ca3a7532f9@googlegroups.com> (permalink)
Subject JComboBox model doesn't allow to add or remove
From Rotariu Mihai <rotariu.mihai7@gmail.com>

Show all headers | View raw


public void keyPressed(KeyEvent e) {

						String ip = (String) jComboBox1.getEditor().getItem();
						int key = e.getKeyCode();

						if (key == KeyEvent.VK_ENTER) {

							if (ip == null || ip.trim().isEmpty()) {
								jComboBox1.setSelectedItem("Please insert a keyword!");
							} else {

								if (jRadioButton1.isSelected()) {

									model.removeAllElements();
								}
							}
						}
					}

Back to comp.lang.java.programmer | Previous | NextNext in thread | Find similar | Unroll thread


Thread

JComboBox model doesn't allow to add or remove Rotariu Mihai <rotariu.mihai7@gmail.com> - 2012-11-21 00:58 -0800
  Re: JComboBox model doesn't allow to add or remove Rotariu Mihai <rotariu.mihai7@gmail.com> - 2012-11-21 01:06 -0800

csiph-web