Hi friend,
I saw your code and modified. What you want to do please explain in detail.
package javacode;
import java.lang.*;
import java.awt.*;
import java.sql.*;
import java.awt.Color;
import java.awt.Container;
import java.awt.event.*;
import javax.swing.ButtonGroup;
import javax.swing.border.LineBorder;
import javax.swing.*;
public class Votec extends JFrame implements ActionListener{
Connection conn = null;
String url = "jdbc:
mysql://192.168.10.211:3306/";;
String db = "amar";
String driver = "com.mysql.jdbc.Driver";
String userName ="amar";
String password="amar123";
Statement st= null;
ResultSet rs = null;
Container con;
JPanel p1;
ImageIcon img1,img2,img3,img4,img5;
JLabel lb1,lb2,lb3,lb4,lb5,lb6;
JRadioButton r1,r2,r3,r4,r5;
ButtonGroup bg;
// MainMenu menu;
Votec(){
setLayout(null);
con=getContentPane();
setBounds(0,0,800,600);
setDefaultCloseOperation(EXIT_ON_CLOSE);
img1=new ImageIcon("/home/vinod/workspace/CodeDevelopment/javacode/images.jpg");
img2=new ImageIcon("f:\\Q1.jpg");
img3=new ImageIcon("f:\\jp.jpg");
img4=new ImageIcon("f:\\j2.gif");
img5=new ImageIcon("f:\\j3.gif");
p1=new JPanel();
con.add(p1);
p1.setLayout(null);
p1.setBounds(100,100,500,400);
p1.setVisible(true);
lb1=new JLabel(img1);
lb2=new JLabel(img2);
lb3=new JLabel(img3);
lb4=new JLabel(img4);
lb5=new JLabel(img5);
lb6=new JLabel("SELECT YOUR CHOICE FROM THE LIST BELOW");
p1.add(lb1);
p1.add(lb2);
p1.add(lb3);
p1.add(lb4);
p1.add(lb5);
p1.add(lb6);
p1.setBorder(new LineBorder(Color.BLACK));
bg=new ButtonGroup();
r1=new JRadioButton("ADMK");
r2=new JRadioButton("DMK");
r3=new JRadioButton("CONGRESS");
r4=new JRadioButton("BJP ");
r5=new JRadioButton("STUDENTS");
lb1.setBounds(200,100,100,50);
r1.setBounds(300,100,100,20);
lb2.setBounds(200,150,100,20);
r2.setBounds(300,150,100,20);
lb3.setBounds(200,200,100,20);
r3.setBounds(300,200,100,20);
lb4.setBounds(200,250,100,20);
r4.setBounds(300,250,100,20);
lb5.setBounds(200,300,100,20);
r5.setBounds(300,300,100,20);
lb6.setBounds(200,0,280,70);
p1.add(r1);
bg.add(r1);
p1.add(r2);
bg.add(r2);
p1.add(r3);
bg.add(r3);
p1.add(r4);
bg.add(r4);
p1.add(r5);
bg.add(r5);
setVisible(true);
r1.addActionListener(this);
r2.addActionListener(this);
r3.addActionListener(this);
r4.addActionListener(this);
r5.addActionListener(this);
}
public static void main(String args[]){
new Votec();
}