Results 1 to 5 of 5
  1. #1
    elad_bj is offline Member
    Join Date
    Jan 2009
    Posts
    8
    Rep Power
    0

    Default Few Problems Help!

    Hi 1
    I'm Writing project in java and i have a few problems

    1) when i write new class in different file it's show me that it the calss is not exits and i don't know what to how to fix it
    2) how i convert an array to JTable or at least how i move all the data from the array to the JTable?
    3) i want to show JButton and i write it and all and i add it to the panel when i run the program it doen't appear why?

    thanks


    1) code:
    public void showNewWindow() {
    JFrame You = new myForm(); --------> the other class

    //Take care of the no window decorations case.
    //NOTE: Unless you really need the functionality
    //provided by JFrame, you would usually use a
    //Window or JWindow instead of an undecorated JFrame.
    if (noDecorations) {
    You.setUndecorated(true);
    }

    //Set window location.
    if (lastLocation != null) {
    //Move the window over and down 40 pixels.
    lastLocation.translate(40, 40);
    if ((lastLocation.x > maxX) || (lastLocation.y > maxY)) {
    lastLocation.setLocation(0, 0);
    }
    You.setLocation(lastLocation);
    } else {
    lastLocation = You.getLocation();
    }
    You.setSize(600,300);
    You.setVisible(true);
    }

    3) b1 = new JButton("Show Time Table");
    b1.setVerticalTextPosition(AbstractButton.CENTER);
    b1.setBackground(Color.white);
    b1.setFont(new Font("David", Font.BOLD, 24));
    b1.setHorizontalTextPosition(AbstractButton.LEADIN G); //aka LEFT, for left-to-right locales
    b1.setMnemonic(KeyEvent.VK_D);
    b1.setActionCommand("disable");
    b1.addActionListener(this);
    add(b1, BorderLayout.PAGE_END);

  2. #2
    elad_bj is offline Member
    Join Date
    Jan 2009
    Posts
    8
    Rep Power
    0

    Default

    first and third problems were solved

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,193
    Rep Power
    19

    Default

    For the second, read the API for JTable (and if you need to get fancy, for DefaultTableModel)

    db

  4. #4
    elad_bj is offline Member
    Join Date
    Jan 2009
    Posts
    8
    Rep Power
    0

    Default

    For the JTable data i used the function setValueAt() ...

    i have other problem ...

    when i write for exaple:

    Bina bina; Bina it's a class
    or
    Bina g = new Bina(values);

    it's show me "cannot find Symbol class Bina

    how i fix it?
    thnxs!

  5. #5
    mtyoung is offline Senior Member
    Join Date
    Dec 2008
    Location
    Hong Kong
    Posts
    473
    Rep Power
    6

Similar Threads

  1. having problems
    By pinkdiamondgail in forum New To Java
    Replies: 6
    Last Post: 02-06-2009, 11:35 PM
  2. Problems in JSP : Need help
    By raj4u in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 02-07-2008, 10:06 AM
  3. many to many problems
    By cecily in forum JDBC
    Replies: 1
    Last Post: 08-02-2007, 05:51 PM
  4. gui problems
    By bluebirdjc in forum Advanced Java
    Replies: 2
    Last Post: 07-23-2007, 05:38 PM
  5. problems with JPA
    By Ed in forum New To Java
    Replies: 2
    Last Post: 07-04-2007, 05:34 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •