R.Practical 6th
R.Practical 6th
Practical No.6 : Write A Program Using Swing To Display A ScrollPane And JCombox In An JApplet
With The Items – English, Marathi, Hindi, Sanskrit .
Performed By – Vedant Nawade
CO5I – 44 ( Batch B )
_________________________________________________________________________________________________________________________________
X - PROGRAM CODE
Q1------------------------
------------------------------------------- PROGRAM CODE -----------------------------------------------------------
import javax.swing.*;
public class P6XCodeQ extends JFrame
{
P6XCodeQ()
{
String city[] = {"Mumbai","Solapur", " Pune", "Bangalore"};
JComboBox B = new JComboBox(city);
B.setBounds(50,50,90,20);
add(B);
setLayout(null);
setSize(500,500);
setVisible(true);
setTitle("Practical SIX (Program Code)");
}
public static void main (String args [])
{
P6XCodeQ p6 = new P6XCodeQ();
}
}
XIII – Exercise
Q1---------------
--------------------------------------------- PROGRAM CODE ---------------------------------------------------------
import javax.swing.*;
public class P6ExQ1 extends JFrame
{
P6ExQ1()
{
String states[] = {"Maharashtra","Gujarat", "Odisha",
"Karnataka","Rajasthan"};
JComboBox S = new JComboBox(states);
S.setBounds(50,50,90,20);
add(S);
setLayout(null);
setSize(500,500);
setVisible(true);
setTitle("Practical SIX (Program Code)");
}
public static void main (String args [])
{
P6ExQ1 P6Q1 = new P6ExQ1();
}
}