Results 1 to 8 of 8
  1. #1
    Join Date
    Jun 2010
    Posts
    10
    Rep Power
    0

    Question Java Swing Problem

    :mad:


    Hii...
    i am designing a GUI using jframe/jswing in netbeans...

    i input some parameters using some textfields and a calculate button is provided..

    now if we press the calculate button i want the program to print a table whos number of rows and number of columns depend on the input in the text field...

    basically my problem is that i am unable to print tables dynaically..
    my program works fine if i pre decide the number of rows and columns and print that many outputs in them...


    can someone help out??

    i am not able to find that on internet as well
    i think if its possible to create a table on button click then i will be done...
    (because at that time i will be knowing the number of rows and number of columns as user inputs and then presses the button)

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,778
    Rep Power
    25

    Default

    i want the program to print a table
    Where is the table to be "printed"?
    What do you mean by "print"? on the screen or on paper or ???

  3. #3
    dlorde is offline Senior Member
    Join Date
    Jun 2008
    Posts
    339
    Rep Power
    7

    Default

    Just a thought - when you want to print your data, why not put it into a JTable and use the print methods provided?

  4. #4
    tyroceur's Avatar
    tyroceur is offline Member
    Join Date
    May 2010
    Location
    Fast Growing City, INDIA
    Posts
    44
    Rep Power
    0

    Default

    You can use DefaultTableModel to implement that. Just view some tutorials and you will be fine.

    Hope that helps :)
    First, solve the problem. Then, write the code.
    http://www.tyroceur.co.cc ------ If my post was helpful, REP it ;)

  5. #5
    Join Date
    Jun 2010
    Posts
    10
    Rep Power
    0

    Default

    sorry for not specifying it cmpletely..


    its like... u give number of rows and number of columns of a matrix as an input
    and i want to show the matrix as an output in the same window...
    i am creating a GUI..
    so as the user clicks on calculate...
    a matrix should appear...(in the same window..)

    hope now i made it clear..

    @tyroceur -
    I tried to implement that table..
    as i am using netbeans i drag the table in the window..
    then i have to specify the number og rows and columns. with it..
    but i need them to be inputted by user..

  6. #6
    Join Date
    Jun 2010
    Posts
    10
    Rep Power
    0

    Default

    can anyone help??
    i really need this to be done...

  7. #7
    tyroceur's Avatar
    tyroceur is offline Member
    Join Date
    May 2010
    Location
    Fast Growing City, INDIA
    Posts
    44
    Rep Power
    0

    Default

    yes, it can be done in netbeans.......

    You drag the table on the frame and then in the source code view, associate a DefaultTableModel with it......then you can change that table Model to add column, rows or data to the table.
    First, solve the problem. Then, write the code.
    http://www.tyroceur.co.cc ------ If my post was helpful, REP it ;)

  8. #8
    Join Date
    Jun 2010
    Posts
    10
    Rep Power
    0

Similar Threads

  1. problem with JDeveloper and Swing
    By Namrata in forum Other IDEs
    Replies: 3
    Last Post: 09-27-2009, 08:06 PM
  2. Replies: 0
    Last Post: 08-26-2009, 02:03 PM
  3. Problem In Swing Components
    By SANDY_INDIA in forum AWT / Swing
    Replies: 1
    Last Post: 07-19-2008, 11:23 PM
  4. Java Swing GridBagLayout Problem
    By hemanthjava in forum AWT / Swing
    Replies: 1
    Last Post: 06-29-2008, 09:51 PM
  5. SWT & Swing Bridge problem
    By roshithmca in forum AWT / Swing
    Replies: 0
    Last Post: 03-26-2008, 02:23 PM

Posting Permissions

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