( im new to java) How do I increase number of columns in a JTable ?

I am dooing a small calculating program in school and can't figure out how to change the amount of columns in a JTable, my programming skills sofar are extremely basic and therefore we are using the netbeans GUI to create our windows. The code generated by the GUI cannot be edited and I have tried to copy paste the code into Eclipse but it didn't work.
I have a fair idea of where in the code you can preform the things I want but I need to do it in the grapical interface.
any suggestions are very much appriciated.

my programming skills sofar are extremely basic and therefore we are using the netbeans GUI to create our windows.Using and IDE doesn't not make it easier. As you've found out it only makes it harder since you can't edit the code and take full control.
Read the Swing tutorial, it contains plenty of example for building GUI applications:
http://java.sun.com/docs/books/tutorial/uiswing/TOC.html
I don't really understand your question, because if you create the table correctly, then then is no need to increase the number of columns. However, the table does support an addColumn(....) method.

Similar Messages

  • How do I increase number of users?

    how do I increase number of users?

    There is no way to increase the number of users that an airport extreme can support wirelessly.

  • How to find the number of columns in an internal table DYNAMICALLY ?

    Hi,
    How to find the number of columns in an internal table DYNAMICALLY ?
    Thanks and Regards,
    saleem.

    Hi,
    you can find the number of columns and their order using
    the <b>'REUSE_ALV_FIELDCATALOG_MERGE'</b>
    call function 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
       I_PROGRAM_NAME               = sy-repid
       I_INTERNAL_TABNAME           = 'ITAB'
       I_INCLNAME                   = sy-repid
      changing
        ct_fieldcat                  = IT_FIELDCAT
    EXCEPTIONS
       INCONSISTENT_INTERFACE       = 1
       PROGRAM_ERROR                = 2
       OTHERS                       = 3
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif
    now describe your fieldcat . and find no of columns.
    and their order also..
    regards
    vijay

  • New to java: how to replace an image extending a JComponent?

    Hi,
    I'm new to Java and I have a question about Swing:
    I have a class called ActiveImage (entends JComponent, implements     MouseMotionListener, MouseWheelListener) which takes an Image and displays it. It also receives some mouse events for zooming and moving it around. I display it in a JFrame using:
    content = getContentPane();
    content.setLayout(new BorderLayout());
    image = toolkit.getImage (filename);
    ActiveImage activeImage = new ActiveImage(image);
    content.add(activeImage, BorderLayout.CENTER);
    (This code is in a class extending JFrame.)
    This works fine. However, this JFrame also contains a JToolbar with two buttons. Now when I click one of them, I want to replace the image with another one. I've tried removing it and creating a new ActiveImage to add that to content, but that didn't work very well. remove() resulted in a NullPointerException.
    My question: what would be the best way to go about this?
    Many thanks for any help,
    Diederick de Vries

    B.T.W., this is the trace:
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
            at ActiveImage.ActiveImageFrame$1.actionPerformed(ActiveImageFrame.java:60)
            at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
            at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
            at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
            at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
            at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
            at java.awt.Component.processMouseEvent(Component.java:5488)
            at javax.swing.JComponent.processMouseEvent(JComponent.java:3093)
            at java.awt.Component.processEvent(Component.java:5253)
            at java.awt.Container.processEvent(Container.java:1966)
            at java.awt.Component.dispatchEventImpl(Component.java:3955)
            at java.awt.Container.dispatchEventImpl(Container.java:2024)
            at java.awt.Component.dispatchEvent(Component.java:3803)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
            at java.awt.Container.dispatchEventImpl(Container.java:2010)
            at java.awt.Window.dispatchEventImpl(Window.java:1766)
            at java.awt.Component.dispatchEvent(Component.java:3803)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
            at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)Just before this, it says "button clicked". The function that calls the setImage() goes:
    theButton.addActionListener (new ActionListener() {
         public void actionPerformed(ActionEvent ae) {
              System.out.println("button clicked");
              activeImage.setImage(image);
    });Reading the trace, I would think that the exception has something to do with this last code, since it stops there (line 60 is the setImage()). If the setImage() function itself was where the fault was, wouldn't the trace end there?
    I'm really at a loss here ... :-(

  • How to get the number of columns in a result set???

    hi everyone..
    i am trying to establish a servlet applet communication....
    my applet send the sql query to the servlet as serialised string and then the servlet executes the query...
    Since i need to pass the result back to the applet, i thaught of passing the whole reult set to the applet..but that seems to be not possible..
    so i thaught of storing my result set data in a vector and then pass the vector,but the first problem that i came across is that how to get the number of colums in a result set....
    so is there a way to get the number of columns in a result set...???
    and also i would like to know if it possible to send my whole result set to the applet bye serialization or by any method...???
    thanx in advance

    You shouldn't do. It expenses resources (you should always close the ResultSet and the Statement as fast as possible). Simply gently process it into a Collection or Map of DTO's. Those are serializable.

  • How to access variable number of columns using ref cursor !

    Hi,
    I am trying to get variable number of columns using ref cursor.
    Declare
    mySzSql varchar2(2000);
    Type dynSqlRC is Ref cursor;
    current_cur dynSqlRC;
    tbl_rec alt_42_consolidated%Rowtype;
    Begin:
    /* This works */
    mySzSql := 'select *
    from
    Table1
    Where
    rowid = ''AAEWNEABXAAAAkxAAA''';
    /* i want something like this to work, this is not working, giving missing variable name error */
    mySzSql := 'select col1, col2, col3
    from
    Table1
    Where
    rowid = ''AAEWNEABXAAAAkxAAA''';
    open current_cur for mySzSql;
    fetch current_cur into tbl_rec;
    close current_cur;
    End;
    I do have the list of desired columns which I am looking to fetch, so after taking that in the record type, how should i get their values. Is it possible to traverse tbl_rec declared above and if column name matches then I will store the value in the array and finally return this array.
    Can somebody please tell me how to do this.
    Thanks

    It appears that this is a followup to How to loop through columns selected by select clause which is itself a followup to [url="
    How to execute dynamic sql"]this earlier thread.
    Assuming these are intended to be followup questions, can we please stick to a single thread? That makes it a lot easier to understand the situation and follow the conversation. Starting multiple threads makes it harder to follow the conversation.
    Thanks,
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • New 2 Java - How to compile in Version 1.5.0 - childs play for u guys

    Hi
    I just installed JAVA from www.java.com and it has installed Version 1.5.0 (build 1.5.0_02-b09) on my pc. I am using Windows 2k and would like to know how can I compile a programme in JAVA. I remember earlier I used to use
    javac <programme>.java
    from the dos prompt. And had set it up in the path within autoexec.bat.
    Now
    1. How do we compile a programme now? Where is javac gone?
    2. Do I need to setup a path? if "yes" where?
    Help would be much appreciated. And you would see me more on this forum now.
    Thanks

    javac hasn't gone anywhere. It's still in the same place as in the previous versions.
    Make sure you download and install the SDK and not just the run-time environment. After installing, put the bin directory of the SDK in your path and it works like usual.

  • How can I increase number of devices connected to Fusion wifi

    When adding a fifth device my printer is knocked off

    If you look in the Misc. Digital Group you'll find a Family called TIL (Technology Independent Logic). This family is most similar to V5.12.  You'll find a 7-1 NAND gate in there.
    S

  • How to implement row span and column span in JTable.

    Hi,
    How do we implement Col span and row span in JTable as in Html.
    Kindly help.
    Thank You

    Although I suppose you could extend JTable to support column and row spans, this would involve a lot of of work and quite a few hacks. I think you will be better off either creating a new custom JComponent with an appropriate model for this purpose or using an existing solution such as [JIDE Grids|http://www.jidesoft.com/products/grids.htm] which includes a CellSpanTable.

  • How to Map N number of  columns from input to output schemas at a time?

    Hi,
    I am new to BODI. In my project we are using DAT files, which contains more than 100 columns, as Source. At the Data Flow Level, in Query Transformation we are manually mapping columns from INPUT Schema to OUTPUT Schema one by one.
    Is there any way to MAP all the columns at a time from INPUT schema to OUTPUT schema.
    Hope I am clear with my question.
    Thanks for your support.
    Sudhakar

    Hi,
    Thanks for your answer.It's really helpul.
    But in my case, Source Filed names and Target Field names are different. As we know, OUTPUT column names should be same as Target Field names.
    I am just wondering is there any option to MAP columns between INPUT schema and OUTPUT Schema at a time, like Informatica.
    In Informatica you can MAP all the columns at a time between any 2 Transformation by using their port order, even though the Filed names are different .
    Do we have any option like this in BODI?
    Regards,
    Sudhakar

  • How to avoid max number of column alv grid (kkblo_header).

    Hi,
    I need display more than 100 columns in alv grid. How can I do this? In structure kkblo_header is max. 100 col.
    Thanks, zd.

    Hi Zdenek,
    Have you tried to create a structure (via SE11 transaction) and assign it as the base structure to form the field catalog for your ALV Report?
    I hope I had helped you.
    Regards,
    Daniel Carvalho.

  • How to fetch less number of columns from a ref cursor

    I have a ref cursor which has 10 columns. After "OPEN"ing the ref cursor I want to "FETCH" only 3 columns. When I try that I am getting error. How to achieve that?
    Regards.
    Shantanu.

    Supposing your first 3 columns are "stable" in name and type for any SQL statement you use, you can do something like:
    SQL> create or replace procedure stable (sql_s in varchar2)
      2  is
      3   empno emp.empno%type;
      4   ename emp.ename%type;
      5   a sys_refcursor;
      6  begin
      7   open a for 'select empno, ename from (' || sql_s ||')';
      8   fetch a into empno, ename;
      9   while(a%found) loop
    10    dbms_output.put_line(ename || '/' || empno);
    11    fetch a into empno, ename;
    12   end loop;
    13   close a;
    14  end;
    15  /
    &nbsp
    Procedure created.
    &nbsp
    SQL> set serveroutput on;
    SQL> exec stable('select * from emp');
    SMITH/7369
    ALLEN/7499
    WARD/7521
    JONES/7566
    MARTIN/7654
    BLAKE/7698
    CLARK/7782
    SCOTT/7788
    KING/7839
    TURNER/7844
    ADAMS/7876
    JAMES/7900
    FORD/7902
    MILLER/7934
    &nbsp
    PL/SQL procedure successfully completed.
    &nbsp
    SQL> exec stable('select empno, ename, sal from emp');
    SMITH/7369
    ALLEN/7499
    WARD/7521
    JONES/7566
    MARTIN/7654
    BLAKE/7698
    CLARK/7782
    SCOTT/7788
    KING/7839
    TURNER/7844
    ADAMS/7876
    JAMES/7900
    FORD/7902
    MILLER/7934
    &nbsp
    PL/SQL procedure successfully completed.Rgds.

  • How can I find number of columns in a table using a query

    Hi
    I want to find the number of columns in a table using a query.
    Any help in this regard is much appreciated.
    Cheers

    Hi,
    This is the output i get when i executed ur query
    OWNER     OBJECT_NAME     OBJECT_TYPE
    SMLDBO     T2311_SURVEY_QUESTIONS     TABLE
    select OWNER,OBJECT_NAME,OBJECT_TYPE
    from all_objects
    where OBJECT_NAME = 'T2311_SURVEY_QUESTIONS';
    works Fine.
    But if i use the below query it returns : 0
    SELECT count(*) FROM user_tab_columns
    WHERE table_name =upper( 'T2311_SURVEY_QUESTIONS');
    What could be problem.
    The table exists + name of the table is correct + it resides in my schema itself.
    Any guess !!!

  • How can i find number of columns in a table ....... it's higer priority

    hi
    i wnat find the number of columns in a table.
    is there any predefine fiunction. pls tell me

    Thanks for correction!
    I asked myself that question after posting previous post... started to search in Documentation but you were faster.
    Thanks again!
    Message was edited by:
    Faust
    Edit:
    Dear thread users!
    You have here (in my post in this thread - see above) good example for inappropriate post in one thread.
    I posted to fast - I didn't realise am I sure what I wrote!
    Consequence was that, after posting, I asked myself is it correct my statement about rights on SYS-objects, I started to search for answer, etc.
    So what I want to say is: if you don't want to find yourself foolish, like I found myself, don't post before you are sure is it correct what you wrote!
    Cheers!

  • How to increase number ptys in Solaris 10?

    Hi,
    How do I increase number of ptys in Solaris 10, also what command to view how many total currently set?
    I try to put set pt_cnt = X and rebooted, seems to be not working.
    Thanks!

    Solaris 8 and later versions should not need pt_cnt. Ptys should be dynamically allocated as needed. Can you describe the problem you are having?
    See the Solaris 2 FAQ:
    http://www.science.uva.nl/pub/solaris/solaris2.html#q5.30
    5.30) I get Could not grant slave pty on telnet/rlogin
    In Solaris 8 and later you must make sure you have syseventd/devfsadmd running or the automatic pty node creation does not work.
    In older releases this probably means that you changed "pt_cnt" but didn't reboot with the "-r" flag. To recover, run "drvconfig; devlinks".
    So, you should make sure syseventd and devfsadmd are running.
    Darren

Maybe you are looking for

  • Using Mini DisplayPort to VGA Adapter to connect Macbook Pro (2009) for a presentation via projector.

    When I connect my Macbook Pro (2009 model) using a Mini DisplayPort to VGA adapter to display a presentation via projector, only the top-left portion of what is displayed on my Macbook Pro's screen is displayed on the projector, as though I zoomed in

  • Problem with Mac OS X Lion 10.7.5, the mac goes crazy!

    I have a problem with mi imac g5 Mac OS X Lion 10.7.5 (11G63) bought the last year. During the last week the system are wrong because when I open a aplication like itunes, illustrator or another one like a simple navigator "Firefox", somethimes this

  • Scroll Bar no longer visible - how do I get it back??

    I have recently upgraded my Mac desktop to Mountain Lion and I no longer have the scroll bar visible when I use Safari. Any ideas how I can get it back please? Thanks

  • Can't Delete Aggregation Level

    Hello Experts, I can't delete a aggregation Level wich based on a Realtime InfoCube. How can I delete This aggregation Level. No Filter, No Planing Sequenz, No Planing Function, THANKS....

  • Accordion in IE browser

    Hello, Please be so kind and help me with problem with accordion panel. When I have web page with header div which could be an image or menu and just below I put accordion panel then I have problem with working this in IE browser. ( Firefox and Opera