source file name: chooserdemo.java import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.tree.*; class chooserdemo extends JFrame { JColorChooser jc=new JColorChooser(); public static void main(String as[]) { chooserdemo f=new chooserdemo(); f.setTitle("Color Chooser program"…
Read more
Showing posts from January, 2022Show all
14) Write a Java Swing program that changes background color of JList using ListSelectionEvent.
BySJN Programming
-
source file name: ListSelectEvent2.java import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; class ListSelectEvent2 extends JFrame implements ListSelectionListener { JList ls; Object ct; JLabel lbtxt; public ListSelectEvent2() { FlowLayout fl=new FlowLayout(); setLayout(f…
Read more13) Write a Swing java program of three Tabs Tree, Table and List using JTabbedPane.
BySJN Programming
-
source file name: tabdemo.java import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.tree.*; // class for tree tab class treedemo extends JPanel { JTree tr; JTextField t1; public treedemo() { BorderLayout bl=new BorderLayout(); setLayout(bl); t1=new JTextField(40); DefaultMutableTreeNod…
Read more