1-) Java - YUKARDAKİNİN AYNISI LABELDE DİNAMİK //DİNAMİK COMBOBOX OLUŞTUR VE FRAMEDEKİ LABELİ ONUNLA YÖNET
public class label {
public static JFrame pen;
public label() {
pen = new JFrame();
pen.setLayout(new FlowLayout());
JComboBox combo = new JComboBox();
for (int i = 1; i <= 10; i++) {
combo.addItem(i); }
pen.add(combo);
JLabel label = new JLabel();
label.setText("Label");
pen.add(label);
combo.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
label.setText(combo.getSelectedItem().toString()); } });
pen.setBounds(0, 0, 640, 480);
pen.validate();
pen.setVisible(true);
}
public static void main(String[] args) {
new label(); }}