Would like help with treeset ,the codes that using for sorting, please ?

hi every body. i faced a problem while writing this program, everything worked properly except this one. The program is related to Jframe and it asks the user to add three labels , three text field , one text area and three Jbuttons which are add sort and exit. i could deal with add and exit but sort, i couldn't do it properly because i don't know the codes that should be added in actionperfomed?
These codes are :
package gui;
import javax.swing.SwingUtilities;
import java.awt.BorderLayout;
import javax.swing.JPanel;
import javax.swing.JFrame;
import javax.swing.JLabel;
import java.awt.Rectangle;
import java.util.ArrayList;
import javax.swing.JButton;
import javax.swing.JTextField;
import javax.swing.JTextArea;
import sun.misc.Sort;
import domain.Student;
public class StudentFrame extends JFrame {
      * This method initializes btnAdd     
      * @return javax.swing.JButton     
     private JButton getBtnAdd() {
          if (btnAdd == null) {
               btnAdd = new JButton();
               btnAdd.setBounds(new Rectangle(13, 135, 59, 27));
               btnAdd.setText("Add");
               btnAdd.addActionListener(new java.awt.event.ActionListener() {
                    public void actionPerformed(java.awt.event.ActionEvent e) {
                    btnAddClicked(); // TODO Auto-generated Event stub actionPerformed()
          return btnAdd;
     protected void btnAddClicked() {
          // TODO Auto-generated method stub
     String name = txtName.getText();
     String id = txtID.getText();
     String age = txtAge.getText();
     Student s = new Student(name , id , age);
     txtArea.setText(String.valueOf(s ));
      * This method initializes btnSort     
      * @return javax.swing.JButton     
     private JButton getBtnSort() {
          if (btnSort == null) {
               btnSort = new JButton();
               btnSort.setBounds(new Rectangle(95, 136, 62, 25));
               btnSort.setText("Sort");
               btnSort.addActionListener(new java.awt.event.ActionListener() {
                    public void actionPerformed(java.awt.event.ActionEvent e) {
                         btnSortClicked(); // TODO Auto-generated Event stub actionPerformed()
          return btnSort;
     protected void btnSortClicked() {
          // TODO Auto-generated method stub
      * This method initializes btnExit     
      * @return javax.swing.JButton     
     private JButton getBtnExit() {
          if (btnExit == null) {
               btnExit = new JButton();
               btnExit.setBounds(new Rectangle(173, 134, 61, 23));
               btnExit.setText("Exit");
               btnExit.addActionListener(new java.awt.event.ActionListener() {
                    public void actionPerformed(java.awt.event.ActionEvent e) {
                         System.exit(0); // TODO Auto-generated Event stub actionPerformed()
          return btnExit;
      * This method initializes txtName     
      * @return javax.swing.JTextField     
     private JTextField getTxtName() {
          if (txtName == null) {
               txtName = new JTextField();
               txtName.setBounds(new Rectangle(79, 11, 60, 23));
          return txtName;
      * This method initializes txtID     
      * @return javax.swing.JTextField     
     private JTextField getTxtID() {
          if (txtID == null) {
               txtID = new JTextField();
               txtID.setBounds(new Rectangle(73, 55, 65, 26));
          return txtID;
      * This method initializes txtAge     
      * @return javax.swing.JTextField     
     private JTextField getTxtAge() {
          if (txtAge == null) {
               txtAge = new JTextField();
               txtAge.setBounds(new Rectangle(74, 96, 61, 24));
          return txtAge;
      * This method initializes txtArea     
      * @return javax.swing.JTextArea     
     private JTextArea getTxtArea() {
          if (txtArea == null) {
               txtArea = new JTextArea();
               txtArea.setBounds(new Rectangle(138, 5, 154, 128));
          return txtArea;
      * @param args
     public static void main(String[] args) {
          // TODO Auto-generated method stub
          SwingUtilities.invokeLater(new Runnable() {
               public void run() {
                    StudentFrame thisClass = new StudentFrame();
                    thisClass.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                    thisClass.setVisible(true);
      * This is the default constructor
     public StudentFrame() {
          super();
          initialize();
      * This method initializes this
      * @return void
     private void initialize() {
          this.setSize(300, 200);
          this.setContentPane(getJContentPane());
          this.setTitle("JFrame");
          return jContentPane;
}Edited by: hypocrisy on Apr 26, 2009 6:51 PM

There are three actionPerformed in that program.One for add Jbutton , Sort , and Exit
the codes that i have added for add button after action performed are
String name = txtName.getText();
String id = txtID.getText();
String age = txtAge.getText();
Student s = new Student ( name , id , age);
System.out.println(s);
the codes for Exit button to make it works properly was :
System.out.println(0);
But when i came to Sort Button and i tried to enter many codes but it didn't sort properly so would you like to help me with the right codes :)

Similar Messages

  • Hi i would like help with:  When I draw circle and add stroke I can not see stroke  I use Photoshop CS 5

    Hi i would like help with:
    When I draw circle and add stroke I can not see stroke
    I use Photoshop CS 5

    Make sure the stroke is set to a color and not to the symbol that appears here for Fill

  • HT3209 Purchased DVD in US for Cdn viewing. Digital download will not work in Cda or US? please help with new Digital code that will work

    Purchased DVD in US for Cdn viewing. Digital download will not work in Cda or US? please help with new Digital code that will work

    You will need to contact the movie studio that produced the DVD and ask if they can issue you a new code valid for Canada. Apple cannot help you, and everyone here in these forums is just a fellow user.
    Regards.

  • I would like to inquire about the schedule that is synchronized to iCal in CalDav protocol from our system. Schedule that is synchronized could be edited from the iPad or iPhone terminal, but I can no longer edit from iOS5.1. Can you tell me some tips?

      I would like to inquire about the schedule that is synchronized to iCal in CalDav protocol from our system. Schedule that is synchronized could be edited from the iPad or iPhone terminal, but I can no longer edit from iOS5.1. We did not fix anything program itself, but the data format to be synchronized is the same. Can you tell me some tips?

      I would like to inquire about the schedule that is synchronized to iCal in CalDav protocol from our system. Schedule that is synchronized could be edited from the iPad or iPhone terminal, but I can no longer edit from iOS5.1. We did not fix anything program itself, but the data format to be synchronized is the same. Can you tell me some tips?

  • I am a single App user and I would like to upgrade to the $29.00 offer for complete plan

    I am a single App user and I would like to upgrade to the $29.00 offer for complete plan

    Hi captcunningham,
    Please cancel you current plan by following the help document below:
    Cancel your membership or subscription | Creative Cloud
    Then, you can go ahead and join the plan you wish on Adobe website:
    Creative Cloud pricing and membership plans | Adobe Creative Cloud
    Regards,
    Sheena

  • I would like to pay off the remaining membership fee for the rest of the year.

    I would like to pay off the remaining membership for the rest of the year.  I have some extra money right now and would like to pay the remaining amount of my account. So that I do not have to worry about it and I know it is paid for the year. Showing that I am committed for the year. You should also have it so I can pay in full more years to come. Adobe does have some crazy polices and needs to think more about how to help its members.

    I would like to do this also. The monthly transactions are inconvenient.
    Dennis

  • Would like help with hyperlink

    In a JEditorPane, HTML documents are displayed and when a
    hyperlink is clicked, they are loaded. However, I would like to display,
    in a status area, where the hyperlink points to before the mouse click
    activates it (goes to that new page). I tried adding a mouse motion
    listener but that didn't work. I'm not really sure why it didn't work but I
    suspect it was because the editor pane was non-editable.
    Any ideas on how to implement this?

    Is this a bug or has someone else been able to get access to what
    the hyperlink points to when the mouse is over the hyperlink and haven't
    mouse clicked yet?Try the following code extracted from my program at http://www.aokabc.com (it works on 1.4):
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.text.*;
    public class TPBugDemo extends JFrame{
        public TPBugDemo() throws Exception{
          this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          JEditorPane pane=new myJEditorPane();
         pane.setContentType("text/html");
         pane.setText("<A HREF='http://www.aokabc.com'>click me</A>");
          this.getContentPane().add(new JScrollPane(pane));
       public static void main(String args[]) throws Exception {
          TPBugDemo gI = new TPBugDemo();
          gI.setSize(400, 200);
          gI.setLocationRelativeTo(null);
          gI.setVisible(true);
       class myJEditorPane extends JEditorPane implements HyperlinkListener {
         public myJEditorPane() {
            super();
            setEditable(false);
            addHyperlinkListener(this);
         public void hyperlinkUpdate(HyperlinkEvent e) {
            if (e.getEventType()==HyperlinkEvent.EventType.ACTIVATED) {
              try {
                 setPage(e.getURL());
              } catch (Throwable t) {
                 System.out.println(t.toString());
            } else if (e.getEventType()==HyperlinkEvent.EventType.ENTERED) {          // simulate a hover effect (a CSS style not supported in 1.4.0)
              System.out.println(e.getURL());
              select(e.getSourceElement().getStartOffset(),e.getSourceElement().getEndOffset());
            } else if (e.getEventType()==HyperlinkEvent.EventType.EXITED) {
              select(e.getSourceElement().getStartOffset(),e.getSourceElement().getStartOffset());
    };o)
    V.V.

  • I have moved from the UK to Canada and would like to pay for subscriptions in Canadian dollars rather than sterling pounds. Also I would like to take up the offer that I have purchase CS packages in my account. How do I go about this?

    I have moved from the UK to Canada and would like to pay for subscriptions in Canadian dollars rather than sterling pounds. Also I would like to take up Creative Cloud subscription offer because I qualified as a prior purchaser of CS packages.
    How do I go about this?

    I did that - nothing happen... I have changed my adobe ID and all address to my Canada home.
    Having log myself out and re-log back in to start the Creative Cloud subscription. The payment still shows in Sterling Pounds.
    This is difficult as I am no longer earning Sterling pounds as a wage and the subscription would automatically be doubled payment, because Canadian $ is less in currency exchange to the UK Sterling Pound.
    Thanks for your above suggestions, but what should I do now, to resolved this issue.
    Regards
    Robert

  • Help with basic ABAP code (merge internal tables, sort of...)

    Hello,
    Can someone please help write some basic code for a Basis guy with limited ABAP knowledge?
    Should be some easy points for an experienced ABAPer!
    I have identicaly structured internal tables I_A and I_B and I_C which have already been filled by function models I called.
    How will I code the following?:
    I want to read all the data of I_A into a new internal table I_MASTER (structured the same as I_A,I_B and I_C).
    Then I want to read I_B and:
    1)Update I_MASTER with NEW records
    2)Update existing records if the value of field MYFIELD in I_B is smaller than the value of MYFIELD in I_MASTER.
    Then I want to read I_C and:
    1)Update I_MASTER with NEW records
    2)Update existing records if the value of field MYFIELD in I_C is smaller than the value of MYFIELD in I_MASTER.
    Let me know if I can provide anymore information.
    Thanks in advance for you help!
    Adriaan
    Message was edited by: Adriaan
    Message was edited by: Adriaan

    Hi Adriaan ,
    I want to read all the data of I_A into a new internal table I_MASTER (structured the same as I_A,I_B and I_C).
    <b>i_master[] = i_a[] .</b>
    loop at i_b .
    read table i_master with key myfiled < i_b-myfield .
    if sy-subrc = 0 .
    append i_master from i_b .
    endif.
    endloop.
    loop at i_c .
    read table i_master with key myfiled < i_c-myfield .
    if sy-subrc = 0 .
    append i_master from i_c .
    endif.
    endloop.
    Let me know if this helped .
    Regards,
    Varun .
    Message was edited by: varun sonu

  • I purchased a time capsule last year and we have been using for our backup of our apple devices (iMac, laptop, iPad and now 5 iPhones).  we have not used it as our router for wifi but would like to now switch to it. need directions for switching please.

    i am using time capsule for backup only but would like to switch to it for our wifi.  directions on apple discuss original set up of time capsule for wi fi but not switching from existing wi fi router.  were can i get help with this?

    Well, it depends on what ISP you use.
    Reply back with your ISP and connection type (cable, ADSL). Also, do you use an ISP router or do you have a modem connected to a router that you provide?

  • Need help with retrieving data in vector using for-loop

    ok for my code, i type in String name, password, phone number and int currentsalary and desiredsalary into the textfields and click Add, and it goes into the vector and name appears on the JList ApplicantList.
    what do i add to my listselectionlistener so that by clicking on the name, i can display the details of the person whose name is in the list, back on the texfields?
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.text.*;
    import java.util.*;
    import java.util.Vector;
    import javax.swing.JScrollPane.*;
    import javax.swing.event.ListSelectionListener;
    public class Employment extends JFrame
            //declare class variables
            private JPanel jpApplicant, jpEverything,jpWEST, jpCENTRE, jpEAST, jpAddEditDelete,
                                       jpCentreTOP, jpCentreBOT, jpEastTOP, jpEastCENTRE, jpEastBOT,
                                       jpBlank1, panel1, panel2, panel3, panel4;
            private JLabel jlblApplicantForm, jlblAppList, jlblName, jlblPhone,
                                       jlblCurrentSalary, jlblPassword, jlblDesiredSalary,
                                       jlblNotes, jlblApplicantSkills, jlblIndustrySkills,
                                       jlblBlank1, jlblBlank2;
            private JButton jbtnAdd1, jbtnEdit, jbtnDelete, jbtnSave, jbtnCancel,
                                            jbtnAdd2, jbtnRemove;
            private JTextField jtfName, jtfPhone, jtfCurrentSalary, jtfPassword,
                                               jtfDesiredSalary;
               String name,password,phone,currentsalary,desiredsalary,textareastuff;
               String selectedname;
            private         JTabbedPane tabbedPane;
            private DefaultListModel listModel,listModel2;
           private ListSelectionModel listSelectionModel;
            JList ApplicantList, ApplicantSkillsList, IndustrySkillsList;
            protected JTextArea NotesList;    
            Label ApplicantListLabel, NotesListLabel, ApplicantSkillsLabel,
                                    IndustrySkillsLabel;                
                    Vector details = new Vector();
                public static void main(String []args)
                    Employment f = new Employment();
                    f.setVisible(true);
                    f.setDefaultCloseOperation(EXIT_ON_CLOSE);
                    f.setResizable(false);
                }//end of main
                    public Employment()
                            setSize(800,475);
                            setTitle("E-commerce Placement Agency");
                            JPanel topPanel = new JPanel();
                            topPanel.setLayout( new BorderLayout() );
                            getContentPane().add( topPanel );
                            createPage1();
                            createPage2();
                            createPage3();
                            createPage4();
                            tabbedPane = new JTabbedPane();
                            tabbedPane.addTab( "Applicant", panel1 );
                            tabbedPane.addTab( "Job Order", panel2 );
                            tabbedPane.addTab( "Skill", panel3 );
                            tabbedPane.addTab( "Company", panel4 );
                            topPanel.add( tabbedPane, BorderLayout.CENTER );
            public void createPage1()//PAGE 1
                                    panel1 = new JPanel();
                                    panel1.setLayout( new BorderLayout());
                                    jpApplicant= new JPanel();
                            jpApplicant.setLayout(new BorderLayout());
                            Font bigFont = new Font("TimesRoman", Font.BOLD,24);
                            jlblApplicantForm = new JLabel("\t\t\t\tAPPLICANT FORM  ");
                            jlblApplicantForm.setFont(bigFont);
                            jpApplicant.add(jlblApplicantForm,BorderLayout.EAST);
                            panel1.add(jpApplicant,BorderLayout.NORTH);
           /*****************************************WEST*********************************/             
                            jpWEST = new JPanel();                 
                            jpWEST.setLayout( new BorderLayout());
                            //Applicant List
                                  listModel2=new DefaultListModel();
                                  ApplicantList = new JList(listModel2);
                                listSelectionModel = ApplicantList.getSelectionModel();
                                listSelectionModel.addListSelectionListener(new SharedListSelectionHandler());
                                JScrollPane scrollPane3 = new JScrollPane(ApplicantList);
                            ApplicantListLabel = new Label( "Applicant List:");
                            jpWEST.add(ApplicantListLabel,"North"); 
                            jpWEST.add(scrollPane3,"Center");
                            panel1.add(jpWEST,BorderLayout.WEST);
                            /*********CENTRE*********/
                            jpCENTRE = new JPanel();
                            jpCENTRE.setLayout(new GridLayout(2,1));
                            jpCentreTOP = new JPanel();
                            panel1.add(jpCENTRE,BorderLayout.CENTER);
                            jpCENTRE.add(jpCentreTOP);
                            jpCentreTOP.setLayout(new GridLayout(6,2));
                            jlblName = new JLabel( "Name:");
                            jlblBlank1 = new JLabel ("");
                            jtfName = new JTextField(18);
                            jlblBlank2 = new JLabel("");
                            jlblPhone = new JLabel("Phone:");
                            jlblCurrentSalary = new JLabel("Current Salary:");
                            jtfPhone = new JTextField(13);
                            jtfCurrentSalary = new JTextField(7);
                            jlblPassword = new JLabel("Password:");
                            jlblDesiredSalary = new JLabel("Desired Salary:");
                            jtfPassword = new JTextField(13);
                            jtfDesiredSalary = new JTextField(6);
                            jpCentreTOP.add(jlblName);
                            jpCentreTOP.add(jlblBlank1);
                            jpCentreTOP.add(jtfName);
                            jpCentreTOP.add(jlblBlank2);
                            jpCentreTOP.add(jlblPhone);
                            jpCentreTOP.add(jlblCurrentSalary);
                            jpCentreTOP.add(jtfPhone);
                            jpCentreTOP.add(jtfCurrentSalary);
                            jpCentreTOP.add(jlblPassword);
                            jpCentreTOP.add(jlblDesiredSalary);
                            jpCentreTOP.add(jtfPassword);
                            jpCentreTOP.add(jtfDesiredSalary);
                            //Noteslist
                            jpCentreBOT = new JPanel();
                            jpCentreBOT.setLayout( new BorderLayout());
                            jpCENTRE.add(jpCentreBOT);
                            jpBlank1 = new JPanel();
                               JTextArea Noteslist=new JTextArea();
                            JScrollPane scroll3=new JScrollPane(Noteslist);
                                scroll3.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);                                             
                                scroll3.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
                              //scroll3.setSize(new Dimension(1,1));
                            NotesListLabel = new Label( "Notes:");
                            jpCentreBOT.add(NotesListLabel,"North"); 
                            jpCentreBOT.add(scroll3,"Center");
                            jpCentreBOT.add(jpBlank1,"South");
                            panel1.add(jpCENTRE,BorderLayout.CENTER);
                            /**********EAST**********/
                            //Applicant Skills Panel
                            //EAST ==> TOP
                            jpEAST = new JPanel();
                            jpEAST.setLayout( new BorderLayout());
                            jpEastTOP = new JPanel();
                            jpEastTOP.setLayout( new BorderLayout());
                            listModel = new DefaultListModel();
                            ApplicantSkillsList = new JList(listModel);
                            ApplicantSkillsLabel = new Label( "Applicant Skills");
                           // JScrollPane scrollPane1 = new JScrollPane(ApplicantSkillsList,
                           //                                                   JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
                            JScrollPane scrollPane1 = new JScrollPane(ApplicantSkillsList);
                               scrollPane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);                                             
                              scrollPane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);                                             
                            ApplicantSkillsList.setVisibleRowCount(6);
                            jpEastTOP.add(ApplicantSkillsLabel,"North"); 
    //                        ApplicantSkillsList.addItemListener(new selectNameListener());
                            jpEastTOP.add(scrollPane1,"Center");
                            jpEAST.add(jpEastTOP,BorderLayout.NORTH);
                            panel1.add(jpEAST,BorderLayout.EAST);
                            //Add & Remove Buttons
                            //EAST ==> CENTRE
                            jpEastCENTRE = new JPanel();
                            jpEAST.add(jpEastCENTRE,BorderLayout.CENTER);
                            jbtnAdd2 = new JButton("Add");
                            jbtnRemove = new JButton("Remove");
                            //add buttons to panel
                            jpEastCENTRE.add(jbtnAdd2);
                            jpEastCENTRE.add(jbtnRemove);
                            //add listener to button
                           jbtnAdd2.addActionListener(new Add2Listener());
                           jbtnRemove.addActionListener(new RemoveListener());
                            //Industry Skills Panel
                            //EAST ==> BOTTOM
                            jpEastBOT = new JPanel();
                            jpEastBOT.setLayout( new BorderLayout());
                           String[] data = {"Access97", "Basic Programming",
                           "C++ Programming", "COBOL Programming",
                           "DB Design", "Fortran programming"};
                           IndustrySkillsList = new JList(data);
                           JScrollPane scrollPane = new JScrollPane(IndustrySkillsList);
                           scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);                                             
                           scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
                           IndustrySkillsLabel = new Label( "Industry Skills:");
                           jpEastBOT.add(IndustrySkillsLabel,"North"); 
                           jpEastBOT.add(scrollPane,"Center");
                           jpEAST.add(jpEastBOT,BorderLayout.SOUTH);
                            //BOTTOM
                            jpAddEditDelete= new JPanel();
                            jbtnAdd1=       new JButton("Add");
                            jbtnEdit=       new JButton("Edit");
                            jbtnDelete=     new JButton("Delete");
                            jbtnSave=       new JButton("Save");
                            jbtnCancel=     new JButton("Cancel");
                            jpAddEditDelete.add(jbtnAdd1);
                            jpAddEditDelete.add(jbtnEdit);
                            jpAddEditDelete.add(jbtnDelete);
                            jpAddEditDelete.add(jbtnSave);
                            jpAddEditDelete.add(jbtnCancel);
                           //jbtnEdit.addActionListener(new EditListener());
                            jbtnAdd1.addActionListener(new Add1Listener());
                            jbtnCancel.addActionListener(new CancelListener());
                            panel1.add(jpAddEditDelete,BorderLayout.SOUTH);
            public void createPage2()//PAGE 2
                    panel2 = new JPanel();
                    panel2.setLayout( new GridLayout(1,1) );
                    panel2.add( new JLabel( "Sorry,under construction" ) );
            public void createPage3()//PAGE 3
                    panel3 = new JPanel();
                    panel3.setLayout( new GridLayout( 1, 1 ) );
                    panel3.add( new JLabel( "Sorry,under construction" ) );
            public void createPage4()//PAGE 4
                    panel4 = new JPanel();
                    panel4.setLayout( new GridLayout( 1, 1 ) );
                    panel4.add( new JLabel( "Sorry,under construction" ) );
            public class Add1Listener implements ActionListener
            public void actionPerformed(ActionEvent e)
                    //String name,password,phone,currentsalary,desiredsalary,textareastuff;
                    name = jtfName.getText();
                    password = jtfPassword.getText();
                    phone = jtfPhone.getText();
                    currentsalary = jtfCurrentSalary.getText();
                    int i= Integer.parseInt(currentsalary);
                    desiredsalary = jtfDesiredSalary.getText();
                    int j= Integer.parseInt(desiredsalary);
                       StoringData person = new StoringData(name,password,phone,i,j);
                    //textareastuff = NotesList.getText();
                    details.add(person);
                  listModel2.addElement(name);
                    jtfName.setText("");
                    jtfPassword.setText("");
                    jtfPhone.setText("");
                    jtfCurrentSalary.setText("");
                    jtfDesiredSalary.setText("");
                  //  NotesList.setText("");
                    // NotesList.append("");          
                   // details.addElement(name);
            public class Add2Listener implements ActionListener
                    public void actionPerformed(ActionEvent e)
                           String temp1;
                           temp1 = (String)IndustrySkillsList.getSelectedValue();
                           listModel.addElement(temp1);
            public class RemoveListener implements ActionListener
                    public void actionPerformed(ActionEvent e)
                            int index = ApplicantSkillsList.getSelectedIndex();
                      listModel.remove(index);
            public class EditListener implements ActionListener
                    public void actionPerformed(ActionEvent e)
            public class DeleteListener implements ActionListener
                    public void actionPerformed(ActionEvent e)
            public class SaveListener implements ActionListener
                    public void actionPerformed(ActionEvent e)
            public class CancelListener implements ActionListener
                    public void actionPerformed(ActionEvent e)
                    jtfName.setText("");
                    jtfPassword.setText("");
                    jtfPhone.setText("");
                    jtfCurrentSalary.setText("");
                    jtfDesiredSalary.setText("");                         
            public class SharedListSelectionHandler implements ListSelectionListener
            public void valueChanged(ListSelectionEvent e)
               selectedname =ApplicantList.getSelectedValue().toString();
               // ListSelectionModel lsm = (ListSelectionModel)e.getSource();
                System.out.println(selectedname);
              // for(selectedname==n)
              //     System.out.println(ApplicantList.getSelectedValue().toString());
              //     jtfName.setText(n);
        //int firstIndex = e.getFirstIndex();
                //int lastIndex = e.getLastIndex();
                //boolean isAdjusting = e.getValueIsAdjusting();
                /*if (lsm.isSelectionEmpty())
                   System.out.println("hahahhaa");
                } else {
                    // Find out which indexes are selected.
                    /*int minIndex = lsm.getMinSelectionIndex();
                    int maxIndex = lsm.getMaxSelectionIndex();
                    /*for (int i = minIndex; i <= maxIndex; i++)
                       /* if (lsm.isSelectedIndex(i))
                           System.out.println("hohoho");
                System.out.println("haho");*/
    }

    ok i added that part inside my listselectionlistener
    it says incompatible types in line 421.
    and where do i insert :
    StoringData selectedPerson = detailMap.get(selectedName)
    and/or
    StoringData selectedPerson = ApplicantList.getSelectedValue()
    this is what the code looks like after i added the loop u gave me
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.text.*;
    import java.util.*;
    import java.util.Vector;
    import javax.swing.JScrollPane.*;
    //import javax.swing.event.ListSelectionListener;
    public class Employment extends JFrame
            //declare class variables
            private JPanel jpApplicant, jpEverything,jpWEST, jpCENTRE, jpEAST, jpAddEditDelete,
                                       jpCentreTOP, jpCentreBOT, jpEastTOP, jpEastCENTRE, jpEastBOT,
                                       jpBlank1, panel1, panel2, panel3, panel4;
            private JLabel jlblApplicantForm, jlblAppList, jlblName, jlblPhone,
                                       jlblCurrentSalary, jlblPassword, jlblDesiredSalary,
                                       jlblNotes, jlblApplicantSkills, jlblIndustrySkills,
                                       jlblBlank1, jlblBlank2;
            private JButton jbtnAdd1, jbtnEdit, jbtnDelete, jbtnSave, jbtnCancel,
                                            jbtnAdd2, jbtnRemove;
            private JTextField jtfName, jtfPhone, jtfCurrentSalary, jtfPassword,
                                               jtfDesiredSalary;
               String name,password,phone,currentsalary,desiredsalary,textareastuff;
               String selectedname;
            private         JTabbedPane tabbedPane;
            private DefaultListModel listModel,listModel2;
           private ListSelectionModel listSelectionModel;
            JList ApplicantList, ApplicantSkillsList, IndustrySkillsList;
            protected JTextArea NotesList;    
            Label ApplicantListLabel, NotesListLabel, ApplicantSkillsLabel,
                                    IndustrySkillsLabel;                
                    Vector details = new Vector();
                public static void main(String []args)
                    Employment f = new Employment();
                    f.setVisible(true);
                    f.setDefaultCloseOperation(EXIT_ON_CLOSE);
                    f.setResizable(false);
                }//end of main
                    public Employment()
                            setSize(800,475);
                            setTitle("E-commerce Placement Agency");
                            JPanel topPanel = new JPanel();
                            topPanel.setLayout( new BorderLayout() );
                            getContentPane().add( topPanel );
                            createPage1();
                            createPage2();
                            createPage3();
                            createPage4();
                            tabbedPane = new JTabbedPane();
                            tabbedPane.addTab( "Applicant", panel1 );
                            tabbedPane.addTab( "Job Order", panel2 );
                            tabbedPane.addTab( "Skill", panel3 );
                            tabbedPane.addTab( "Company", panel4 );
                            topPanel.add( tabbedPane, BorderLayout.CENTER );
            public void createPage1()//PAGE 1
                                    panel1 = new JPanel();
                                    panel1.setLayout( new BorderLayout());
                                    jpApplicant= new JPanel();
                            jpApplicant.setLayout(new BorderLayout());
                            Font bigFont = new Font("TimesRoman", Font.BOLD,24);
                            jlblApplicantForm = new JLabel("\t\t\t\tAPPLICANT FORM  ");
                            jlblApplicantForm.setFont(bigFont);
                            jpApplicant.add(jlblApplicantForm,BorderLayout.EAST);
                            panel1.add(jpApplicant,BorderLayout.NORTH);
           /*****************************************WEST*********************************/             
                            jpWEST = new JPanel();                 
                            jpWEST.setLayout( new BorderLayout());
                            //Applicant List
                                  listModel2=new DefaultListModel();
                                  ApplicantList = new JList(listModel2);
                                listSelectionModel = ApplicantList.getSelectionModel();
                                listSelectionModel.addListSelectionListener(new SharedListSelectionHandler());
                                JScrollPane scrollPane3 = new JScrollPane(ApplicantList);
                            ApplicantListLabel = new Label( "Applicant List:");
                            jpWEST.add(ApplicantListLabel,"North"); 
                            jpWEST.add(scrollPane3,"Center");
                            panel1.add(jpWEST,BorderLayout.WEST);
                            /*********CENTRE*********/
                            jpCENTRE = new JPanel();
                            jpCENTRE.setLayout(new GridLayout(2,1));
                            jpCentreTOP = new JPanel();
                            panel1.add(jpCENTRE,BorderLayout.CENTER);
                            jpCENTRE.add(jpCentreTOP);
                            jpCentreTOP.setLayout(new GridLayout(6,2));
                            jlblName = new JLabel( "Name:");
                            jlblBlank1 = new JLabel ("");
                            jtfName = new JTextField(18);
                            jlblBlank2 = new JLabel("");
                            jlblPhone = new JLabel("Phone:");
                            jlblCurrentSalary = new JLabel("Current Salary:");
                            jtfPhone = new JTextField(13);
                            jtfCurrentSalary = new JTextField(7);
                            jlblPassword = new JLabel("Password:");
                            jlblDesiredSalary = new JLabel("Desired Salary:");
                            jtfPassword = new JTextField(13);
                            jtfDesiredSalary = new JTextField(6);
                            jpCentreTOP.add(jlblName);
                            jpCentreTOP.add(jlblBlank1);
                            jpCentreTOP.add(jtfName);
                            jpCentreTOP.add(jlblBlank2);
                            jpCentreTOP.add(jlblPhone);
                            jpCentreTOP.add(jlblCurrentSalary);
                            jpCentreTOP.add(jtfPhone);
                            jpCentreTOP.add(jtfCurrentSalary);
                            jpCentreTOP.add(jlblPassword);
                            jpCentreTOP.add(jlblDesiredSalary);
                            jpCentreTOP.add(jtfPassword);
                            jpCentreTOP.add(jtfDesiredSalary);
                            //Noteslist
                            jpCentreBOT = new JPanel();
                            jpCentreBOT.setLayout( new BorderLayout());
                            jpCENTRE.add(jpCentreBOT);
                            jpBlank1 = new JPanel();
                               JTextArea Noteslist=new JTextArea();
                            JScrollPane scroll3=new JScrollPane(Noteslist);
                                scroll3.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);                                             
                                scroll3.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
                              //scroll3.setSize(new Dimension(1,1));
                            NotesListLabel = new Label( "Notes:");
                            jpCentreBOT.add(NotesListLabel,"North"); 
                            jpCentreBOT.add(scroll3,"Center");
                            jpCentreBOT.add(jpBlank1,"South");
                            panel1.add(jpCENTRE,BorderLayout.CENTER);
                            /**********EAST**********/
                            //Applicant Skills Panel
                            //EAST ==> TOP
                            jpEAST = new JPanel();
                            jpEAST.setLayout( new BorderLayout());
                            jpEastTOP = new JPanel();
                            jpEastTOP.setLayout( new BorderLayout());
                            listModel = new DefaultListModel();
                            ApplicantSkillsList = new JList(listModel);
                            ApplicantSkillsLabel = new Label( "Applicant Skills");
                           // JScrollPane scrollPane1 = new JScrollPane(ApplicantSkillsList,
                           //                                                   JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
                            JScrollPane scrollPane1 = new JScrollPane(ApplicantSkillsList);
                               scrollPane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);                                             
                              scrollPane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);                                             
                            ApplicantSkillsList.setVisibleRowCount(6);
                            jpEastTOP.add(ApplicantSkillsLabel,"North"); 
    //                        ApplicantSkillsList.addItemListener(new selectNameListener());
                            jpEastTOP.add(scrollPane1,"Center");
                            jpEAST.add(jpEastTOP,BorderLayout.NORTH);
                            panel1.add(jpEAST,BorderLayout.EAST);
                            //Add & Remove Buttons
                            //EAST ==> CENTRE
                            jpEastCENTRE = new JPanel();
                            jpEAST.add(jpEastCENTRE,BorderLayout.CENTER);
                            jbtnAdd2 = new JButton("Add");
                            jbtnRemove = new JButton("Remove");
                            //add buttons to panel
                            jpEastCENTRE.add(jbtnAdd2);
                            jpEastCENTRE.add(jbtnRemove);
                            //add listener to button
                           jbtnAdd2.addActionListener(new Add2Listener());
                           jbtnRemove.addActionListener(new RemoveListener());
                            //Industry Skills Panel
                            //EAST ==> BOTTOM
                            jpEastBOT = new JPanel();
                            jpEastBOT.setLayout( new BorderLayout());
                           String[] data = {"Access97", "Basic Programming",
                           "C++ Programming", "COBOL Programming",
                           "DB Design", "Fortran programming"};
                           IndustrySkillsList = new JList(data);
                           JScrollPane scrollPane = new JScrollPane(IndustrySkillsList);
                           scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);                                             
                           scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
                           IndustrySkillsLabel = new Label( "Industry Skills:");
                           jpEastBOT.add(IndustrySkillsLabel,"North"); 
                           jpEastBOT.add(scrollPane,"Center");
                           jpEAST.add(jpEastBOT,BorderLayout.SOUTH);
                            //BOTTOM
                            jpAddEditDelete= new JPanel();
                            jbtnAdd1=       new JButton("Add");
                            jbtnEdit=       new JButton("Edit");
                            jbtnDelete=     new JButton("Delete");
                            jbtnSave=       new JButton("Save");
                            jbtnCancel=     new JButton("Cancel");
                            jpAddEditDelete.add(jbtnAdd1);
                            jpAddEditDelete.add(jbtnEdit);
                            jpAddEditDelete.add(jbtnDelete);
                            jpAddEditDelete.add(jbtnSave);
                            jpAddEditDelete.add(jbtnCancel);
                           //jbtnEdit.addActionListener(new EditListener());
                            jbtnAdd1.addActionListener(new Add1Listener());
                            jbtnCancel.addActionListener(new CancelListener());
                            panel1.add(jpAddEditDelete,BorderLayout.SOUTH);
            public void createPage2()//PAGE 2
                    panel2 = new JPanel();
                    panel2.setLayout( new GridLayout(1,1) );
                    panel2.add( new JLabel( "Sorry,under construction" ) );
            public void createPage3()//PAGE 3
                    panel3 = new JPanel();
                    panel3.setLayout( new GridLayout( 1, 1 ) );
                    panel3.add( new JLabel( "Sorry,under construction" ) );
            public void createPage4()//PAGE 4
                    panel4 = new JPanel();
                    panel4.setLayout( new GridLayout( 1, 1 ) );
                    panel4.add( new JLabel( "Sorry,under construction" ) );
            public class Add1Listener implements ActionListener
            public void actionPerformed(ActionEvent e)
                    //String name,password,phone,currentsalary,desiredsalary,textareastuff;
                    name = jtfName.getText();
                    password = jtfPassword.getText();
                    phone = jtfPhone.getText();
                    currentsalary = jtfCurrentSalary.getText();
                    int i= Integer.parseInt(currentsalary);
                    desiredsalary = jtfDesiredSalary.getText();
                    int j= Integer.parseInt(desiredsalary);
                       StoringData person = new StoringData(name,password,phone,i,j);
                    //textareastuff = NotesList.getText();
                    details.add(person);
                  listModel2.addElement(name);
                    jtfName.setText("");
                    jtfPassword.setText("");
                    jtfPhone.setText("");
                    jtfCurrentSalary.setText("");
                    jtfDesiredSalary.setText("");
                  //  NotesList.setText("");
                    // NotesList.append("");          
                   // details.addElement(name);
            public class Add2Listener implements ActionListener
                    public void actionPerformed(ActionEvent e)
                           String temp1;
                           temp1 = (String)IndustrySkillsList.getSelectedValue();
                           listModel.addElement(temp1);
            public class RemoveListener implements ActionListener
                    public void actionPerformed(ActionEvent e)
                            int index = ApplicantSkillsList.getSelectedIndex();
                      listModel.remove(index);
            public class EditListener implements ActionListener
                    public void actionPerformed(ActionEvent e)
            public class DeleteListener implements ActionListener
                    public void actionPerformed(ActionEvent e)
            public class SaveListener implements ActionListener
                    public void actionPerformed(ActionEvent e)
            public class CancelListener implements ActionListener
                    public void actionPerformed(ActionEvent e)
                    jtfName.setText("");
                    jtfPassword.setText("");
                    jtfPhone.setText("");
                    jtfCurrentSalary.setText("");
                    jtfDesiredSalary.setText("");                         
            public class SharedListSelectionHandler implements ListSelectionListener
            public void valueChanged(ListSelectionEvent e)
             selectedname =ApplicantList.getSelectedValue().toString();
             StoringData selectedPerson = null;
              for (StoringData person : details)
                if (person.getName1().equals(selectedname))
                       selectedPerson = person;
                       break;
         if (selectedPerson != null)
      // set the relevant fields
               // ListSelectionModel lsm = (ListSelectionModel)e.getSource();
              //  System.out.println(selectedname);
              // for(selectedname==n)
              //     System.out.println(ApplicantList.getSelectedValue().toString());
              //     jtfName.setText(n);
        //int firstIndex = e.getFirstIndex();
                //int lastIndex = e.getLastIndex();
                //boolean isAdjusting = e.getValueIsAdjusting();
                /*if (lsm.isSelectionEmpty())
                   System.out.println("hahahhaa");
                } else {
                    // Find out which indexes are selected.
                    /*int minIndex = lsm.getMinSelectionIndex();
                    int maxIndex = lsm.getMaxSelectionIndex();
                    /*for (int i = minIndex; i <= maxIndex; i++)
                       /* if (lsm.isSelectedIndex(i))
                           System.out.println("hohoho");
                System.out.println("haho");*/
    }

  • Help with F-48 Vendor Down payment for Italy please

    Hello,
    I have a problem with the F-48 Vendor down payment process.  I'm working with an Italian company, and they state that with a Pro-forma invoice, they post the down payment.  The Vendor has Withholding tax, and when I use a Vendor that is setup for Withholding in the Vendor master, the Withholding tax is not being applied to the Down payment.  They state that they need it to apply to the down payment.
    Also, they claim that the VAT tax is not posted at the time of the down payment, but is used to help calculate the Withholding tax.  When I create a F-48 down payment and use the 'Calculate Tax' box, the VAT that is calculated is actually posted at the time of the Down payment posting.  They claim that it should not post until the Invoice is cleared.
    Any ideas?
    thanks for your help!

    Hello Deepa Khatri,
    Thanks for your response.  I know that the Vendor is setup correctly, because when I create and FB60 Invoice for his same vendor, the Withholding tax is properly applied.  When I use the F-48 transaction, the Withholding is not brought in.  Is there some Down Payment configuration that might help this Withholding to be applied?
    thanks again for your help!

  • I would like to know what application I should use for this specific job.  I have 6 photos in Iphoto, and I would like to print them out on one piece of paper with the title and key words showing.  Please help.

    My objective is to print photos on on 8 1/2 x 11 sheets of paper (4 per page).  I want to include the photo title and the photo key words.
    I am not sure how to go about doing this.

    In iPhoto, create an album with the images you want to print.
    Once created, open the album and select all the images (type Command + A)
    Go to the menu View and make sure Titles and Keywords are checked.
    Go to the menu File > Print
    Choose Contact Sheet
    In the lower right corner press the customize button
    In the next window that opens, at the bottom of the window change the column slider to "2"
    You should be good to go. If OK, then press Print at the bottom right corner of the window.
    MtD
    Message was edited by: Meg The Dog to fix typo

  • Would like help with trap command in Terminal

    I'm learning about the trap command from my bash book. I tried out the little script they gave:
    Code: 
    trap "echo 'You hit control-C!' " INTwhile true; do     sleep 60done
    But when I type control-c, the script just stops and the message is not displayed. I checked trap -l and saw that control-c is intr, but the same thing happened whet I tried that. Can anyone tell me what I'm missing?
    I'm using terminal (BSD) in OS X Snow Leopard

    I'm assuming that you are typing these commands in the terminal window and not initiating them thru a shell script. I'd like to suggest that you avoid infinite loops. Since you are bound to orphan processes. I'm going the use the external sleep command in my examples because it affords us some time to type CONTROL-C.
    [bash-4.2.8]~ $ trap "echo '......You hit control-C'" INT; sleep 15
    ^C  
    [bash-4.2.8]~ $
    [bash-4.2.8]~ $ ^C......You hit control-C
    The trap is set but Bash does not intercept the trap because sleep is running in the foreground. The interrupt signal is sent to the command sleep.
    Let's try running sleep in the background ->
    [bash-4.2.8]~ $ trap 2 #Set SIGINT to it's default
    [bash-4.2.8]~ $ trap "echo '......You hit control-C'" INT; sleep 15&
    [1] 368
    [bash-4.2.8]~ $ ^C......You hit control-C
    [bash-4.2.8]~ $ ^C......You hit control-C
    [1]+  Done                    sleep 15
    [bash-4.2.8]~ $ ^C......You hit control-C
    It works! Well, almost. You can't send the interrupt signal to a background process. In order for Bash to intercept the trap it must stay in the foreground. This happens when you initiate a sub-shell via a shell script or by rapping a command in paretheses ( ) ->
    [bash-4.2.8]~ $ trap 2  #Set SIGINT to it's default
    [bash-4.2.8]~ $ (trap "echo '......You hit control-C'" INT; sleep 15) ^C......You hit control-C
    [bash-4.2.8]~ $
    [bash-4.2.8]~ $ ^C
    The trap works and the interrupt signal was sent to sleep. Notice, the trap is only set in the sub-shell.
    Bash behaves differently when you use the built-in commands since you are working within the shell. I'll use an example similar to one of yours, except that you can break out of the loop by typing the number 10 or higher.
    [bash-4.2.8]~ $ trap "echo '.......You hit control-C'" INT ; x=0; while (( $x < 10 )); do echo "Enter a number"; read x; done
    Enter a number
    3
    Enter a number
    ^C.......You hit control-C
    3
    Enter a number
    10
    [bash-4.2.8]~ $
    [bash-4.2.8]~ $ ^C......You hit control-C
    [bash-4.2.8]~ $ trap 2  #Set SIGINT to it's default
    As you can see the trap works. I'm going to let you sort out what happens after I typed  CONTROL -C in the last example.....:-)  Hope this helps.
    Message was edited by: Mark Jalbert

  • Are throwing the baby out with the bath water again?  Looks like I am losing the services I use, for crap I don't want to keep my eMail.

    Still mifed from losing all the time I put into Homepage.

    What has "homepage" to do with icloud ?
    it was a feature of MobileMe but is no feature in iCloud.Apple sees this sort of service as obsolete. You can use "homepage" hosting at Apple until next year.
    Just look for other hosters. iWeb will work in Lion, so not a problem at all.  You only need to move your created sites over per FTP to 3rd party companies that will host it for you. No drama.

Maybe you are looking for

  • Error message when trying to create realm in OAS

    I have deployed my app to OAS 10.1.3 from JDEV 10.1.3.3. I am trying to create a realm so I can set up roles and users but when I hit apply I get the following error message: An error has occurred. Error invoking method: addRealm on MBean: oc4j:j2eeT

  • Another FM for CATSXT_SIMPLE_TEXT_EDITOR

    Hi, There is a FM in ECC6 CATSXT_SIMPLE_TEXT_EDITOR, I want a similar one in 4.6C (which is not present). This FM when executed, gives a dialog box to enter text. Once we say OK, it stores this text it in a variable. I need similar type of FM in 4.6C

  • Freehand files aren't recognized by Illustrator CS6?

    Am I only the one with this issue? This creates a huge bind after signing up for the full CS6 Creative Cloud service when I have hundreds of archived Freehand vector client jobs that I still refer to by dragging the files into Illustrator. After CS3,

  • New Driver/Install-CD nee

    Hi, I've got a SB Audigy Player and want to install it properly. But the installation have got errors.. it runs till 97% and sto ps. After a few Minutes I must terminate the "CPAXXX" process of the CD and then I get the "finished" screen, but the sou

  • Why do I have to run the plug-in container in my processes constantly in this version? It takes up too much memory!

    The earlier version of Firefox did not run this plug-in container. Every time I would remove it from my processes it would kill videos etc. But, it was all fine in the older version of Firefox, so why the change? So I chose not to update Firefox. The