Forum İçeriği > Çekirdek Java > set text
|
|
Emrah Kahraman E - Hero 25 ay önce
Aktivite Puanı: 28
tam olarak ne yapmak ıstedıgınızı anlamadım açar mısınız ?
|
|
|
Kamil ÖRS 25 ay önce
Aktivite Puanı: 8
label set etmek derken sanırım combobox'a nasıl değer ekleyebilirim demek
istiyorsunuz ? JComboBox jComboBox1 = new JComboBox(); DefaultComboBoxModel
model = new DefaultComboBoxModel(); model.addElement("Item 1");
model.addElement("Item 2"); model.addElement("Item 3");
jComboBox1.setModel(model);
|
|
|
burcu_kabakci 25 ay önce
Aktivite Puanı: 10
hayır. combo box tan bir değer sececeğim ve onu labelda acıklam olarak
gösterceğim yani değer değiştikçe açıklamada değişecek?
|
|
|
Emrah Kahraman E - Hero 25 ay önce
Aktivite Puanı: 28
JComboBox jComboBox1 = new JComboBox(); JLabel JLabel1=new JLabel();
jComboBox1.addItem("emrah"); jComboBox1.addItem("kahraman");
jComboBox1.addItemListener(new java.awt.event.ItemListener() { public void
itemStateChanged(java.awt.event.ItemEvent e) { String str=jComboBox1
.getSelectedItem().toString(); JLabel1.setText(str);
|
|
|
Kamil ÖRS 25 ay önce
Aktivite Puanı: 8
jComboBox1.addActionListener(new ActionListener() { public void
actionPerformed(ActionEvent evt) {
jLabel1.setText(jComboBox1.getSelectedItem()); } });
|
|
|
ethemsulan 25 ay önce
Aktivite Puanı: 151
http://www.ethemsulan.com/2010/01/jcombobox-additemlisteneritemstatechang.html
|
Aktivite Puanı: 10