My JTable wont update can someone plz help

My JTable is supposed to change betwen method visRes() and visV�relser() but when one of them is picked from another file the JTable wont change to the other method...can someone help?
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
import javax.swing.table.*;
public class Opslag extends JFrame
Reservation hentRes;
V�relse hentV�relse;
Object[][]data;
String[]panelTekst;
JTable table;
JScrollPane scrollPane;
public Opslag(Reservation r,V�relse v)
          hentRes = r;
          hentV�relse = v;
public void visRes()
     data = new Object[hentRes.t�ller()][8];
panelTekst = new String[8];
          panelTekst[0] = "Res Nr";
          panelTekst[1] = "G�steNr";
          panelTekst[2] = "V�relsesNr";
          panelTekst[3] = "Udl Start";
          panelTekst[4] = "Udl Slut";
          panelTekst[5] = "Check Ind";
          panelTekst[6] = "Check Ud";
          panelTekst[7] = "Res Dato";
table = new JTable(data, panelTekst);
scrollPane = new JScrollPane(table);
getContentPane().add(scrollPane, BorderLayout.CENTER);
table.setEnabled(false);
//table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
try {
ConnectDB db = new ConnectDB( "jdbc:interbase://localhost/C:/Documents and Settings/aslan/Skrivebord/modelKomponent/HOTEL.GDB", "sysdba", "masterkey" );
ResultSet row = db.select( "SELECT * FROM RESERVATION" );
          for(int i=0;row.next();i++)
          int ii = 0;
          data[i][ii] = row.getString("RESNR");
          ii++;
          data[i][ii] = row.getString("GAESTENR");
          ii++;
          data[i][ii] = row.getString("VAERNR");
          ii++;
          data[i][ii] = row.getString("DATOUDLSTART");
          ii++;
          data[i][ii] = row.getString("DATOUDLSLUT");
          ii++;
          data[i][ii] = row.getString("DATOCHECKIND");
          ii++;
          data[i][ii] = row.getString("DATOCHECKUD");
          ii++;
          data[i][ii] = row.getString("DATORES");
          ii++;
} catch (SQLException e)
catch(NullPointerException a)
public void visV�relser()
          data = new Object[hentV�relse.t�ller()][11];
panelTekst = new String[11];
          panelTekst[0] = "V�relse Nr";
          panelTekst[1] = "Type";
          panelTekst[2] = "Res Nr";
          panelTekst[3] = "Status";
          panelTekst[4] = "Havudsigt";
          panelTekst[5] = "Sal";
          panelTekst[6] = "Gang Nr";
          panelTekst[7] = "Pris";
          panelTekst[8] = "St�rrelse";
          panelTekst[9] = "Stil";
          panelTekst[10] = "Antal bad";
table = new JTable(data, panelTekst);
scrollPane = new JScrollPane(table);
getContentPane().add(scrollPane, BorderLayout.CENTER);
table.setEnabled(false);
//table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
try {
ConnectDB db = new ConnectDB( "jdbc:interbase://localhost/C:/Documents and Settings/aslan/Skrivebord/modelKomponent/HOTEL.GDB", "sysdba", "masterkey" );
ResultSet row = db.select( "SELECT * FROM VAERELSE" );
          for(int i=0;row.next();i++)
          int ii = 0;
          data[i][ii] = row.getString("VAERELSENR");
          ii++;
          data[i][ii] = row.getString("TYPEN");
          ii++;
          data[i][ii] = row.getString("RESNR");
          ii++;
          data[i][ii] = row.getString("VAERELSESTATUS");
          ii++;
          data[i][ii] = row.getString("HAVUDSIGT");
          ii++;
          data[i][ii] = row.getString("SAL");
          ii++;
          data[i][ii] = row.getString("STEDGANG");
          ii++;
          data[i][ii] = row.getString("PRIS");
          ii++;
          data[i][ii] = row.getString("STORRELSE");
          ii++;
          data[i][ii] = row.getString("STIL");
          ii++;
          data[i][ii] = row.getString("ANTALBAD");
          ii++;
} catch (SQLException e)
catch(NullPointerException a)
}

        public void visG�ster()
         data = new Object[hentG�st.t�ller()][11];
        panelTekst = new String[11];
          panelTekst[0] = "G�steNr";
          panelTekst[1] = "Type";
          panelTekst[2] = "Navn";
          panelTekst[3] = "Efternavn";
          panelTekst[4] = "Adresse";
          panelTekst[5] = "Tlf";
          panelTekst[6] = "Antal Res";
          panelTekst[7] = "Idnr";
          panelTekst[8] = "Firma";
          panelTekst[9] = "CVR";
          panelTekst[10] = "Rabat";
        table = new JTable(data, panelTekst);
        if (scrollPane != null)
            getContentPane().remove(scrollPane);
        scrollPane = new JScrollPane(table);
        scrollPane.revalidate();
        getContentPane().add(scrollPane, BorderLayout.CENTER);
        table.setEnabled(false);
        this.pack();
        table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
        table.getColumnModel().getColumn(0).setPreferredWidth(60);
        table.getColumnModel().getColumn(1).setPreferredWidth(60);
        table.getColumnModel().getColumn(2).setPreferredWidth(60);
        table.getColumnModel().getColumn(3).setPreferredWidth(60);
        table.getColumnModel().getColumn(4).setPreferredWidth(150);
        table.getColumnModel().getColumn(5).setPreferredWidth(80);
        table.getColumnModel().getColumn(6).setPreferredWidth(60);
        table.getColumnModel().getColumn(7).setPreferredWidth(60);
        table.getColumnModel().getColumn(8).setPreferredWidth(100);
        table.getColumnModel().getColumn(9).setPreferredWidth(100);
        table.getColumnModel().getColumn(10).setPreferredWidth(60);
        try {
        ConnectDB db = new ConnectDB( "jdbc:interbase://localhost/C:/Documents and Settings/aslan/Skrivebord/modelKomponent/HOTEL.GDB", "sysdba", "masterkey" );
        ResultSet row = db.select( "SELECT * FROM GAEST" );
        int type = 0;
                  for(int i=0;row.next();i++)
                      int ii = 0;
                      data[i][ii] = row.getString("GAESTENR");
                      ii++;
                      data[i][ii] = row.getString("TYPEN");
                      ii++;
                      data[i][ii] = row.getString("NAVN");
                      ii++;
                      data[i][ii] = row.getString("EFTERNAVN");
                      ii++;
                      data[i][ii] = row.getString("ADRESSE");
                      ii++;
                      data[i][ii] = row.getString("TLF");
                      ii++;
                      data[i][ii] = row.getString("ANTALRESERVATION");
                      ii++;
                      type = row.getInt("TYPEN");
                if(type == 1)
                         ResultSet row2 = db.select(" SELECT * FROM PRIVATGAEST ");
                         while(row2.next())
                              data[i][ii] = row2.getString("IDNR");
                              ii++;
                    else if(type == 0)
                         ResultSet row3 = db.select(" SELECT * FROM ERHVERVSGAEST ");
                         while(row3.next())
                              data[i][ii] = row3.getString("FIRMA");
                              ii++;
                              data[i][ii] = row3.getString("CVR");
                              ii++;
                              data[i][ii] = row3.getString("RABAT");
                              ii++;
            } catch (SQLException e)
                 System.out.println(e);
            catch(NullPointerException a)
                  System.out.println(a);
        }

Similar Messages

  • I keep the itunes encountered a problem and needs to shut down . it was working fine until after i updated to 10.5 can someone plz help

    i keep the itunes encountered a problem and needs to shut down . it was working fine until after i updated to 10.5 can someone plz help

    I did get a "server busy" message when I loaded quicktime, but I'm not sure if it is related or not since I've been seeing that over the last couple of days, I can't remember if it came before iTunes stopped working or not. That message reads "This action cannot be completed because the other program is busy. Choose 'switch to' to activate the busy program and correct the problem." My options then are to choose switch to or retry. When I press "switch to" my Start menu opens, and nothing appears to happen when I select retry.
    that's an odd sort of a message (or series of messages).
    hmmmmm. let's try an experiment aimed at working out if there's a program interfering with the QuickTime (which is in turn causing grief with your iTunes).
    try a selective startup using MSCONFIG, with just the itunes and QuickTime background processes enabled, as per the following document:
    Using MSCONFIG to troubleshoot conflicts in Windows
    does QT open without the strange message after the selective startup?
    does iTunes launch properly?

  • I wen to update my ipad to the iOS7, but then it went into recovery and wont restore, can someone please help me figure out how to restore it?

    i went to update my ipad to the iOS7, but then it went into recovery and wont restore, can someone please help me figure out how to restore it?

    Follow step 1 to step 3 very closely.
    http://support.apple.com/kb/HT1808

  • Hello. I have problem here can someone plz help. I have usb of 32 gb but i have problem with it while i was trying to partition of it and it fails and my usb disappear from finder and desktop i have tried every possible thing but nothing  works .

    Hello. I have problem here can someone plz help. I have usb of 32 gb but i have problem with it while i was trying to partition of it and it fails and my usb disappear from finder and desktop i have tried every possible thing but nothing  works .

    Yea i tried in disk utility and its got faiiled and the partitation has deleted and when i tried  to replug the  usb  msg show up by saying  usb not compaitnle. With this mac  and  take me to disk utility  and thanks for replying

  • I uninstalled firefox and tried reinstalling it but it wont install can someone please help

    i uninstalled firefox and tried reinstalling it but it wont install can someone please help

    Boot the computer in Windows Safe Mode with network support (press F8 on the boot screen) as a test to see if that helps to install Firefox.
    You may need to re-download a new Firefox copy.
    *http://www.mozilla.org/en-US/firefox/all.html

  • Okay every time i plug my ipod up to my laptop a message comes up and says one of the USB devices attached to this computer has malfunctioned, and Windows does not recognize it. Can someone plz help me ive done everything.

    I really need assistance/help with my ipod because it was working fine one day. Then the next day i decide to put more music on it then this message came up, and ive tried all the troubleshooting stuff and different links to help but still no success. But theres one thing i havent tried yet someone told me to buy another Apple charger and wall plug in to see if that works other than that i need help because i went to settings and erased everything off my ipod to see if that worked and it didnt so all my stuff is gone....Yeah i was ****** but plz help me!

    I would first try unplugging All the USB devices plugged into your computer, and then plug back in just the iPhone and see if that is recognized.  Also, do you have the latest version of iTunes for Windows installed on your PC, as you need to?
    Hope this helps

  • I logged in to itunes and ito download some music and accidently clicked dont show this message again to the 10.6.3 update can someone PLEASE help me i cant put songs from itunes on to my ipod now until i get the update

    i logged on to itunes to download some music on to my ipod touch and accidently clicked "do not show me this message again" and the message was for the itune update 10.6.3 now i cant put music off itunes to my ipod touch someone please help me!!!!!!!!

    Download/install the latest iTunes here:
    http://www.apple.com/support/itunes/

  • Itunes error message can someone plz help.

    Hello I have uninstalled and then reinstalled itunes multiple times and I keep getting this following message. "The instruction at "0x00ed408c" referenced "0x00ed408c". The memory could not be "written".Click OK to terminate the programnced at " Can someone please kindly help me on how to resolve this issue so I can start using itunes again. Thank you so much.

    Hi!
    I had the exact same issue, being on a mac. If you are on a mac and the connection error message occurs, then use this link http://fpdownload.macromedia.com/pub/flashplayer/latest/help/install_flash_player_osx.dmg
    It allows you to download it offline, which is what I used.
    Hope I was help!
    -Haroon

  • Can someone PLZ help me out?

    I have just installed win 2k on pc after havin a nightmare with xp - games crashing etc. Here is the new problem. I installed all the drivers etc no problem, changed the res to 1152x864 and the 32bit colour and then installed half life cs (favorite game) ready for some internet gaming and it worked fine. However its not exactly a demanding game so just to make sure graphics worked ok i installed bond 007 nightfire and ran it and the "Failed to initialize Direct 3D, Please ensure direct x 8.1 or newer is installed and/or video drivers are upto date"
    (i have 8.1)
    So i decided to have another look at drivers and i noticed that  AGP Traffic was not ticked (enabled) and neither SBA enable, also neither were any of 1x 2x or 4x.
    Now im no expert on pc's by far but i know these were ticked on xp, and i try to tick them and they wont tick, SBA will but it says restart so i do and it doesnt change it still. (remains unticked) SO i installed the latest drivers from the Nvidia site and bond worked ok but then i tried CS and all walls were see thru and it cocked the game up, so i have no idea what to do - PLZ HELP ME?!  ?(
    BTW i have a Ti4200 128mb graphics card. Anything else u experts need to know?

    site - http://www.ecs.com.tw/
    board - Elite (ecs) - K7VTA3
    and the options are
    Motherboard Series
    BIOS
    Drivers
    User's Manual
    Aio Series
    BIOS
    Drivers
    User's Manual
    Book PC II Series
    BIOS
    Drivers
    DeskNote Series
    BIOS
    Drivers
    User's Manual
    VGA Card
    BIOS
    Drivers

  • IM TRYING TO FIGURE OUT WHY MY IMAC KEEPS FREEZING ON THE OPTIONS TO CHANGE MY WALL PAPER CAN SOMEONE PLZ HELP ME?

    im trying to just change my wallpaper on my brand new imac and when i try to change it it freezes on the option screen. plz help me

    I suggest you change the title of your question from upper case to lower case. Upper case is annoying.

  • Can someone Plz help me Y everyone won't help me

    Hi
    PLz Plz Plz can you help me with this
    Exception in thread "main" java.lang.NoClassDefFoundError: ClassFileName
    Here what happen i use to run JDk1.3 now after I started to learn Swing (Two days ago) they ask me to get the latest version of JDk so i did version 1.3.1
    After the installation of JDK1.3.1
    I started writing java code AWT, then Swing
    I have no problem trying to complie but when I try to run the Class file it give me the error.
    I tryed all my old java program that work be4 the installation and now they all said the same thing.
    So Plz Tell me what to do Plz and tell me about duke $ as I think that what make all of u answers ppl question now aday on this site :( .

    i just find out i have 2 ver of java install on the same Os will that crash the Java when i try to run java nameofFile.class
    i got Java2 SDK Standard Edition 1.3
    and
    java2 SDK Runtime Environment Standard Edition v1.3
    can anyone tell me which is the best one cos the JAVA SDK standard Edition v1.3 is the one i use for my study at UNI
    and should i remove one of them. I have the BrezzyGUI from the Standard Edition and i don't think the folder is in the java Runtime Environment Standard Edition v1.3
    Ps: do i need to reboot every time i change the path and the class path.
    Thank again for the suggestion. PPl have given me many version of Path and ClassPath and they all different.
    :( so i don't know which one i should use and yeah i know i have to set the path the the bin dir in the java folder but what i mean is the .\ and "." and *.*
    %ClassPath% ????? what do they all do
    "." i seen in the Doc for install the java path on this site
    and .\ as the MSG above, *.* some other guy i can't remeber which is correct and which is not.
    This path and ClassPath thing is confusing me and it make me mad !@#$ !!!
    Sorry about that hehe but I'm very tired of this Exception error I try everything PPl have told me but none seems to fix my error
    .lang.NoClassdefFile Error: :( stupid java or it my Com hehe blame on everythings first be4 looking at the problem. :)

  • The sound on itunes will not play properly can someone plz help me.

    Hi, i am haveing trouble using itunes.
    when i try to play any music files it either wont play or it will sound static, i have no trouble with windows media this works fine. I have gone to the help site and that has been no help to me at all. the other thing i should mention is that i do have an external sound rack.
    Dose any one have any ideas of what i can do.
    Cheers
    D.
    pentium 4   Windows XP  

    site - http://www.ecs.com.tw/
    board - Elite (ecs) - K7VTA3
    and the options are
    Motherboard Series
    BIOS
    Drivers
    User's Manual
    Aio Series
    BIOS
    Drivers
    User's Manual
    Book PC II Series
    BIOS
    Drivers
    DeskNote Series
    BIOS
    Drivers
    User's Manual
    VGA Card
    BIOS
    Drivers

  • Airplay icon not appearing on Macbook Air (mid 2011). Everything is updated, can someone please help me out??

    Hey, so I just bought an Apple TV specifically to mirror my Macbook Air screen to my TV.
    My Mac is mid 2011 so it whould be working, I'm wondering if there is a setting I have missed or something?
    All other functions are working except the Airplay icon is not showing on my toolbar??
    Anybody know how I can fix this??

    According to other discussion threads I need Mountain Lion? I'm on 10.7.5 is that Lion? My Mac says I have no new software updates though? So confused!

  • Hi ... Can someone plz help ... I have purchased items on ebay, and my computer will not proceed from ebay to paypal to chekout (pay).

    I have contacted my internet security, and through remote connection they said there was no problem with that so I should contact Ebay and Firefox. I contacted Ebay and there is no problem there. I know its not my accounts because I am able to check out using other computers and my phone ... Please HELP :)

    Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache":
    *Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    You can also check the network.http.* prefs and reset all bold user set network.http prefs to the default value (network.http.proxy.keep-alive should be true) via the right-click context menu > Reset.
    *http://kb.mozillazine.org/about:config
    See also:
    *https://support.mozilla.org/kb/Resetting+preferences

  • TS1702 I loaded google search and can not find the icon....can someone plz help me explain how i can locate it? Or unhide it? If i do a search on the ipad i can see it there, but other than that, there is no icon.

    I loaded "google search" on my ipad 2 frm the app store 2nite &amp; can not find the icon....if there is not an icon - how can i delete it from my ipad? Thx

    You want your user library
    Mac(user)/Library/Application Support/Adobe/Camera Raw/Settings
    In finder click on Go then hold down the Option key and then click on Library

Maybe you are looking for

  • Can I put Mail and Address book from my backed up dead Mac to my new one

    My powerpc G5 Imac just died. It was completely backed up to Mozy, and I would like to restore my Mail and Address book from that machine on the new Snow Leopard machine I bought today. Is that possible?

  • How to get the user view

    Hi, Can anyone say how to get the user view of a user logged in through admin interface. I have tried to get the roles of logged in user as below: <ref>waveset.roles</ref> it did not work.. Please suggest

  • Invoice posting tables?

    Any idea on what tables I need to be interogating in SQ01 to identify what invoices were paid in a given month for a particular currency? Thanks

  • 1.0.3 status LED behavior changed

    1. When ejected either in iTunes or Finder, status LED IMMEDIATELY switches to green. 2. Unchecking "enable disk use" (and clicking Apply) does NOT affect blinking orange LED either in iTunes or out of it. Thus there's no REAL indicator of charge sta

  • Business Logic in Taghandler methods???

    Hi, Is there any reason that the business operation(logic) in a TagHandler class should take place in a doEndTag() for TagSupport class and doAfterBody() in BodyTagSupport class? If so, why it can't be done in the doStartTag() and doInitBody() ? Than