Add Button Group in WAD

Hi All,
I am working in BI 7.0. I am trying to create a new web template using WAD,
but i am not finding a command button(push button) group in the library.
Kindly help me to add a button group.
Regards,
Sheeba Rani

Hi rani,
   according to  your answer.. i think  you are still using 3.X web application  designer.. only..  in  3.x WAD  you wont get  that button group web item..
  here i'm giving one link.. you just go thru that.. because 7.0 web application designer means. you will get  all the    web items..  same in this link..
http://help.sap.com/saphelp_nw2004s/helpdata/en/83/54973910a9bc12e10000000a114084/frameset.htm
  based on this you can check your  patch...  and  contact to ur BASIS   people..
if it helpful to u.. plz ASSIGN POINTS
regrads
@jay

Similar Messages

  • Variable pop-up using Button Group in WAD

    Hi experts,
    I've created a button group in WAD to execute a 'Copy' function developed in IP.
    This copy function has the following variables:
    Order From:
    Order To:
    Version From:
    Version To:
    This button group was created as it should referencing my copy function, with a dataprovider of type filter, and under 'Behavior' I have flagged the ' Display variable screen' field.
    So when I click on this button, it should give me a pop-up screen for me to enter those variable values.
    The problem is, it's not giving me this pop-up screen. Does anyone know why? Or if I've missed something.
    thanks
    Edited by: Ehab Mansour on Feb 28, 2008 10:48 AM

    Hi Maykan,
    I will give that a try, and let you know how it worked out.
    By the way, are you aware of any 'WAD' specific documentation that provied details and more WAD capabilities?
    thanks

  • WAD: Add variable to a called javascript function on button group item

    Hi All,
    I need your expertise regarding the following problem:
    To increase performance, I've decided to hide all analysis tables. To set these tables to visible, there is a button to switch the state for each table.
    Because this function is needed for each table, the function has two parameters for the analysis item name and the new state.
    Unfortunately, I get an useless error message after calling the function.
    The function in script item looks like
    function switchTable(itemName, newState)
    The function is started by a button of a button group item as javascript and the following script function
    switchTable('ANALYSIS_ITEM_1', 'VISIBLE')
    If I enter a without parameters, that will call the function with these parameters, it works.
    But if i try this directly from the script function in the button parameters, the function will be called correctly, but an error occurs and the analysis item wasn't displayed or the sendCommand wasn't processed completely.
    I hope there is a way to call javascripts by a button with variables, otherwise I would have to create many functions with only an other item_ref.
    Many thanks in advance and points of course for any help.
    Regards,
    Tobias

    One short note:
    It's possible to trigger the same function by an html input form button with onlick switchTable('ANALYSIS_ITEM_1', 'VISIBLE')
    and this works.
    Has anyone an idea what's the problem with a normal button item of the button group item?
    Another possibility is a menu item. The functions were called, but errors were shown.

  • WAD Button Group

    Hi All,
    I am doing some WAD report. In that report i am using Button Group. While changing the button group properties after assigning some action (In the WAD Button group ->Properties->Action Command ->Edit Command->Commands for web Template-> Export Web Application)  "Next" button is not getting activated.
    What is the reason, Please let me know.
    Thanks in advance,
    S.Murthy

    Hi Aduri,
    Yes, I am using WAD 7.0. I did like that only. i clicked on each button in the properities after that Edit Parmeter window then Edit Command -> Export web application
    then, "Next" button is not getting activated.
    Any reasons please let me know.
    Thanks,
    Satya

  • Adding a custom button to the Builtin Button Group of an MVToolbar object.

    I suspect this is not possible, however, I would like to add a custom button to the built-in button group of an MVToolBar object. I have attempted to do this with the following code:
    // Create an array of the built-in buttons I require
    var toolArry = new Array();
    toolArry.push(MVToolBar.BUILTIN_CIRCLE);
    toolArry.push(MVToolBar.BUILTIN_RECTANGLE);
    toolArry.push(MVToolBar.BUILTIN_REDLINE);
    // Create the MVToolBar object using the array items created above
    createLocToolBar = new MVToolBar("createLocShapes",toolArry,MVToolBar.HORIZONTAL);
    // Add the Toolbar to the map view object
    mapview.addToolBar(createLocToolBar);
    // Create the required custom button
    createLineBtn = new MVToolButton("createLine",MVToolButton.TOGGLE,"/i/blue_arrow_down.gif","/i/blue_arrow_up.gif");
    // Attempt to add the custom button to the built-in toolbar
    createLocToolBar.getBuiltInButtonGroup().add(createLineBtn);
    Upon running the above script, the built-in buttons I've defined in the array are displayed as expected, but the custom button does not appear (no errors are displayed either).
    If I comment out the above line and instead include the line below, the custom button is displayed, but of course this is not part of the built-in group.
    createLocToolBar.addButton(createLineBtn);
    Any assistance greatly appreciated,
    JR

    Thanks for the reply, Michael. I understand that the Login.jsp needs to be modified and redeployed, but the question is how to create a new button with the same look and feel as the Login button. Currently we have modified the Login.jsp with a "Forgot Password" html link, but it would be prefered to create a button to match what already exists. I understand that this might be outside the scope of this forum, but I was hoping that someone that has done this (specifically the original poster if he found a solution) could share the relevent code.

  • How to pass characterstic variable value using button in sap wad

    Hello Gurus,
    I have one requirement in WAD 7.0.i have made one user input characterstic variable in Bex i.e on 0calmonth.Now i have passed the same variable in WAD drop down button.Now suppose based on the logic on that variable which i have made in bex is like when i select 04.2010 in drop down button it dispalys data for next three months.
    Now my user wants same thing to be displayed with the help of button as well. I need to make two buttons one for previous month and other for next month.I made two button using button group and passed that variable also but data is not changing.
    How to get the desired output using buttons.
    I want two buttons like this <<(previous) >>(next) and i want to pass that same variable which i passed in drop down button and when i press previous button it should display last month data and when i press next it should display next month data.
    How to achieve this in WAD with the help of buttons.Give me your useful suggestions.
    Hope my requirement is clear.
    Thanks in advance
    Regards,
    AL

    Need your valuable suggestions on this...

  • Multiple button groups

    Hey everyone I am writing a program that contains 2 button groups(of radio buttons) and I am try to set a different value of Height for every height, and either the gender of male or female. But i can't get the getActionCommand to work with it. I don't know how to make it select one button for each group here is my code.
    import java.awt.* ;
    import java.awt.event.*;
    import javax.swing.*;
    public class IdealWeightCalculator extends JFrame implements ActionListener
      JRadioButton genderM, genderF;
      ButtonGroup  genderGroup;
      JPanel       genderPanel;
      JRadioButton heightA, heightB, heightC, heightD, heightE;
      ButtonGroup  heightGroup;
      JPanel       heightPanel;
      JTextField   resultText;
      JLabel       resultLabl;
      JPanel       resultPanel;
      double W,H;
      public IdealWeightCalculator() 
        setTitle( "Your Ideal Weight" );
        setDefaultCloseOperation( EXIT_ON_CLOSE );
        // gender group
        genderM = new JRadioButton("Male", true );
        genderF = new JRadioButton("Female", false );
        genderGroup = new ButtonGroup();
        genderGroup.add( genderM );  genderGroup.add( genderF );
        genderPanel = new JPanel();
        genderPanel.setLayout(
            new BoxLayout( genderPanel, BoxLayout.Y_AXIS ) );
        genderPanel.add( new JLabel("Your Gender") );
        genderPanel.add( genderM );  genderPanel.add( genderF );
        // height group
        heightA = new JRadioButton("60 to 64 inches", true  );
        heightB = new JRadioButton("64 to 68 inches", false );
        heightC = new JRadioButton("68 to 72 inches", false );
        heightD = new JRadioButton("72 to 76 inches", false );
        heightE = new JRadioButton("76 to 80 inches", false );
        heightGroup = new ButtonGroup();
        heightGroup.add( heightA ); heightGroup.add( heightB );
        heightGroup.add( heightC ); heightGroup.add( heightD );
        heightGroup.add( heightE );
        heightPanel = new JPanel();
        heightPanel.setLayout(
            new BoxLayout( heightPanel, BoxLayout.Y_AXIS ) );
        heightPanel.add( new JLabel("Your Height") );
        heightPanel.add( heightA ); heightPanel.add( heightB );
        heightPanel.add( heightC ); heightPanel.add( heightD );
        heightPanel.add( heightE );
        // result panel
        resultText  = new JTextField(7);
        resultText.setEditable( false );  
        resultLabl  = new JLabel("Ideal Weight");
        resultPanel = new JPanel();
        resultPanel.add( resultLabl );
        resultPanel.add( resultText );
        // content pane
        getContentPane().setLayout( new BorderLayout() );
        getContentPane().add( genderPanel, BorderLayout.WEST );
        getContentPane().add( heightPanel, BorderLayout.EAST );
        getContentPane().add( resultPanel, BorderLayout.SOUTH  );
        genderM.setActionCommand("male");
        genderF.setActionCommand("female");
        heightA.setActionCommand("1");
        heightB.setActionCommand("2");
        heightC.setActionCommand("3");
        heightD.setActionCommand("4");
        heightE.setActionCommand("5");
        genderM.addActionListener( this );
        genderF.addActionListener( this );
        heightA.addActionListener( this );
        heightB.addActionListener( this );
        heightC.addActionListener( this );
        heightD.addActionListener( this );
        heightE.addActionListener( this );
    public void malecalc(){
         W=(H*H)/28;
    public void femalecalc(){
         W=(H*H)/30;
    public void actionPerformed( ActionEvent evt) 
           /*if (evt.getActionCommand().equals("male")){
                if (evt.getActionCommand().equals("1")){
                     H=62;
                     malecalc();
           if (evt.getActionCommand().equals("male")){
                if(evt.getActionCommand().equals("1")){
                     H=62;
                     malecalc();
                else if (evt.getActionCommand().equals("2")){
                     H=66;
                     malecalc();
                else if (evt.getActionCommand().equals("3")){
                     H=70;
                     malecalc();     
                else if (evt.getActionCommand().equals("4")){
                     H=74;
                     malecalc();     
                else if (evt.getActionCommand().equals("5")) {
                     H=78;
                     malecalc();     
           else if (evt.getActionCommand().equals("female")){
                if(evt.getActionCommand().equals("1")){
                     H=62;
                     femalecalc();
                else if (evt.getActionCommand().equals("2")){
                     H=66;
                     femalecalc();
                else if (evt.getActionCommand().equals("3")){
                     H=70;
                     femalecalc();
                else if (evt.getActionCommand().equals("4")){
                     H=74;
                     femalecalc();     
                else if (evt.getActionCommand().equals("5")) {
                     H=78;
                     femalecalc();     
           resultText.setText( (W+"      ")  );
        repaint();                 
      public static void main ( String[] args )
        IdealWeightCalculator weightApp  = new IdealWeightCalculator() ;
        weightApp.setSize( 250, 225 );  
        weightApp.setVisible( true );       
    }

    solved it myself

  • Form UIBB: Radio Button Group: How to set default value?

    Hello,
    i've added a Radio Button Group in Forum UIBB (FPM_FORM_UIBB) with 3 possible values. How can I set the default value for this group? When starting the application, no radio button is selected..
    Thanks & Regards
    Christopher

    Hi Christopher,
    i've the same requiremnt for adding a Radio Button Group and 3 Radio buttons under it in Forum UIBB (FPM_FORM_UIBB) with 4 possible values..
    I have added 3 custom fields for 3 Radio buttons in the structure. In the desin time, I have added these 3 fields and taken as Radion button Group. But, Only label is coming on the output...
    I totally stuck here. Can you please guide me on this in details as to how to add the Radio buttons and how its action can be handled?
    It's bit urgent for me.
    Thanks in advance,
    Sumesh 

  • Controlling buttons in a button group.. Help!

    The code below works to some extent, and i am looking for some help to fix it up properly. Basically, once A is selected i want to prevent the possibility of setting B or C, and if B or C is selected, i want to prevent the ability to select A... i will appreciate a quick response.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.table.*;
    import javax.swing.JRadioButton;
    public class JRadioButtonTableExample2 extends javax.swing.JFrame {
         public JRadioButtonTableExample2() {
              super("JRadioButtonTable Example");
              DefaultTableModel dm = new DefaultTableModel(new Object[][]{{"1", new Integer(-1)},
                                                                                         {"2", new Integer(-1)},
                                                                                         {"3", new Integer(0)},
                                                                                         {"4", new Integer(1)},
                                                                                         {"5", new Integer(2)}},
                                                                      new Object[]{"Question", "Answer"});
              JTable table = new JTable(dm);
              String[] answer = {"A", "B", "C"};
              table.getColumn("Answer").setCellRenderer(new RadioButtonRenderer(answer));
              table.getColumn("Answer").setCellEditor(new RadioButtonEditor(new RadioButtonPanel(answer)));
              setContentPane(new JScrollPane(table));
         // Cell base
         class RadioButtonPanel extends JPanel {
              private JRadioButton[] buttons;
              private JRadioButton noSelectionButton;
              RadioButtonPanel(String[] str) {
                   setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
                   buttons = new JRadioButton[str.length];
                   ButtonGroup group = new ButtonGroup();
                   noSelectionButton = new JRadioButton();
                   group.add(noSelectionButton);
                   for (int i = 0; i < buttons.length; i++) {
                        buttons[i] = new JRadioButton(str);
                        buttons[i].setFocusPainted(false);
                        add(buttons[i]);
                        group.add(buttons[i]);
              public void addActionListener(ActionListener anActionListener) {
                   for (int i = 0; i < buttons.length; i++) {
                        buttons[i].addActionListener(anActionListener);
              public void removeActionListener(ActionListener anActionListener) {
                   for (int i = 0; i < buttons.length; i++) {
                        buttons[i].removeActionListener(anActionListener);
              public void setSelectedIndex(int index) {
                   if (index < 0 || index >= buttons.length) {
                        noSelectionButton.setSelected(true);
                        return;
                   for (int i = 0; i < buttons.length; i++) {
                        if (i == index) {
                   if((index == 1 || index == 2) && buttons[0].isSelected()){
                   buttons[0].setSelected(true);
                        return;
                        else if(index == 0 && buttons[1].isSelected()){
                        buttons[1].setSelected(true);
                        return;
                        else if(index == 0 && buttons[2].isSelected()){
                        buttons[2].setSelected(true);
                        return;
                        else{
                             buttons[i].setSelected(true);
                             return;
              public int getSelectedIndex() {
                   for (int i = 0; i < buttons.length; i++) {
                        if (buttons[i].isSelected()) {
                             return i;
                   return -1;
              public JRadioButton[] getButtons() {
                   return buttons;
         class RadioButtonRenderer extends RadioButtonPanel implements TableCellRenderer {
              RadioButtonRenderer(String[] strs) {
                   super(strs);
              public Component getTableCellRendererComponent(JTable table,
                                                                     Object value, boolean isSelected, boolean hasFocus, int row,
                                                                     int column) {
                   if (value instanceof Integer) {
                        setSelectedIndex(((Integer)value).intValue());
                   return this;
         class RadioButtonEditor extends AbstractCellEditor implements TableCellEditor, ActionListener {
              private RadioButtonPanel theRadioButtonPanel;
              public RadioButtonEditor(RadioButtonPanel aRadioButtonPanel) {
                   theRadioButtonPanel = aRadioButtonPanel;
                   theRadioButtonPanel.addActionListener(this);
              public Component getTableCellEditorComponent(JTable table,
                                                                     Object value, boolean isSelected, int row, int column) {
                   if (value instanceof Integer) {
                        theRadioButtonPanel.setSelectedIndex(((Integer) value).intValue());
                   return theRadioButtonPanel;
              public Object getCellEditorValue() {
                   return new Integer(theRadioButtonPanel.getSelectedIndex());
              public void actionPerformed(ActionEvent e) {
                   fireEditingStopped();
         public static void main(String[] args) {
              JRadioButtonTableExample2 frame = new JRadioButtonTableExample2();
              frame.addWindowListener(new WindowAdapter() {
                   public void windowClosing(WindowEvent e) {
                        System.exit(0);
              frame.setSize(230, 140);
              frame.setVisible(true);

    I have tried to implement your suggestion below, but i still appear to be having problems with instability. In some cases, i when i click on one button all the other buttons get disabled...
         class RadioButtonPanel extends JPanel {
              private JRadioButton[] buttons;
              private JRadioButton noSelectionButton;
              RadioButtonPanel(String[] str) {
                   setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
                   buttons = new JRadioButton[str.length];
                   ButtonGroup group = new ButtonGroup();
                   noSelectionButton = new JRadioButton();
                   group.add(noSelectionButton);
                   for (int i = 0; i < buttons.length; i++) {
                        buttons[i] = new JRadioButton(str);
                        buttons[i].setFocusPainted(false);
                        add(buttons[i]);
                        group.add(buttons[i]);
              public void addActionListener(ActionListener anActionListener) {
                   for (int i = 0; i < buttons.length; i++) {
                        buttons[i].addActionListener(anActionListener);
              public void removeActionListener(ActionListener anActionListener) {
                   for (int i = 0; i < buttons.length; i++) {
                        buttons[i].removeActionListener(anActionListener);
         public void setSelectedIndex(int index) {
              if (index < 0 || index >= buttons.length) {
              noSelectionButton.setSelected(true);
              return;
              if (index == 0) {
              if (rowNumber != -1 && tableModel.getValueAt(rowNumber, 3) != null)
              buttons[0].setSelected(true);
              buttons[1].setEnabled(false);
              buttons[2].setEnabled(false);
         return;
                   else if (index == 1) {
                   buttons[1].setSelected(true);
                   buttons[0].setEnabled(false);
                   return;
                   else if (index == 2) {
                   buttons[2].setSelected(true);
                   buttons[0].setEnabled(false);
                   return;
              public int getSelectedIndex() {
              for (int i = 0; i < buttons.length; i++) {
              if (buttons[i].isSelected()) {
                   return i;
                   return -1;
              public JRadioButton[] getButtons() {
                   return buttons;

  • Adding border to button group

    Hi,
    Is there a way to add border to a button group?
    Thanks.

    Button groups aren't physical, they're logical.
    Just throw all the buttons into a JPanel and put the border on the panel.

  • No radio validation on "add" button

    Hello all,
    I have a group of radio buttons, and a group of submit
    buttons. If the user clicks the "add" button, I don't want
    validation to be performed on the radios.
    One other thing: If user clicks "delete" button and a radio
    is selected, I would like user to see an "are you sure?" window or
    something, preferably an interactive error message like the
    validation message.
    Are these possible?
    My code is the basic 'what you see in the example' sort of
    thing. I am happy to post it if need be.
    Thanks,

    Hello all,
    I have a group of radio buttons, and a group of submit
    buttons. If the user clicks the "add" button, I don't want
    validation to be performed on the radios.
    One other thing: If user clicks "delete" button and a radio
    is selected, I would like user to see an "are you sure?" window or
    something, preferably an interactive error message like the
    validation message.
    Are these possible?
    My code is the basic 'what you see in the example' sort of
    thing. I am happy to post it if need be.
    Thanks,

  • Removing Buttons from Button Group

    Hi
    I am new to WAD 2004s, and am in the process of customising templates.
    I would like to remove some buttons from the button group, but so far the only way I can do this is to go in the XHTML and remove the code segments from there. Surely I should be able to do this from the layout view?
    Cheers,
    Andrew

    Hi,
    As Deepu says, in general everything is possible in the properties (you have to switch to "web item parameters" tab -> you will see all parameters for the web item.
    Regards, Karol Kalisz
    SAP NetWeaver BI Development

  • Dynamic creation of Radio Button Group

    Hi,
    I need to create a Radio Button Group dynamically and add Radio buttons to it.
    I am able to create the Radio buttons dynamically. Could someone help me how to create Radio Button Groups.
    I tried creating the Radio Button Group using the following code
                  DATA : lr_radiobuttongrp type REF TO CL_WD_RADIOBUTTON_GROUP_BY_IDX.
                  call method CL_WD_RADIOBUTTON_GROUP_BY_IDX=>NEW_RADIOBUTTON_GROUP_BY_IDX
                  EXPORTING
                    bind_texts = 'test'
                  RECEIVING
                    control = lr_radiobuttongrp.
                  cl_wd_matrix_head_data=>new_matrix_head_data( element = lr_radiobuttongrp ).
                  lr_container->add_child( lr_radiobuttongrp ).
    But when I run it I am geting a dump "subnode viewname.ME does not exist".
    Thanks,
    Suvarna.
    Edited by: Suvarna Chittor on Aug 12, 2008 12:10 PM

    what is 'test' in bind text parameter
    you should provide the name in Capitals along with the node name,
    if the node name is TEXTS and the context attribute under this node is TEXT then you have to pass
    TEXTS.TEXT
    also provide the VIEW parameter to the call
    Abhi
    Edited by: Abhimanyu Lagishetti on Aug 12, 2008 12:26 PM

  • Export of button groups

    I work with multiple libraries, I know how to export the keyword list and import it into a new library. Now, how do i export the whole list plus button groups in one shot so that it appears identical in the"edit buttons" hud?
    thanks again you guys are the best.

    You can save your button sets using the "Export" button in the "Edit Button Sets" panel. I am not sure how it will work in your Aperture 3 version. In Aperture 3.5.1 the Export panel forgets to add a file extension to the exported file. I need to add manually the file name extension ".plist" -  e.g. "Button Set.plist".
    This file can be imported to another Aperture library using the "Import" button in the "Edit Button Sets" panel.

  • Add data to the table in the database with the use of add button

    The name of my database is Socrates.
    The name of the table in the database is Employees
    I want to be able to add data to the database. i am presently working on the add button such that when i enter date into the textfield and press the add button it should automatically register in the table.
    The error upon compilation is with this line of code
    If (ae.getSource() == jbtnA)// it says that ";" is expected
    Below is the entire code
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Mainpage extends JFrame implements ActionListener
         JTextField jFirstName = new JTextField(15);
         JTextField jSurname = new JTextField(12);
         JTextField jCity = new JTextField(10);
         JTextField jCountry = new JTextField(12);
         JTextField jSSN = new JTextField(8);
         JLabel jFirstLab = new JLabel("First Name");
         JLabel jSurnameLab = new JLabel("Surname");
         JLabel jCityLab = new JLabel("City");
         JLabel jCountryLab = new JLabel("Country");
         JLabel jSSNLab = new JLabel("Social Security Number (SSN)");
         JButton jbtnA = new JButton ("Add");
         JButton jbtnPrv = new JButton ("Previous");
         JButton jbtnNt = new JButton ("Next");
         JButton jbtnDl= new JButton ("Delete");
         JButton jbtnSrch = new JButton ("Search");
         public Mainpage (String title)
              super (title);
              Container cont = getContentPane();
              JPanel pane1 = new JPanel();
              JPanel pane2 = new JPanel();
              JPanel pane3 = new JPanel();
              pane1.setLayout (new GridLayout (0,1));
              pane2.setLayout (new GridLayout(0,1));
              pane3.setLayout (new FlowLayout());
              pane1.add(jFirstLab);
              pane1.add(jSurnameLab);     
              pane1.add(jCityLab);
              pane1.add(jCountryLab);
              pane1.add(jSSNLab);
              pane2.add(jFirstName);
              pane2.add(jSurname);
              pane2.add(jCity);
              pane2.add(jCountry);
              pane2.add(jSSN);
              pane3.add(jbtnA);
              pane3.add(jbtnPrv);
              pane3.add(jbtnNt);
              pane3.add(jbtnDl);
              pane3.add(jbtnSrch);
              cont.add(pane1, BorderLayout.CENTER);
              cont.add(pane2, BorderLayout.LINE_END);
              cont.add(pane3, BorderLayout.SOUTH);
              jFirstName.addActionListener(this);
              jSurname.addActionListener(this);
              jCity.addActionListener(this);
              jCountry.addActionListener(this);
              jSSN.addActionListener(this);
              jbtnA.addActionListener(this);
              jbtnPrv.addActionListener(this);
              jbtnNt.addActionListener(this);
              jbtnDl.addActionListener(this);
              jbtnSrch.addActionListener(this);
              validate();
              setVisible(true);
              setDefaultCloseOperation(EXIT_ON_CLOSE);
              pack();
              setResizable(false);
         public void actionPerformed(ActionEvent ae)
                   If (ae.getSource() == jbtnA)
                                    fst = jFirstName.getText();
                        srn = jSurname.getText();
                        cty = jCity.getText();
                        cnty = jCountry.getText();
                        int sn =
    Interger.parseInt(jSSN.getText());
                                    String ad = "Insert into Employees
    (Firstname,Surname,City,Country,SSN)" +
    "values('"fst"','"srn"','"cty"','"cnty"','"sn"')";
                        Statement stmt = con.createStatment();
                        int rowcount = stmt.executeUpdate(ad);
                        JOptionPane.showMessageDialog("Your
    details have been registered");
                        Statement stmt = con.createStatment();
                        int rowcount = stmt.executeUpdate(ad);
    public static void main (String args[])
              Mainpage ObjFr = new Mainpage("Please fill this
    registration form");
              try
                   Class.forname("sun.jdbc.odbc.JdbcOdbcDriver");
                   String plato = "jdbc:odbc:socrates";
                   Connection con =
    DriverManager.getConnection(plato);
              catch(SQLException ce)
                   System.out.println(ce);
    }

    i have restructured the code, but the following line of code is giving error:
    String plato = jdbc:odbc:socrates;
    the entire code is below:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.sql.*;
    public class Mainpage extends JFrame implements ActionListener
         JTextField jFirstName = new JTextField(15);
         JTextField jSurname = new JTextField(12);
         JTextField jCity = new JTextField(10);
         JTextField jCountry = new JTextField(12);
         JTextField jSSN = new JTextField(8);
         JLabel jFirstLab = new JLabel("First Name");
         JLabel jSurnameLab = new JLabel("Surname");
         JLabel jCityLab = new JLabel("City");
         JLabel jCountryLab = new JLabel("Country");
         JLabel jSSNLab = new JLabel("Social Security Number (SSN)");
         JButton jbtnA = new JButton ("Add");
         JButton jbtnPrv = new JButton ("Previous");
         JButton jbtnNt = new JButton ("Next");
         JButton jbtnDl= new JButton ("Delete");
         JButton jbtnSrch = new JButton ("Search");
         Statement stmt;
            String ad;
            public Mainpage (String title)
              super (title);
              Container cont = getContentPane();
              JPanel pane1 = new JPanel();
              JPanel pane2 = new JPanel();
              JPanel pane3 = new JPanel();
              pane1.setLayout (new GridLayout (0,1));
              pane2.setLayout (new GridLayout(0,1));
              pane3.setLayout (new FlowLayout());
              pane1.add(jFirstLab);
              pane1.add(jSurnameLab);     
              pane1.add(jCityLab);
              pane1.add(jCountryLab);
              pane1.add(jSSNLab);
              pane2.add(jFirstName);
              pane2.add(jSurname);
              pane2.add(jCity);
              pane2.add(jCountry);
              pane2.add(jSSN);
              pane3.add(jbtnA);
              pane3.add(jbtnPrv);
              pane3.add(jbtnNt);
              pane3.add(jbtnDl);
              pane3.add(jbtnSrch);
              cont.add(pane1, BorderLayout.CENTER);
              cont.add(pane2, BorderLayout.LINE_END);
              cont.add(pane3, BorderLayout.SOUTH);
              jFirstName.addActionListener(this);
              jSurname.addActionListener(this);
              jCity.addActionListener(this);
              jCountry.addActionListener(this);
              jSSN.addActionListener(this);
              jbtnA.addActionListener(this);
              jbtnPrv.addActionListener(this);
              jbtnNt.addActionListener(this);
              jbtnDl.addActionListener(this);
              jbtnSrch.addActionListener(this);
              validate();
              setVisible(true);
              setDefaultCloseOperation(EXIT_ON_CLOSE);
              pack();
              setResizable(false);
              try
                   Class.forname(sun.jdbc.odbc.JdbcOdbcDriver);
                   String plato = jdbc:odbc:socrates;
                   Connection con = DriverManager.getConnection(plato);
                   stmt = con.createStatment();
              catch(SQLException ce)
                   System.out.println(ce);
              catch(ClassNotFoundException ce)
                   System.out.println(ce);
         public void actionPerformed(ActionEvent ae)
                   try
                        if(ae.getSource().equals(jbtnA))
                                         fst = jFirstName.getText();
                             srn = jSurname.getText();
                             cty = jCity.getText();
                             cnty = jCountry.getText();
                             int sn = Interger.parseInt(jSSN.getText());
                                         ad = "Insert into Employees
    values('"+fst+"',"+srn+"','"+cty+"','"+cnty+"','"+sn+"')";
                             stmt.executeUpdate(ad);
                             JOptionPane.showMessageDialog(this, "Your details have been
    registered");
                   catch(SQLException ce)
                        System.out.println(ce);
    public static void main(String args[])
              Mainpage ObjFr = new Mainpage("Please fill this registration form");
    }

Maybe you are looking for