Add several small jtables into jframe

Hi,
I am trying to implement a GUI where a desired number of small tables can be added into a frame when the user clicks the menu item "new module" in the menu. So far, I can just add one table. For that, I have implemented an action listener. The table is created in a method called createTable().
Here is the code fragment:
ActionListener editListener = new ActionListener() {
                              public void actionPerformed(ActionEvent editEvent) {
                                   if (editEvent.getActionCommand().equalsIgnoreCase("New Module"))
                                        //event1.getActionCommand();     
                                        //Container frame = new Container();
                                        createTable();
                                        tablearea.add(jTable1);
                                        repaint();                                   }...}
                         };Does anyone have an idea how I could implement the functionality that when the user clicks the menu item several times, new tables are painted in the frame differing in their positions (e.g. next to each other).

a) you need a LayoutManager in your tablearea-Panel. Maybe GridLayout is what you need or the more complex GridBagLayout. However, the BoxLayout is a look worth too!
b) depending on the LayoutManager you use, you have to do a little more than just to 'add' the table - depending on the Manager. GridBagLayout (for instance) need a configured GridBagConstraints-Object.
c) try tablearea.validate() or tablearea.invalidate() to repaint the content (look javadoc about both methods).
Regards,
Martin

Similar Messages

  • Resize small jtable within jframe

    Hi, I have a small jtable in a jframe and would like to enable the user to resize this table by dragging its edges via mouse? How can I do this?
    thx
    D.

    Try adding the JScrollPane onto a JPanel with GridLayout and add the JPanel to the north of the content pane of the JFrame using BorderLayout.
    Is this what you intended to do?

  • How do you add a small video into the Presenter Panel on the top right

    I'm using Presenter 7.01
    I cannot seem to add a video of a taking head to the Presenter Panel.
    I can add video to the main slide no problem but there does not seem to be any option to add video to the top right panel and then display a presentation slide for the duration of the video.
    If I go into the Slide Properties,  and click on the Slide, the Edit button stays greyed out. I can only get the Edit button when I choose multiple slides, but then the options are limited.
    Any ideas please?
    Cheers

    Adding THV is now done using 'Import Video' dialog. There is a small set of radio button to specify if you want the video on slide or on the the sidebar (top-left).

  • How do i add a smaller video into the corner of a full-screened video?

    i had a video all ready and running and what-not and i wanted to add another video into the corner of it to show a different angle. how can i do this with premiere cs6?

    In the effects control pannel it doesn't show an option for 'motion/position' there are only:
    - adjust
    - blur & sharpen
    - channel
    - colour correction
    - distort
    - generate
    - image control
    - keying
    - noise & grain
    - perspective
    - stylize
    - time
    - transform
    - transition
    - utility
    - video
    under video effects. really sorry if i'm being a pain in the backside but i have really only just started using premiere

  • Source code organization: How to divide large JavaScript files into several smaller JavaScript files?

    Hello,
    some of my JavaScripts have become considerably large over time. What I would like to do is to split a single (large) JavaScript source file into several smaller source files plus an additional JavaScript file containing code or directives to recombine the split files.
    In other words, I would like to organize my JavaScript source code into re-usable modules.
    Although I searched the Acrobat JavaScript developer documentation and did a lot of Web searching, I still have no idea...
    whether the Acrobat JavaScript scripting environment itself does provide a code structuring mechanism
    how to properly organize large Acrobat JavaScripts in general.
    Any help would be greatly appreciated! Thanks a lot in advance!
    Sebastian

    Document-level scripts are not accessible to other documents/scripts, so they're not a good option.
    Folder-level scripts, on the other hand, are accessible to all other documents/scripts. So if you have a general function that creates a 3D annotation, for example, you can place it in a folder-level script and then call it from other scripts (you will probably need to provide it a handle for the document and properties of the annotation).
    One thing to be aware of, though, is that the folder-level scripts are loaded alphabetically, so don't put a reference in script aaa.js to something that loads in zzz.js, or you will get an error message when you open Acrobat. (this is not a problem if zzz.js is not called during the launch of Acrobat)

  • How can I divide one big long track into several smaller ones?

    I have many mp3"s I imported or downloaded in my Library of lectures, sermons and speeches.
    How can I divide one big long track into several smaller ones?
    Any input would be great.

    lakergrl wrote:
    How do I split one very long track into several tracks (audio journal split into each day)
    http://www.bulletsandbones.com/GB/GBFAQ.html#exportsections
    (Let the page FULLY load. The link to your answer is at the top of your screen)

  • How can I add new row/column into existing jTable?

    Hi add!
    Can you help me how can I add new row/column into existing jTable?
    Tnx in adv!

    e.g
    Create two buttons inside the Table ( "Add New Row" ) and ("Add new Column")
    their handlers are:
    add new row:
    //i supose u already have
    DefaultTabelModel tablemodel = new DefaultTableModel(rowdata, columnNames);
    //and   
       JTabel jtable = new JTable(tablemodel);
    // Handler (row)
    jbtAddRow.addActionListener(new ActionListener(){
       public void actionPerformed(ActionEvent e) {
          if(jtable.getSelectedRow() >= 0 )
              tablemodel.insertRow(jtable.getSelectedRow(), new java.util.Vector());  
           else  
                tablemodel.addRow(new java.util.Vector());
        });to add new columns its the same but inside actionPerformed method:
    ask for e.g "Whats the name for the new column"
    then,
       tablemodel.addColumn(nameOfColumn, new java.util.Vector());   Joao
    Message was edited by:
    Java__Estudante

  • How can I add  several  JButton into JList?

    I want to add several button into a Jlist. I tried this method, list.add(button,1),nothing shows up.I am not sure whether jList has the function.If it is,please show me how to achieve that.Thanks in advance!

    A JList is used to display text Strings. You should be able to add a JButton to the JList but all you will see is the toString() representation of the JButton. You will not see a button or be able to click on it.
    Try creating a panel using a GridLayout with a single column and add all you JButtons to the panel.

  • Compressing large file into several small files

    what can i use to compress a 5gb file in several smaller files, and that will easy rejoined at a later date?
    thanks

    Hi, Simon.
    Actually, what it sounds like you want to do is take a large file and break it up into several compressed files that can later be rejoined.
    Two ideas for you:
    1. Put a copy of the file in a folder of its own, then create a disk image of that folder. You can then create a segmented disk image using the segment verb of the hditutil command in Terminal. Disk Utility provides a graphical user interface (GUI) to some of the functions in hdiutil, but unfortunately not the segment verb, so you have to use hditutil in Terminal to segment a disk image.
    2. If you have StuffIt Deluxe, you can create a segmented archive. This takes one large StuffIt archive and breaks it into smaller segments of a size you define.2.1. You first make a StuffIt archive of the large file, then use StuffIt's Segment function to break this into segments.
    2.2. Copying all the segments back to your hard drive and Unstuffing the first segment (which is readily identifiable) will unpack all the segments and recreate the original, large file.I'm not sure if StufIt Standard Edition supports creating segmented archives, but I know StuffIt Deluxe does as I have that product.
    Good luck!
    Dr. Smoke
    Author: Troubleshooting Mac® OS X

  • Breaking a quicktime movie into several smaller clips?

    Hi,
    I want to edit my wedding movie but Imovie 3 says it is too large. I have it saved as a QT.div (approx 55 minutes) file but how can I edit it into several smaller clips to import to imovie?

    Apple of course wants you to purchase QuickTime Pro to activate the editing features in QuickTime Player.
    But to do it for free, try MPEG Streamclip. http://www.squared5.com/ .div isn't listed among the formats, but the list has an ellipsis at the end, so you never know.
    The list they give on their site is "MPEG, VOB, PS, M2P, MOD, VRO, DAT, MOV, DV, AVI, MP4, TS, M2T, MMV, REC, VID, AVR, M2V, M1V, MPV, AIFF, M1A, MP2, MPA, AC3, ... "

  • How do I combine several PDF files into one?

    I have renewed Adobe subscription and would like to combie several PDF files into one. I was able to do this last year, but can no longer combine files. What am I doing wrong? Step-by-step answer, please. Thank you.
    Marilee

    As TSN has indicated we have no idea what program you are using, other than you posted in the Acrobat forum. In Acrobat you go to File > Create > Combine (varies with version of Acrobat). You can also open one and then use the pages>Insert to add the others.

  • How do I add several discs as a single album to my iTunes library?

    How do I add several discs as a single album to my iTunes library?

    Well first off you have to title them all with the same album name.  Then make sure you have them set to like disc 1 of 3, 2 of 3 etc. so they will all fall into the same folder.  Then make sure that you have the same album artist and leave artist blank or it will separate the files.  If Various artists then title it various artists.

  • How to add more disk space into /   root file system

    Hi All,
    Linux  2.6.18-128
    can anyone please let us know how to add more disk space into "/" root file system.
    i have added new hard disk with space of 20GB, 
    [root@rac2 shm]# df -h
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/hda1             965M  767M  149M  84% /
    /dev/hda7             1.9G  234M  1.6G  13% /var
    /dev/hda6             2.9G   69M  2.7G   3% /tmp
    /dev/hda3             7.6G  4.2G  3.0G  59% /usr
    /dev/hda2              18G   12G  4.8G  71% /u01
    LABLE=/               2.0G     0  2.0G   0% /dev/shm
    /dev/hdb2             8.9G  149M  8.3G   2% /vm
    [root@rac2 shm]#

    Dude! wrote:
    I would actually question whether or not more disks increase the risk of a disk failure. One disk can break as likely as one of two of more disks.
    Simple stats.  Buying 2 lottery tickets instead of one, gives you 2 chances to win the lottery prize. Not 1. Even though the odds of winning per ticket remains unchanged.
    2 disks buy you 2 tickets in The-Drive-Failure lottery.
    Back in the 90's, BT (British Telecom) had a 80+ node OPS cluster build with Pyramid MPP hardware. They had a dedicated store of scsi disks for replacing failed disks - as there were disk failure fairly often due to the number of disks. (a Pryamid MPP chassis looked like a Xmas tree with all the scsi drive LEDs, and BT had several)
    In my experience - one should rather expect a drive failure sooner, than later. And have some kind of contingency plan in place to recover from the failure.
    The use of symbolic links instead of striping the filesystem protects from the complete loss of the enchilada if a volume member fails, but it does not reduce the risk of loosing data.
    I would rather buy a single ticket for the drive failure lottery for a root drive, than 2 tickets in this case. And using symbolic links to "offload" non-critical files to the 2nd drive means that its lottery ticket prize is not a non-bootable server due to a toasted root drive.

  • Large servlet or several small ones??

    I am building a servlet for a web application which is becoming quite large. I am beginning to wonder about the resources that this will use on the server.
    Does anyone have any views on wether it would be better to split the servlet into several smaller or keep one large do it all.
    cheers
    chris

    I read these question and answers, and I'm sure small servlets are a better programming way, but my question is what is faster?
    I mean one big servlet need time to load and initialize but this is only for the first time, many small servlets or a framework need time to instantiate objects at every call.
    Am I wrong?

  • Can we add Resource custom fields into ASSIGNMENT TIMEPHASED CUBE

    Hi,<o:p></o:p>
    <o:p> </o:p>
    We want to add Resource custom fields into
    ASSIGNMENT TIMEPHASED CUBE in project server 2010.<o:p></o:p>
    Is it possible?<o:p></o:p>
    <o:p> </o:p>
    Please help me in this.<o:p></o:p>
    <o:p> </o:p>
    Thanks,<o:p></o:p>
    Sarath<o:p></o:p>

    Once column is for assignment and another one is for Resource.
    Assignment means when you crate a task then assign that task to resource then task become assignment.
    when you will create report in for Resource_skill_resource you will be able to group by or filter resource as per their skill. 
    As far as Resource_Skill_R_Assignment is concerned  you can group by or filter assignment for resource as per their skill 
    Resource CUBE: The
    Resource Non Timephased and Resource Timephased OLAP cubes contain resource data. These two OLAP cubes do not contain any Total fields in common, but do contain several Dimensions in common (such as Booking Type and Resource List).
    Assignment: The
    Assignment Non Timephased, Assignment Timephased, MSP
    Portfolio Analyzer, and MSP
    Project Timesheet OLAP cubes contain assignment data. Each of these OLAP cubes includes many
    of the same Total Fields (such as Actual Cost, Actual Overtime Cost, Actual Work, and Actual Overtime Work) and many of the same Dimensions (such as Assignment Owner and Project List)
    kirtesh

Maybe you are looking for