Where are my columnheader in JTable with model?

I have drawn a JTable in a form with JBuilder and use the following code. The table is fiiled properly but I don't see the columnheaders.
How can i make them visible?
DefaultTableModel model = new DefaultTableModel();
model.addColumn("Bezoeker_id");
model.addColumn("Voorletters");
model.addColumn("Tussenvoegsel");
model.addColumn("Achternaam");
model.addColumn("Adres");
model.addColumn("Postcode");
model.addColumn("Woonplaats");
model.addColumn("Telefoonnummer");
DataInputStream dis = null;
String record = null;
int recCount = 0;
try
FileInputStream fis = new FileInputStream("C:\\BEZOEKER.dat");
BufferedInputStream bis = new BufferedInputStream(fis);
dis = new DataInputStream(bis);
while ( (record=dis.readLine()) != null )
if (recCount > 0)
String[] items = record.split("\t");
model.addRow(items);
recCount++;
catch (IOException ie)
finally
// if the file opened okay, make sure we close it
if (dis != null)
try
dis.close();
catch (IOException ioe)
jTable1.setModel(model);
[b/]

Here is the whole class. The JTabvle is inside a scrollpane but the columnheader still aren't visible. Any idea?
package thuiszorg;
import java.awt.BorderLayout;
import javax.swing.JFrame;
import javax.swing.JButton;
import java.awt.*;
import javax.swing.JTable;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.*;
import java.util.ArrayList;
import javax.swing.table.DefaultTableModel;
import javax.swing.JScrollPane;
import javax.swing.JPanel;
import javax.swing.table.*;
import javax.swing.JScrollBar;
import javax.swing.JPanel;
* <p>Title: Thuiszorg</p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2007</p>
* <p>Company: Avans</p>
* @author DT2-I4-Groep2
* @version 1.0
public class FrameMain extends JFrame {
    public FrameMain() {
        try {
            jbInit();
        } catch (Exception exception) {
            exception.printStackTrace();
    private void jbInit() throws Exception {
        getContentPane().setLayout(null);
        this.setJMenuBar(null);
        this.setResizable(false);
        this.setState(Frame.ICONIFIED);
        this.setTitle("Test");
        jButton2.setBounds(new Rectangle(20, 120, 120, 23));
        jButton2.setText("Hulpmiddelen");
        jButton1.setBounds(new Rectangle(19, 218, 120, 23));
        jButton1.setText("Facturen");
        jButton4.setBounds(new Rectangle(18, 186, 120, 23));
        jButton4.setText("Verhuren");
        jButton3.setBounds(new Rectangle(20, 154, 120, 23));
        jButton3.setText("Hulpmiddelsoorten");
        cmdBezoekers.addActionListener(new FrameMain_cmdBezoekers_actionAdapter(this));
        jTable1.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
        scrollPane1.setBounds(new Rectangle(181, 86, 590, 358));
        this.getContentPane().add(cmdBezoekers);
        this.getContentPane().add(jButton2);
        this.getContentPane().add(jButton3);
        this.getContentPane().add(jButton4);
        this.getContentPane().add(jButton1);
        this.getContentPane().add(scrollPane1);
        scrollPane1.add(jTable1);
        cmdBezoekers.setBounds(new Rectangle(18, 85, 120, 23));
        cmdBezoekers.setText("Bezoekers");
    public static void main(String[] args) {
        FrameMain framemain = new FrameMain();
        framemain.setSize(800, 600);
        framemain.show();
    JButton jButton2 = new JButton();
    JButton cmdBezoekers = new JButton();
    JButton jButton3 = new JButton();
    JButton jButton4 = new JButton();
    JButton jButton1 = new JButton();
    JTable jTable1 = new JTable();
    ScrollPane scrollPane1 = new ScrollPane();
    public void cmdBezoekers_actionPerformed(ActionEvent e) {
        ArrayList arr = new ArrayList();
        ArrayList arrItem = new ArrayList();
        //DefaultTableModel model = new DefaultTableModel();
        DefaultTableModel model = new DefaultTableModel()
            public boolean isCellEditable(int row, int column) {
                return false ;
        model.addColumn("Bezoeker_id");
        model.addColumn("Voorletters");
        model.addColumn("Tussenvoegsel");
        model.addColumn("Achternaam");
        model.addColumn("Adres");
        model.addColumn("Postcode");
        model.addColumn("Woonplaats");
        model.addColumn("Telefoonnummer");
        DefaultTableModel f = (DefaultTableModel)jTable1.getModel();
                        f.addColumn("YourName1");
                        f.addColumn("YourName2");
                        f.addColumn("YourName3");
        int listCount = 0;
        DataInputStream dis = null;
        String record = null;
        int recCount = 0;
        try {
            FileInputStream fis = new FileInputStream("C:\\BEZOEKER.dat");
            BufferedInputStream bis = new BufferedInputStream(fis);
            dis = new DataInputStream(bis);
            while ((record = dis.readLine()) != null) {
                if (recCount > 0) {
                    Bezoeker persoon = new Bezoeker();
                    String[] items = record.split("\t");
                    // persoon.SetBezoekerId((int)items[0]);
                    persoon.SetVoorletters(items[1]);
                    persoon.SetTussenvoegsel(items[2]);
                    persoon.SetAchternaam(items[3]);
                    persoon.SetAdres(items[4]);
                    persoon.SetPostcode(items[5]);
                    persoon.SetWoonplaats(items[6]);
                    persoon.SetTelefoonNummer(items[7]);
                    model.addRow(items);
                recCount++;
        } catch (IOException ie) {
        } finally {
            // if the file opened okay, make sure we close it
            if (dis != null) {
                try {
                    dis.close();
                } catch (IOException ioe) {
       jTable1.setModel(model);
        //JScrollPane myScrollPane = new JScrollPane(jTable1);;
        this.getContentPane().add(scrollPane1);
class FrameMain_cmdBezoekers_actionAdapter implements ActionListener {
    private FrameMain adaptee;
    FrameMain_cmdBezoekers_actionAdapter(FrameMain adaptee) {
        this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e) {
        adaptee.cmdBezoekers_actionPerformed(e);
}

Similar Messages

  • Where are imac apple computers available with the matt display?...

    Where are imac apple computers available with the matt display?...

    You would need to find a 3rd party authorized vender who may be installing some sort of matte display. Or there are kits on the market to apply a matte finish to your display. AFAIK, all Macs have glossy finished displays.
    Dah•veed

  • HT4527 Where are the music I transferred with the Migration Assistant?

    I used the Migration Assistant to move my music library on iTunes to a new one, and both my new Macbook and old computer said the music transfer worked. However, I can´t seem to find the music files on my Mac that I wanted to transfer. Where are they, and how can I move them into iTunes?

    Log out, log in to the migrated account, locate the music, drag it to the /Users/Shared/ folder, and from there to the first account's home folder.
    (83471)

  • Where are jar files downloaded to with Applet?

    I have an Applet and am using archive attribute in my applet tag to specify jar files needed by the applet. eg: "archive=myclassfiles.jar, foo.jar". Assume that myclassesfiles.jar has classes needed by the Applet and Foo.jar has some text files or xml files. Assume that Applet is signed.
    My question: I am assuming that all jar files are downloaded to the client when the Applet is started. Is this correct? If so, how can I open and read Foo.jar file within the Applet? I dont know the path to that file, that is, I dont know where on the client that Jar file has been downloaded to. Would the following work:
    URL aUrl = (new File("Foo.jar")).toURL();
    String path = aUrl.toString();
    would path point to the correct location of Foo.jar?

    They are downloaded to the client, and stored in a cache. I'm not sure they are readable from within the applet, however. But there are 2 solutions, depending on what you are doing.
    1) You want to get some images or other resources from the Jar file. Then do this:
    URL url = appletClass.getClass().getResource("myimage.jpg");
    ImageIcon icon = new ImageIcon(url);
    where appletClass is the applet object, and the resource ("myimage.jpg" is the relative path to the image in the Jar file.
    2) You want to muck around with the Jar (read it). Well you can't write to it that easily in an applet, as you can't access the file system without a signed applet, or you would have to POST it back to the web server via HTTP file upload. But if you want to just read it and get stuff out of it, you can always just do this:
    URL url = new URL(getDocumentBase(), "foo.jar");
    and then open the URLConnection for that URL and read the Jar in.

  • Where are the examples that come with the Java3D tutorial?

    In Chapter 0, it says that this tutorial comes with PDF, sample codes, and examples, but I can't find the examples, anyone knows where I can get it?
    Thanks,
    Andy

    http://java.sun.com/products/java-media/3D/collateral/
    Look for this line:
    Download complete tutorial (3.0MB zip or 4.1MB tar) and examples (325Kb zip or 336Kb tar).
    you can click on examples and that should be them. It is near the top of the page.

  • Where are the sent mails - sync with IMAP

    I am wondering, where my BB Z10 transfer my sent emails. I not see them in a folder like sent, wich I sync from my IMAP server.
    Doe's somebody have any suggestion or tip, how I can change this?
    Kindly Simon

    it works on my GMail.
    what is the language of your IMAP server ?
    what is the exact name of your "sent items folder" when using the webmail ?
    what is the name of the same folder on your Z10 ?
    chances are, the two folders have a different name.
    please make sure that you have configured your Z10 to synchronize emails from all servers.
    The search box on top-right of this page is your true friend, and the public Knowledge Base too:

  • Where are original discs which come with macbook pro 15inch?

    I bought a macbook pro. The discs did not come in the box.
    What should i do in order to get the discs.

    There are no disks if it came with Lion installed.
    In the past the discs were only necessary for recovery. With Lion, you don't need disks for recovery, you restart your mac with Cmd-R held down when you power on. Be sure to be connected to the internet when you want to do a recovery.

  • Where are the files I printed with Adobe CreatPDF Desktop printer?

    When printing any MS files with the Adobe CreatePDF Desktop Printer, I don't know in which folder I must go to get the files. Any idea? Tks. Nicolas.
    Error message : documents in waiting lines

    Hi thimpl,
    Please refer to this FAQ link:Adobe CreatePDF Desktop Printer is no longer available
    Regards,
    Florence

  • HT4906 Where are the photos I took with my iPod

    I took some pictures with my new ipod touch. I also signed up for icloud.  I got home and thought I would see them on my Macbook Pro, but can't find them? I have iphoto 09 on my mac but no iphoto on my ipod.

    Photo stream requies IOS 5 on mobile devices, Lion version 10.7.3 or newer on Macs and iPhoto '11 vesion 9.2 or newer - iPhoto '09 does not support PhotoStream
    LN

  • Where are the pics ??

    I've just upgraded my mac with ilife 08 but i can't understand where are all my pictures. With FCP i'm not able to upload the pics in the program directly from iphoto08 (as i was doing with the old version) but i have to select the desired pictures before, dragging them in a folder on the desktop and then import in FCP. There is a faster way ? I can I select my pictures in FCP directly ?

    Your pictures are actually in your home folder/pictures/iphoto library and then organized by year, month and day. But since your media should not be on your system drive, it would be best to copy those pictures to you're media drive.

  • Where are the stamps files with their crazy names located in the Macintosh

    Hey
    I am looking for the files stamps with those crazy names. I work on a iMac OS X Tiger.
    I have created a stamp and found the corresponding file in "acrobat user data" but I want to create a dynamic stamp.
    I have found this tutorial :
    http://www.acrobatusers.com/tutorials/2007/custom_dynamic_stamp/
    very helpfull but I am unable to find the dynamic file they mention in this tutorial.
    I would like to know where are located the files, whith they coded names, corresponding to the models of stamps given by acrobat. Where are they located in the Macintosh ? I can't find them.

    for the existing stamps, go to where Acrobat has been installed, right-click or ctrl-click the Acrobat package and select 'Show package contents'.
    The browse to the following folder assuming you're using the English version of Acrobat:
    Contents/Plug-ins/Comments.acroplugin/Stamps/ENU/

  • Where are my photos on the PC after sync with an iphone?  I know nobody out there is stupid enough to suggest to me that they are encrypted and inaccessible, right?  Seriously?  How stupid would Apple corporation have to be to do something like this?

    Where are my photos on the PC after synching with an iphone?  I know nobody out there is stupid enough to suggest to me that they are encrypted and inaccessible, right?  Seriously?  How stupid would Apple corporation have to be to do something like this? That would be just as foolish as making my music unusable on the PC...
    Okay, Let's assume that Apple is indeed THAT foolish.......How does one get the photos from the phone to the PC and still use them?

    The photos are still on your phone, and if enabled in your Photo Stream. They are not automatically transferred to your computer when syncing.
    See iOS: Import personal photos and videos from iOS devices to your computer and iCloud: My Photo Stream FAQ
    tt2

  • Old computer I had is OSX Snow Leopard with Entourage. New one is OSX Mavericks. Using Mail where are my addresses and old address book. Transferred old computer backup by Time Machine and other things work? Can't see a symbol for address book.

    Old computer I had is OSX Snow Leopard with Entourage. New one is OSX Mavericks. Using Mail where are my addresses and old address book. Transferred old computer backup by Time Machine and other things work? Can;t see a symbol for address book.

    Where are addresses kept on MAIL?  I don;t like the new format at all. Frances
    Begin forwarded message:
    From: Frances Topping <[email protected]>
    Subject: Re: - Old computer I had is OSX Snow Leopard with Entourage. New one is OSX Mavericks. Using Mail where are my addresses and old address book. Transferred old computer backup by Time Machine and other things work? Can't see a symbol for address book.
    Date: August 25, 2014 at 9:46:01 AM EDT
    To: discussions-replies <[email protected]>
    Old Entourage is POP and new Mavericks MAIL  is IMAP I believe. I don;t know how to export in the forms you mention. Frances

  • Where are my books!? Sync-ed iTunes 10.6.3.25 on Win7 with new iPad3 WiFi/3G and iTunes shows (on my PC) that I have 590 "ebooks" (PDF's

    Not to repaet myself, but... where are my ebooks?
    I sync-ed iTunes 10.6.3.25 on Win7 with new iPad3 WiFi/3G and iTunes shows (on my PC) that I have 590 "ebooks" (PDF's & a few epub's) on my iPad, but for the life of me I can't seem to get to them on the iPad3 itself. If I open iTunes on the iPad3 it only shows a bland grey screen with a link to the "iTunes Stores Terms and Conditions…"? And my iBooks is empty, so is Acrobat Reader which I installed?
    What gives? Gulp… help!?

    That is troubling! 
    I downloaded the Kindle app on my iPad1 tonight, logged into my Amazon.com account and was able to download the books I had bought on my Kindle to my iPad!  I am a VERY HAPPY CAMPER!

  • When syncing ipod touch with mac, where are my contacts and notes stored on the computer?

    I lost all the notes on my ipod touch..
    When syncing the ipod touch with mac, where are these files stored.
    i.e. contacts and notes?

    It's all stored here.
    User > Library > Application Support > MobileSync > Backup
    Basic troubleshooting steps  
    17" 2.2GHz i7 Quad-Core MacBook Pro  8G RAM  750G HD + OCZ Vertex 3 SSD Boot HD 
    Got problems with your Apple iDevice-like iPhone, iPad or iPod touch? Try Troubleshooting 101
     In Memory of Steve Jobs 

Maybe you are looking for