Playlist
• Java Frontend
2023 05 24 15 20 47
import java.awt.FlowLayout;
import java.awt.Panel;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JSplitPane;
public class splitpane {
private static void creatAndShow() {
final JFrame ff = new JFrame("example of JSplitPane");
ff.setSize(400, 400);
ff.setVisible(true);
ff.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// set up flow layout for the frame
ff.getContentPane().setLayout(new FlowLayout());
String[] option1 = {
"Aa", "Bb", "Cc", "Dd", "Ee"
};
JComboBox box111 = new JComboBox(option1);
String[] option22 = {
"11", "22", "33", "44", "55"
};
JComboBox box222 = new JComboBox(option22);
Panel panel111 = new Panel();
panel111.add(box111);
Panel panel222 = new Panel();
panel222.add(box222);
JSplitPane splitPane = new JSplitPane(
JSplitPane.VERTICAL_SPLIT, panel111, panel222
);
ff.getContentPane().add(splitPane);
}
public static void main(String[] args) {
javax.swing.SwingUtilities.invokeLater(new Runnable(){
@Override
public void run() {
creatAndShow();
}
});
}
}
On this page of the site you can watch the video online Java Swing: JSplitPane with a duration of hours minute second in good quality, which was uploaded by the user Le Hoang Long Long 24 May 2023, share the link with friends and acquaintances, this video has already been watched 73 times on youtube and it was liked by 1 viewers. Enjoy your viewing!