JTextField getText() missing char

I'm writing an DM <-> Euro converter and i want the App to convert it on the fly, my problem is that when i type things into the TextField the last typed char is missing.
euro.addKeyListener(new KeyAdapter() {
public void keyTyped(KeyEvent e)
euro.setValue(euro.getText());
dm.setValue(euro.getValue()*FACTOR);
Any idea?

Three events are generated when you type data into a JTextfield:
1) keyPressed
2) keyTyped
3) keyReleased
The related document for the text field has not been updated at the time the keyTyped event is generated.
Try moving your code to the keyReleased() method.
Or, in the keyTyped() method you could try:
euro.setValue( euro.getText() + e.getKeyChar() );

Similar Messages

  • JTextField.getText()

    Hi all,
    I put few JTextFields in an JApplet application. How can I output the content of JTextField? I tried two below but didn't work, it output nothing.
    jtextfield.getText()
    and
    String s = jtextfield.getText()

    Here is critical part of the code:
    public void button_actionPerformed(ActionEvent e)
    if (txtA.getText().equals (""))
    JOptionPane.showMessageDialog(null, "A is missing.", "Invalid Input", JOptionPane.INFORMATION_MESSAGE);
    return;
    if (txtB.getText().equals (""))
    JOptionPane.showMessageDialog(null, "B is missing.", "Invalid Input", JOptionPane.INFORMATION_MESSAGE);
    return;
    int responseAdd = JOptionPane.showConfirmDialog(this, "add A, B?", "Confirmation", JOptionPane.YES_NO_OPTION);
    if (responseAdd == JOptionPane.YES_OPTION)
    resetAandBFields ();
    JOptionPane.showMessageDialog(null, "A, B added successfully", "Information", JOptionPane.INFORMATION_MESSAGE);
    ABRecord addnew = new ABRecord (txtA.getText(), txtB.getText());
    ABRecord has nothing.
    I tried to put the last code "ABRecord addnew = new ABRecord (txtA.getText(), txtB.getText());"
    at the first line just after "public void button_actionPerformed(ActionEvent e)", then it work. I suspect the condition check rotuines have problem.
    Thanks.

  • JTextField.getTExt() causes VerifyError, when running program

    I was looking through the online refernce that has code, as well as some of my old code, but everything returns the same problem. Code compiles, but when attempting to run, whereever I use the getText() method, then that conating method issues a verrifyError. As of now I can't get any values into or out of a textField.

    import javax.swing.*;
    public class guiTest
      public guiTest()
        JFrame window = new Jframe();
        JTextField text = new JTextField(20);
        text.setText("hello World");
        window.getContentPane().add(text);
        window.pack();
        window.show();
      static public void main (String[] Args)
        guiTest app = new guiTest();
    }That is the simplest app and for some reason I still get the same errors, Exception in thread "Main" java.lang.VerifyError: (Class: guiTest, Method: <init> signature: ()V) Incompatable object arugument for function call.

  • Missing chars in SP scripts (at Source Model Phase) when migrating SQL65

    In the Source Model Phase, appears lots of errors, all of them generated by the dissapearance of random chars in Stored Proc scripts.
    Help please...

    Jpeteet,
    > some migration with my hair on fire if this thing dies. I just wanted
    > anyone to point out any caveats that I might be missing. I know that I
    > can fix container/user login scripts to point to the new server volumes
    > and any related rights/maps to this new one. I also know about the
    > server migration tool but I don't like the idea of having the old one
    > basically blown away when the migration is done - just in case we have
    > some kind of problems so I can just plug it back in and be back and
    > running. Also, the 6.0 server does queue based printing and I want to be
    > able to migrate the users all at once but then come back and do printing
    > later. My thought was to migrate users and then have printing stay on
    > the old server and start migrating the print over a printer/queue at a
    > time. Is there anything else that I might be missing?
    1. Provided you follow the docs, migration from 6.0 to 65. SP8 should be
    painless
    2. If the migration fails, then you can resurrect the old server. Again,
    instructions are in the docs.
    3. I read from your posting that you think that queue-based printing is
    not supported on 6.5 - That is not true. Queue-based printing works just
    fine on 6.5.
    FWIW, I migrated a NW 6.0 SBS server to OES 11/Linux two weeks ago. Most
    of the hurdles were because it is not technically supported and I had some
    cert issues. But I brought in a temp 6.5 server in the tree and pointed to
    it for DS, then did a migration, using the OES migration wizard. Went OK.
    Anders Gustafsson (NKP)
    The Aaland Islands (N60 E20)
    Have an idea for a product enhancement? Please visit:
    http://www.novell.com/rms

  • JTextField getText() returns old contents

    Using JDK 1.3, I am trying to dynamically create a JPanel which contains a JLabel, a JTextField with some initial contents, and a OK button. This JPanel is dynamically generated according to some information from previous user information. User will input his own input into this JTextField. The problem I have is that after a user puts new string into the field and then click the OK button to confirm the change, the callback function for the OK button tries to get the user input by caling getText(). Yet this call always returns the initial string, not the actual user input. Could anyone indicate the reason of this problem?
    Thank you in advance!

    Most likely, the JTextArea being referenced when you call getText() does not contain the user input. In other words, you are calling getText() on the text area that contains the initial string, not on the text area where the user has input data.

  • Re: HELP!! JTextField.getText() is not working

    I have the same problem for JDK 1.3. Did you finally figure out the problem?

    HI Nayeem,
    Please maintain Authorization group 1 in Maintain screen for Object Link :
    Maintain 1 in Auth. field. Then go to RECN, Extras, Document Management there u will find Creation of document from RECN.
    Regards
    Jayanth

  • JTextField and Chars

    How can I setText in a JTextField which is a char?
    I do text.setText("" + character);
    but it doesn't print right. However if i do System.out.println(character);
    it prints it just as i want to. How can i make JTextField work with chars?

    pbrockway2: Ok, as you said have it return a string. Well I gave it a go. But it only gives out just the first char of the string. Maybe you can help me figure out if there is another way. Thanks for your help.
       import javax.swing.*;
       import java.awt.*;
       import java.awt.event.*;
        public class Capital extends JPanel
          JTextField rename;
          JTextField original;
          JPanel panel1;
          JButton capsB;
              String g;
           public Capital()
             capsB = new JButton("Capitalize");
             capsB.addActionListener(
                    new ActionListener()
                       public void actionPerformed(ActionEvent e)
                                  rename.setText(Capitalize(g));                              
             original = new JTextField(50);
                   g = "this is original text. this needs to be capitalized.";
                   original.setText(g);
                   rename = new JTextField(50);
                   rename.setText("This is where the capitalized text needs to be displayed.");
                   this.setLayout(new BorderLayout());
             this.add(original, BorderLayout.NORTH);
                   this.add(capsB, BorderLayout.CENTER);
             this.add(rename, BorderLayout.SOUTH);
           public String Capitalize(String in)
                   char ch;      
             char prevCh;  
             int i;        
             prevCh = '.';
             String caps = in.trim();
                   String[] j = new String[caps.length()];
             for (i = 0; i < caps.length(); i++ )
                ch = caps.charAt(i);
                if(Character.isLetter(ch) && ! Character.isLetter(prevCh))
                   j[i] = "" + Character.toUpperCase(ch);
                else
                   j[i] = "" + ch;
                prevCh = ch;
                        return j;
                   return j[i];
    public static void main (String[] args)
    JFrame frame = new JFrame("Capitalize");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Capital panel = new Capital();
    //frame.setPreferredSize(new Dimension(1000, 1000));
    frame.getContentPane().add(panel);
    // frame.setLocationRelativeTo(null);
    frame.pack();
    frame.setVisible(true);

  • Missing ligature font chars

    I have some pdf in which 'ligature' font chars are missing: I can see correctly 'ff' and 'ffi' chars displaying the pdf, but If I copy and paste text (or extract text using SDK) there are no 'ffi', 'ff' chars (with copy-paste a see a square instead of that chars).
    I don't generate this pdfs by myself, so I don't know the generation process.
    My doubt is: I can see correct chars even if embedded text is bad, why? Is there a way to extract good text?
    If  I do a pdf->ps->pdf conversion, the missing chars problem is fixed. I can copy and paste text and I see correct ligature font chars. How this could be possible?
    Thanks in advance

    It isn't guaranteed to solve the problem - in fact, it will only do so in VERY SPECIFIC use cases.
    It does it because this process is COMPLETELY REWRITING the PDF.  NONE of the original PDF remains, which is why this is an extremely lossy operation.  BUT if the font that was used is present on the machine, then that font information is used instead of the bad data in the original PDF.

  • JTextField information retrieval

    Hi, I�m a new Java programmer, I have one problem trying to assign the content of a JTextField to a char variable.
    To assign an integer I�m using:
    side = Integer.parseInt (sideField.getText ( ) );
    How can in assign the symbolField content to char variable symbol?
    I'd really appreciate your help!! Thanks a lot!!

    String symbolStr = symbolField.getText();
    char symbol = symbolStr.charAt(0); // returns the character at index 0

  • Problem in displaying long string in JTextField

    Hi All,
    I got problem in displaying long String in JtextField. It does center alignment & I can see middle part of string where length of JTextfield is 6 char. How can I do left alignement so that I can see starting 6 character?
    --Harish                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    you may try this:
    yourTextFieldName.setHorizontalAlignment(JTextField.LEFT);
    or
    yourTextFieldName.setHorizontalAlignment(JTextField.LEADING);
    hth.

  • How to combine integers with JTextFields?

    Hello
    I have 2 textFields and i want to add on each a integer
    I also have 3 buttons 1for the "+"function 2 for the "-" function and 3 for the "="
    function
    How can i put integers and make the above functions using (JTextFields which are working with Strings as far i know)without throwing me exception thread String needed?
    thanks

    Why not just set the text to whatever number you want (or have the user do it by typing in the JTextField), then use getText() to retrieve the text and do your operations on it?
    User enters stuff into textfields
    User hits "enter" (or whatever)
    Use JTextField.getText()
    Use Integer.valueOf(String)
    etcOr whatever floats your boat.

  • JTextField Dilemma??

    I am a beginner Java program. I have made a screen using swing. It has three panels on a frame and laid out using different layouts.
    Now a button is clicked on one panel and I want it to clear all the JTextFields in another panel.
    I have an ActionListener for the button and am using JTextField.setText("") .
    It throws an exception:
    "Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException"
    Why would this happen?
    Also the same thing happens when I try a button to get the data from these JTextFields using JtextField.getText();
    Do I have to implement ActionListener or DocumentListener for JTextFields also?
    Thanks.

    Maybe I should give some of my code to make my problem clear.
    public class InputFrame extends JFrame {
         public InputFrame(){
              setTitle("Input Screen");
              setSize(500,400);
              JPanel p1=new JPanel();
              p1.setLayout(new BoxLayout(p1,BoxLayout.Y_AXIS));
              JPanel plr=new JPanel();
              plr.setBorder(new EtchedBorder());
              plr.setLayout(new GridLayout(5,2,5,5));
              plr.add(new JLabel());
              plr.add(new JLabel("Date (yyyy-mm-dd)"));
              JTextField dtField=new JTextField("",1);
              plr.add(dtField);
              plr.add(new JLabel());
              plr.add(new JLabel());
              plr.add(new JLabel("Category"));
              JTextField catField=new JTextField("",1);
              plr.add(catField);
              plr.add(new JLabel());
              p1.add(plr);
              getContentPane().add(p1,BorderLayout.CENTER);
              JPanel p2=new JPanel();
              p2.setLayout(new BoxLayout(p2,BoxLayout.Y_AXIS));
              p2.setBorder(new EtchedBorder());
              p2.add(new JLabel("Choose the check-boxes and then enter the required data."));
              p2.add(new JLabel("If the check-boxes are not clicked, then that data will not be considered."));
              getContentPane().add(p2,BorderLayout.NORTH);
              JPanel p3=new JPanel();
              p3.setLayout(new BoxLayout(p3,BoxLayout.X_AXIS));
              p3.setBorder(new EtchedBorder());
              p3.add(new JLabel(" "));
              JButton MainButton=new JButton("Main Menu");
              p3.add(MainButton);
              JButton ClearButton=new JButton("Clear Data");
              p3.add(ClearButton);
              MainButton.addActionListener(m);
              ClearButton.addActionListener(c);
              getContentPane().add(p3,BorderLayout.SOUTH);
         }//end constructor
         //listener for main button
         ActionListener m=new ActionListener(){
              public void actionPerformed(ActionEvent e){
                   //open main screen
                   MainFrame mframe=new MainFrame();
                   mframe.setVisible(true);
                   dispose();
    //TODO:listener for clear button-THIS IS WHERE THE ERROR OCCURS!
         ActionListener c=new ActionListener(){
              public void actionPerformed(ActionEvent evt){
                   //clear all the fields
                   dtField.setText(" ");
                   catField.setText(" ");
                   accnoField.setText(" ");
                   accnameField.setText(" ");
                   amtField.setText(" ");
                   dispose();
         private JButton MainButton;
         private JButton ClearButton;
         private JButton SaveButton;
         private JButton ExitButton;
         private JTextField dtField;
         private JTextField catField;
         private JTextField accnoField;
         private JTextField accnameField;
         private JTextField amtField;
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              JFrame frame1 = new InputFrame();
              frame1.setVisible(true);
              frame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    So I am trying to click a button and clear out the text fields. But its giving me errors. Any ideas why?
    Thanks.

  • Cursor Automatically Goes to Center of JTextFields

    I have a simple quesiton for you Java gurus. I have several JTextFields that I am populating with data using JDBC. However, when I click on or tab through the fields, the cursor automatically goes to the center of the box instead of the beginning, regardless of whether or not there is data in the fields. What do I need to do to have the cursor automatically go to the beginning of each field? Thanks a bunch!

    My first thought is to check the alignment of those field objects:
    JTextField.getHorizontalAlignment()If that's not it, might there be some existing value (like a tab character or some space characters) already in that field? You can check that with:
    JTextField.getText()

  • [SOLVED] missing required signature

    i am not sure this is the right forum but i do'nt find a better one.
    i had a power failure during kernel update and i can't login.
    i chrooted from fedora 17 installation disk and tried
    pacman -Syu
    and i got this error
    (40/40) checking package integrity [###########################] 100%
    error: GPGME error: Inappropriate ioctl for device
    error: GPGME error: Inappropriate ioctl for device
    error: GPGME error: Inappropriate ioctl for device
    error: GPGME error: Inappropriate ioctl for device
    error: GPGME error: Inappropriate ioctl for device
    error: GPGME error: Inappropriate ioctl for device
    error: GPGME error: Inappropriate ioctl for device
    error: GPGME error: Inappropriate ioctl for device
    error: GPGME error: Inappropriate ioctl for device
    error: GPGME error: Inappropriate ioctl for device
    error: GPGME error: Inappropriate ioctl for device
    error: GPGME error: Inappropriate ioctl for device
    error: GPGME error: Inappropriate ioctl for device
    error: GPGME error: Inappropriate ioctl for device
    error: GPGME error: Inappropriate ioctl for device
    error: GPGME error: Inappropriate ioctl for device
    error: GPGME error: Inappropriate ioctl for device
    error: GPGME error: Inappropriate ioctl for device
    error: GPGME error: Inappropriate ioctl for device
    error: GPGME error: Inappropriate ioctl for device
    error: GPGME error: Inappropriate ioctl for device
    error: GPGME error: Inappropriate ioctl for device
    error: GPGME error: Inappropriate ioctl for device
    error: GPGME error: Inappropriate ioctl for device
    error: GPGME error: Inappropriate ioctl for device
    error: GPGME error: Inappropriate ioctl for device
    error: GPGME error: Inappropriate ioctl for device
    error: GPGME error: Inappropriate ioctl for device
    error: GPGME error: Inappropriate ioctl for device
    error: GPGME error: Inappropriate ioctl for device
    error: GPGME error: Inappropriate ioctl for device
    error: GPGME error: Inappropriate ioctl for device
    error: GPGME error: Inappropriate ioctl for device
    error: GPGME error: Inappropriate ioctl for device
    error: GPGME error: Inappropriate ioctl for device
    error: GPGME error: Inappropriate ioctl for device
    error: GPGME error: Inappropriate ioctl for device
    error: GPGME error: Inappropriate ioctl for device
    error: GPGME error: Inappropriate ioctl for device
    error: GPGME error: Inappropriate ioctl for device
    error: chromaprint: missing required signature
    error: ethtool: missing required signature
    error: gettext: missing required signature
    error: gpgme: missing required signature
    error: libassuan: missing required signature
    error: libldap: missing required signature
    error: libnl: missing required signature
    error: libpcap: missing required signature
    error: libreoffice-en-GB: missing required signature
    error: python: missing required signature
    error: libreoffice-common: missing required signature
    error: libreoffice-base: missing required signature
    error: libreoffice-calc: missing required signature
    error: libreoffice-draw: missing required signature
    error: libreoffice-gnome: missing required signature
    error: libreoffice-impress: missing required signature
    error: libreoffice-math: missing required signature
    error: libreoffice-postgresql-connector: missing required signature
    error: libreoffice-sdk: missing required signature
    error: libreoffice-sdk-doc: missing required signature
    error: libreoffice-writer: missing required signature
    error: linux: missing required signature
    error: linux-headers: missing required signature
    error: lirc-utils: missing required signature
    error: live-media: missing required signature
    error: lsof: missing required signature
    error: man-pages: missing required signature
    error: net-snmp: missing required signature
    error: systemd: missing required signature
    error: wpa_supplicant: missing required signature
    error: networkmanager: missing required signature
    error: opencv: missing required signature
    error: syslog-ng: missing required signature
    error: systemd-sysvcompat: missing required signature
    error: totem-plparser: missing required signature
    error: tzdata: missing required signature
    error: xfce4-eyes-plugin: missing required signature
    error: xfdesktop: missing required signature
    error: libtaginfo: missing required signature
    error: xnoise: missing required signature
    error: failed to commit transaction (invalid or corrupted package (PGP signature))
    Errors occurred, no packages were upgraded.
    i tried
    sudo pacman -Syu --gpgdir /etc/pacman.d/gnupg
    but no change
    is there a way to install the updates without signature or find the missing signatures?
    thanks
    ezik
    Last edited by shulamy (2013-03-11 19:04:16)

    SigLevel = Never  worked
    but now it says there is no disk space when 14 of 22 GB is free.
    [root@localhost /]# sudo pacman -S linux
    resolving dependencies...
    looking for inter-conflicts...
    error: could not open file /var/lib/pacman/local/linux-3.8.1-1/desc: No such file or directory
    Targets (1): linux-3.8.2-1
    Total Installed Size: 62.10 MiB
    Proceed with installation? [Y/n] y
    (1/1) checking package integrity [######################] 100%
    (1/1) loading package files [######################] 100%
    (1/1) checking for file conflicts [######################] 100%
    error: could not determine filesystem mount points
    error: not enough free disk space
    error: failed to commit transaction (unexpected error)
    Errors occurred, no packages were upgraded.
    ezik

  • Help on dropdown jTextField

    package ui;
    import entity.*;
    import ui.*;
    import database.*;
    import controller.*;
    import javax.swing.JFrame;
    import javax.swing.JMenuItem;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    import javax.swing.JPopupMenu;
    import java.awt.BorderLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.util.ArrayList;
    import javax.swing.JTextField;
    import javax.swing.JButton;
    import javax.swing.JList;
    public class UpdateForm {
         private JFrame jFrame = null; // @jve:decl-index=0:visual-constraint="65,24"
         private JPanel jContentPane = null;
         private JTextField jTextField = null;
         private JTextField jTextField1 = null;
         Guest guest;
         private JTextField text;
         final JPopupMenu menu = new JPopupMenu();
         private ArrayList<Guest> guestList;
         private UpdateController update = new UpdateController();
         private JButton jButton = null;
         * This method initializes jFrame     
         * @return javax.swing.JFrame     
         private JFrame getJFrame() {
              if (jFrame == null) {
                   jFrame = new JFrame();
                   jFrame.setSize(new java.awt.Dimension(531,334));
                   jFrame.setContentPane(getJContentPane());
              return jFrame;
         * This method initializes jContentPane     
         * @return javax.swing.JPanel     
         private JPanel getJContentPane() {
              if (jContentPane == null) {
                   jContentPane = new JPanel();
                   jContentPane.setLayout(null);
                   jContentPane.add(getJTextField(), null);
                   jContentPane.add(getJTextField1(), null);
                   jContentPane.add(getJButton(), null);
              return jContentPane;
         * This method initializes jTextField     
         * @return javax.swing.JTextField     
         private JTextField getJTextField() {
              if (jTextField == null) {
                   jTextField = new JTextField();
                   jTextField.setBounds(new java.awt.Rectangle(49,29,225,20));
                   jTextField.addKeyListener(new java.awt.event.KeyAdapter() {
                        public void keyReleased(java.awt.event.KeyEvent e) {
                             haha(); // TODO Auto-generated Event stub keyReleased()
              return jTextField;
         public void haha(){
              menu.setVisible(false);
              menu.removeAll();
              String name = jTextField.getText();
              if(name!=null&&name.trim().length()>0){
                   guestList = CreateController.getAllGuest();     
                   for (int i = 0; i <guestList.size(); i++) {
                        JMenuItem item = new JMenuItem(name+" : "+i);
                        item.addActionListener(new CustomActionListener(i));
                        Guest s = new Guest(name, null);
                        UpdateController cc = new UpdateController();
                        menu.add(s.getname());
              menu.show(jTextField, jTextField.getLocation().x-jTextField.getWidth(), jTextField.getLocation().y+jTextField.getHeight());
              jTextField.requestFocus();
         public class CustomActionListener implements ActionListener{
              private int index;
              public CustomActionListener(int index){
                   this.index=index;
              public void actionPerformed(ActionEvent e) {
                   System.out.println(" Index : "+index);
         * This method initializes jTextField1     
         * @return javax.swing.JTextField     
         private JTextField getJTextField1() {
              if (jTextField1 == null) {
                   jTextField1 = new JTextField();
                   jTextField1.setBounds(new java.awt.Rectangle(65,156,194,20));
              return jTextField1;
         * This method initializes jButton     
         * @return javax.swing.JButton     
         private JButton getJButton() {
              if (jButton == null) {
                   jButton = new JButton();
                   jButton.setBounds(new java.awt.Rectangle(395,96,77,30));
                   jButton.setText("get");
                   jButton.addActionListener(new java.awt.event.ActionListener() {
                        public void actionPerformed(java.awt.event.ActionEvent e) {
                             getinformation(); // TODO Auto-generated Event stub actionPerformed()
              return jButton;
    public void getinformation(){
         String name = getJTextField().getText();
         System.out.println(name);
         if (name.equals(""))
              JOptionPane.showMessageDialog(null, "Please enter user id!");
         else{
              guest = new Guest(name,null);
              UpdateController update = new UpdateController();
              if (guest.retrieveGuest()){
                   jTextField1.setText(guest.getic_no());
              System.out.println(guest.getic_no());
              else{
                   JOptionPane.showMessageDialog(null, "Record does not exist!");
         public static void main(String[]args){
              UpdateForm updateform = new UpdateForm();
              updateform.getJFrame().setVisible(true);
    i am trying to make the Textfield dropdown the values from my database which colum is name.currently the menu only displays out what i am typing and does not search for related values in the column to whatver i am typing.what corrections are needed so that the jTxtfield will search the values in database column under name and display out related stuffs while i start entering on the jTextField. this is my entity class
    package entity;
    import java.sql.ResultSet;
    import java.util.*;
    import ui.*;
    import controller.*;
    import database.DBController;
    public class Guest {
    private String name;
    private String ic_no;
    private String handphone_no;
    private String dob;
    private String country;
    private String gender;
    private String house_phone;
    private String address;
    private String zipcode;
    private String photo;
    private String countrylist;
    private String genderlist;
    private String dob1;
    private String dob2;
    public Guest(String name,String ic_no,String handphone_no,String dob,String country,String gender,String house_phone,String address,String zipcode,String dob1,String dob2){
         this.name=name;
         this.ic_no=ic_no;
         this.handphone_no=handphone_no;
         this.dob=dob;
         this.country = country;
         this.gender = gender;
         this.house_phone=house_phone;
         this.address = address;
         this.zipcode=zipcode;
         this.dob1=dob1;
         this.dob2=dob2;
    public Guest(String name,String ic_no){
         this.ic_no=ic_no;
         this.name=name;
    public String getname(){
         return name;
    public void setname(String name){
         this.name=name;
    public String getic_no(){
         return ic_no;
    public void setic_no(String ic_no){
         this.ic_no=ic_no;
    public String gethandphone_no(){
         return handphone_no;
    public void sethandphone_no(String handphone_no){
         this.handphone_no=handphone_no;
    public String getdob(){
         return dob;
    public void setdob(String dob){
         this.dob=dob;
    public String getcountry(){
         return country;
    public void setcountry(String country){
         this.country=country;
    public String getgender(){
         return gender;
    public void setgender(String gender){
         this.gender=gender;
    public String gethouse_phone(){
         return house_phone;
    public void sethouse_phone(String house_phone){
         this.house_phone=house_phone;
    public String getaddress(){
    return address;
    public void setaddress(String address){
         this.address=address;
    public String getzipcode(){
         return zipcode;
    public void setzipcode(String zipcode){
         this.zipcode=zipcode;
    public String getphoto(){
         return photo;
    public void setphoto(String photo){
         this.photo=photo;
    public String getcountrylist(){
         return countrylist;
    public void setcountrylist(String countrylist){
         this.countrylist= countrylist;
    public String getgenderlist(){
         return genderlist;
    public void setgenderlist(String genderlist){
         this.genderlist=genderlist;
    public String getdob1(){
         return dob;
    public void setdob1(String dob1){
         this.dob1=dob1;
    public String getdob2(){
         return dob2;
    public void setdob2(String dob2){
         this.dob2=dob2;
    public boolean retrieveGuest(){
         boolean success = false;
         ResultSet rs = null;
         DBController db = new DBController();
         db.setUp("database");
         String dbQuery = "SELECT * FROM Guest WHERE name ='";
         dbQuery += name + "'" ;
         rs = db.readRequest(dbQuery);
         try{
              if (rs.next()){
                   ic_no = rs.getString("ic_no");
                   success = true;
         }catch (Exception e) {
              e.printStackTrace();
         db.terminate();
         return success;
    }

    You really need to follow AndrewThompson64 recommendation to use code tags,
    some indentation and comments would also be good, and put the explanation before the code.
    Your question is too difficult to read and understand!
    Are you trying to develop some kind of web browser AddressBar GUI ?
    That shows entries related to what the user is typing on the field, and also allows the user the select an item on the dropdown?
    If that's your case, I'll post an example code I developed here.

Maybe you are looking for

  • Add new item in Search Panel

    Requirement: Within a query region, add a new field to the results table and enable search by this field. Approach: - I added a new column within the results table by extending the VO. The search allowed property for this column is set to Yes. - I ad

  • Using Printer from main PC Upstairs,to labtop down...

    Hello,Everybody                                                   Hope someone can help with the following problem.I have a Dell PC Upstairs and a Dell Laptop which I use downstairs.I have a Canon MP210 Printer upstairs,which works fine with the PC b

  • HP 2510p WWAN (64bit) - has anybody got it working?!

    Hi I have an HP2510p with a WWAN onboard (03f0:171d). I googled it and tried different solutions (mostly ubuntu related) but haven't got any luck to get it going. Has anybody successfully installed a modem driver for that device? (64bit) Cheers Last

  • Help please resetting a listener

    Hi, Im trying to create a game for my 1 year old in flash that shows a letter on the screen. He has to press that letter on the keyboard to move on to the next letter. So far Ive got this...(for letter a) Code: stop (); var myListener:Object = new Ob

  • WinXp SP3 (32bit OS) paging file peaks and locks up Captivate

    We recently installed Captivate 4 on one of Windows XP SP3 (32bit OS).  When the user is using text to voice tool, the pageing file started growing and it peaks at 1.85 GB and Captivate locks up.  The PC has 2 GB of Physical memory.  I had chaned the