Java combobox 📑

preview_player
Показать описание
Java, combobox, JComboBox, GUI, swing, tutorial, beginners,

#Java #combobox #JComboBox #GUI #swing #tutorial #beginners

//***********************************************
public class Main{

public static void main(String[] args) {

// JComboBox = A component that combines a button or editable field and a drop-down list

new MyFrame();

}
}
//***********************************************

public class MyFrame extends JFrame implements ActionListener{

JComboBox comboBox;

MyFrame(){

String[] animals = {"dog","cat","bird"};

comboBox = new JComboBox(animals);


}

@Override
public void actionPerformed(ActionEvent e) {
}
}
}
Рекомендации по теме
Комментарии
Автор


public class Main{

public static void main(String[] args) {

// JComboBox = A component that combines a button or editable field and a drop-down list

new MyFrame();

}
}

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class MyFrame extends JFrame implements ActionListener{

JComboBox comboBox;

MyFrame(){

this.setLayout(new FlowLayout());

String[] animals = {"dog", "cat", "bird"};

comboBox = new JComboBox(animals);




//comboBox.addItem("horse");
//comboBox.insertItemAt("pig", 0);


//comboBox.removeItemAt(0);
//comboBox.removeAllItems();

this.add(comboBox);
this.pack();
this.setVisible(true);
}

@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource()==comboBox) {


}
}
}

BroCodez
Автор

Hey Bro, I'm from Brazil and I want to thank you for all your videos about java. I have been learning a lot with BroCode channel. Thank you!

ricardocarvalho
Автор

Very clean explanation. It was really helpful for me, thanks ✓

K-tfph
Автор

i have become a good developer in java because your video are extra ordinaire, very claire:
thantyou bro, God bless you a lot

dupaulmpoyiart
Автор

I love your gui vidios they are so helpful

nonoco
Автор

Doing my Part to defeat the Algorithm.
Keep it up mate!!!

tristisludos
Автор

, best tutorials ever, good job bro code

hamza
Автор

Danke schon bruder. Your explanation was straight to the point and clear. Also thanks for the code.

sirekay
Автор

please do tutorial of jdbc also and make a project using Java Swing and JDBC

amanthakur
Автор

This is the best Java tutorial for beginners, so you can learn Java and English in one hit. Please keep going! I vote for Java advance tutorial. Thanks a lot Bro

pavelkvasnicka
Автор

Thank you very much for sharing this video, easy to understand.

chchong
Автор

420th like 😎
your videos really help bro! Thank you!

garrickreynolds
Автор

Subscribed. Please do more tut of Gui in java

twojaStara
Автор

Thank you very much for this video

very clear!

justinbanza
Автор

How to store user’s selection in a variable

oQuAdShto