BC4J: Split TableData to JTable and JTextPane - possible? - how

Hi all,
I got a table with some columns, but 2 of them can contain more than 1000 characters. So I want the content of these 2 columns displayed in 2 JTextpanes, which then contain always the content of theses to columns when a row is selected.
My question now is:
How can I get them into the JTextPanes and is there a chance/method to get the primary key of a row when the row which is selected?
I also have to question how to hide a column, because I want to hide the primary key but only hide and how to change the header of the jTable.
I tried:
tableEmpView1.getColumn("Empno").setHeaderValue("Employee Number");
tableEmpView1.getColumnModel( ).removeColumn(tableEmpView1.getColumn("Job"));
But the don't work in my application!
I can remove the colum with this call but then I also removed it from the tablemodel, so I have no chance to get the content of the "hiddeN" column after that and the oder method-call doesn't work, although there is no compiler error or runtime error there is no headerValue changed.
Anyone any Idea about my question?
Thanks
Peter Zerwes

Hi all,
I got a table with some columns, but 2 of them can contain more than 1000 characters. So I want the content of these 2 columns displayed in 2 JTextpanes, which then contain always the content of theses to columns when a row is selected.
My question now is:
How can I get them into the JTextPanes and is there a chance/method to get the primary key of a row when the row which is selected?There are two questions here. One is how to display some attribute from a row in JTable in another control, such that only the current row value is displayed in the other control. You simply need to drop the other control in the UI editor and bind it to the same ViewObject and desired attribute. Framework will coordinate the passing of value from the current row into that attribute. See OTN sample "JClient Binding demo" - how it handles the display of Image control in a pane with JTable (Image for current Item from JTable is displayed in ImageControl). The sample is at:
http://otn.oracle.com/sample_code/products/jdev/jclient/jclient_binding_demo.html
The second question is how to get the primary key of the row which is selected.
Call panelBinding.findIterBinding(<your iterator name>).getCurrentRow();
I also have to question how to hide a column, because I want to hide the primary key but only hide and how to change the header of the jTable.
I tried:
tableEmpView1.getColumn("Empno").setHeaderValue("Employee Number");
tableEmpView1.getColumnModel( ).removeColumn(tableEmpView1.getColumn("Job"));
But the don't work in my application!
I can remove the colum with this call but then I also removed it from the tablemodel, so I have no chance to get the content of the "hiddeN" column after that and the oder method-call doesn't work, although there is no compiler error or runtime error there is no headerValue changed.
Anyone any Idea about my question?TO hide a column from display, you may either not select that column in the JTable binding or provide a control-hint "display=hide" in the ViewAttribute editor on the desired ViewObject attribute in your BC4J project.
To change Table headers, etc see OTN how to at
http://otn.oracle.com/products/jdev/howtos/JClient/jclient_jtable.html
Thanks
Peter Zerwes

Similar Messages

  • JTable and ResultSet TableModel with big resultset

    Hi, I have a question about JTable and a ResultSet TableModel.
    I have to develop a swing JTable application that gets the data from a ResultSetTableModel where the user can update the jtable data.
    The problem is the following:
    the JTable have to contain the whole data of the source database table. Currently I have defined a
    a TYPE_SCROLL_SENSITIVE & CONCUR_UPDATABLE statement.
    The problem is that when I execute the query the whole ResultSet is "downloaded" on the client side application (my jtable) and I could receive (with big resultsets) an "out of memory error"...
    I have investigate about the possibility of load (in the client side) only a small subset of the resultset but with no luck. In the maling lists I see that the only way to load the resultset incrementally is to define a forward only resultset with autocommit off, and using setFetchSize(...). But this solution doesn't solve my problem because if the user scrolls the entire table, the whole resultset will be downloaded...
    In my opinion, there is only one solution:
    - create a small JTable "cache structure" and update the structure with "remote calls" to the server ...
    in other words I have to define on the server side a "servlet environment" that queries the database, creates the resultset and gives to the jtable only the data subsets that it needs... (alternatively I could define an RMI client/server distribuited applications...)
    This is my solution, somebody can help me?
    Are there others solutions for my problem?
    Thanks in advance,
    Stefano

    The database table currently is about 80000 rows but the next year will be 200000 and so on ...
    I know that excel has this limit but my JTable have to display more data than a simple excel work sheet.
    I explain in more detail my solution:
    whith a distribuited TableModel the whole tablemodel data are on the server side and not on the client (jtable).
    The local JTable TableModel gets the values from a local (limited, 1000rows for example) structure, and when the user scroll up and down the jtable the TableModel updates this structure...
    For example: initially the local JTable structure contains the rows from 0 to 1000;
    the user scroll down, when the cell 800 (for example) have to be displayed the method:
    getValueAt(800,...)
    is called.
    This method will update the table structure. Now, for example, the table structure will contain data for example from row 500 to row 1500 (the data from 0 to 499 are deleted)
    In this way the local table model dimension will be indipendent from the real database table dimension ...
    I hope that my solution is more clear now...
    under these conditions the only solutions that can work have to implement a local tablemodel with limited dimension...
    Another solution without servlet and rmi that I have found is the following:
    update the local limited tablemodel structure quering the database server with select .... limit ... offset
    but, the select ... limit ... offset is very dangerous when the offset is high because the database server have to do a sequential scan of all previuous records ...
    with servlet (or RMI) solution instead, the entire resultset is on the server and I have only to request the data from the current resultset from row N to row N+1000 without no queries...
    Thanks

  • JTables and frequency count report

    Is it possible to use jTable and make the cells un-editable and have it set up where if you click on a cell it could perform a specific action? I�m working on a program that calculates a frequency count report and I want to be able to click on the cell and have it display in another window the observations that contributed to that cells count. Is this possible using jTable or is there a better way to get what I want? Thanks for any suggestions.

    Yes, it looks to me as if it should be possible.

  • JTable and events

    Hi,
    I am fairly new to Swing. I don't understand the following behaviour of JTables. If I minimize the frame containing the JTable, and afterwards maximize it again, the getValuAt method is called again for all visible rows and columns, even if the table data did not change. The same happens whit a mousemove over the JTable, and if another screen is dragged over the screen and afterwards dragged away from the screen.
    It is possible this is normal, but it affects the performance of the application in a quite considerable way.
    Greetings,
    Marc

    StansislavL is right, when the JTable is repainted also the data needs to be repainted and therefor retrieved form the DataModel. The way to solve your performance issues is to read the data once into a Vector of beans and use this to retrieve the value's for your JTable, like:public Object getValueAt (int row, int col)
      SomeBean sb = (SomeBean) data.get(row) //data = Vector of beans
      switch (col)
        case 0: return sb.getID();
        case 1: return sb.getName();
      return null;
    }greetz,
    Stijn

  • How to get JHeader Type on Left side of JTable and...

    Hi,
    I want two things...
    1) Header of JTable should display icons how to do this
    2)A Header Type thing displayed on left side of table like microsoft grid have
    Thanks
    -Rana-

    The JScrollPane component contains two methods:
    1) setColumnHeaderView()
    2) setRowHeaderView()
    When you add a JTable to a scroll pane, the table component automatically creates the column header for you using the TableDataModel.
    If you want to add a component on the left side then you must create a component and add it to the scroll pane using the setRowHeaderView() method.
    I have an sample program that uses the row header to display line numbers for a related JTextPane.
    http://www.discoverteenergy.com/files/LineNumber.java
    This LineNumber component can also be used to show row numbers for a given table by adding this code to you program:
    LineNumber lineNumber = new LineNumber( table );
    lineNumber.setLineHeight( table.getRowHeight() );
    scrollPane.setRowHeaderView( lineNumber );

  • I have two separate itune accounts under two different email accounts and would like to combine them under one account.  Is this possible and if so, how do I do it?

    I have two separate itune accounts under two different email accounts and would like to combine them under one account.  Is this possible and if so, how do I do it?

    If you go to Settings > iTunes & AppStore , you can sign out from your account, and sign in with the one you've used to purchase apps.This will not remove any apps you already have on it.
    Then you can go to AppStore and download apps you've purchased (either via "Purchased" button in "Updates", or simply search for them and download them.
    That way you can have multiple accounts' apps on your iPad. When updating, you will be prompted for the credentials for account you've purchased given App with.

  • I have an Ipad 2, I recently downloaded IOS 7.0.4, now when I open up Safari to search the internet it will come up for a split second then dissapear and take me back to the home screen. So it wont even let me search for anything.

    So can anyone tell me how to fix this problem? I cant surf the web because as soon as I click on the Safari icon it will pop up for a split second then dissapear and take me to the Ipad homescreen. This happened when I downloaded the IOS 7.0.4.  I have the IPAD 2.

    The terms of service of the Apple Support Communities prevent us from helping anyone with a jailbroken phone.
    You're on your own.  Good luck.

  • Is it possible to have your whole family on one apple id or is it better to have each person have there own? If each has their own does each id have to buy their own music and apps? How does find my iphone work with one apple id or two?

    Is it possible to have your whole family on one apple id or is it better to have each person have there own? If each has their own does each id have to buy their own music and apps? How does find my iphone work with one apple id or two? also I am going to be going off to college soon should I make an itunes id for my self and how will I get all the music from the old id?

    Is it possible to have your whole family on one apple id or is it better to have each person have there own?
    Yes, it is possible. 1 apple ID can be associated with up to 10 devices.
    If each has their own does each id have to buy their own music and apps?
    Yes, all purchases are non-transferable.
    How does find my iphone work with one apple id or two?
    Every device associated with one apple ID through Find my iPhone is tied to that Apple ID; Find my iPhone will work in the same way with up to ten devices associated with one apple ID. You cannot enable Find my iPhone for one device across two apple IDs
    I am going to be going off to college soon should I make an itunes id for my self and how will I get all the music from the old id?
    If you have authorized a computer with the old apple ID, you can transfer old media purchased through the old to other devices via iTunes. This doesn't mean the media purchases through the old apple ID it transferred to the new account. If you plan to make future purchases and don't wish to share them with others, make your own apple ID.

  • JTable and clipboard...

    Hi all!
    I'm trying to copy data from JTable to system clipboard. Here's my code that is
    supposed to do that except it doesn't work. Nothing happens. The system is
    Windows, rigth click invokes menu with only one position - COPY, which is served
    by a appopriate ActionListener. I want to copy entire table (all data):
    private class NotEditableTable extends JTable
    NotEditableTable(Object[][] data, Object[] columnNames)
    super(data, columnNames);
    setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    setCellSelectionEnabled(true);
    getTableHeader().setReorderingAllowed(false);
    NotEditableTableEngine nete = new NotEditableTableEngine();
    this.addMouseListener(nete);
    public boolean isCellEditable(int row, int column)
    return false;
    private class NotEditableTableEngine extends MouseAdapter implements ActionListener
    public void mouseReleased(MouseEvent e)
    if (e.isPopupTrigger())
    JPopupMenu menu = new JPopupMenu();
    JMenuItem menuitem = new JMenuItem(Lang.TABLE_COPY, new ImageIcon("res/Copy16.gif"));
    menuitem.addActionListener(this);
    menu.add(menuitem);
    menu.show(NotEditableTable.this, e.getX(), e.getY());
    public void actionPerformed(ActionEvent e)
    TransferHandler th = new TransferHandler(null);
    NotEditableTable.this.setTransferHandler(th);
    Clipboard clip = NotEditableTable.this.getToolkit().getSystemClipboard();
    th.exportToClipboard(NotEditableTable.this, clip, TransferHandler.COPY);
    }

    I also tried the code above with a simple JTextField, both with text selected and not.Did my sample code use the TransferHandler??? The simple way to do it for a JTextField would be
    Clipboard c = Toolkit.getDefaultToolkit().getSystemClipboard();
    StringSelection testData = new StringSelection( textField.getText );
    //StringSelection testData = new StringSelection( textField.getSelectedText );
    c.setContents(testData, testData);
    As for the table I said that the Ctrl-C KeyStroke will invoke the default Action to copy selected data from the JTable to the Clipboard. This can be tested manually by simply using Ctrl-C. If you want to invoke it in your program then you need to get the corresponding Action from the JTable and invoke the ActionPerformed method of the Action. You can try using the
    getActionForKeyStroke(...) method of JComponent to get the Action.

  • How do I split my iTunes ID and my iCloud ID without losing everything?

    I am currently using the same Apple ID for both iTunes and iCloud. However, I wish to share the iTunes and App Store account with my girlfriend, and have a separate ID for iCloud, so that we don't share emails, documents, etc across our various devices. However, I have paid for extra storage in iCloud, and I still have quite a lot of unused credit on my iTunes account, as well as all my apps etc associated with it, none of which I want to lose. Is it possible to associate one of these accounts with a new Apple ID with everything in tact, and if so, how?
    Thanks for your help.

    You can migrate your iCloud data to a new account if you wish, but the storage upgrade, iCloud email account and photo stream will remain with the original account.  Changing iCloud accounts will not effect your iTunes ID.  You can keep your current iTuens ID and associated credit, apps and other purchased media; it does not need to be the same as your iCloud ID.
    To migrate to a new account, start by saving any photo stream photos you wish to keep to your camera roll (unless already there) by opening your my photo stream album, tapping Select (Edit in iOS 6), tap the photos, tap the share icon -- box with upward pointing arrow (Share in iOS 6), then tap Save to Camera Roll.  If you are syncing notes with iCloud, you'll need to open each of your notes and email them to yourself so you can later copy and paste the text into new notes created in your new account.  Then go to Settings>iCloud, tap Delete Account (which only deletes it from this device, not from iCloud), choose Keep on My iDevice and provide the password to turn off Find My iPhone.  Then sign back in with a different Apple ID to create your new account and choose Merge to upload your data.

  • HT204053 Good Morning, I have 2 Apple Account, will be possible to integrate each other in one account ? And if is possible, How can I do that ? Thanks, Fabio.

    Good Morning, I have 2 Apple Account, will be possible to integrate each other in one account ? And if is possible, How can I do that ? Thanks, Fabio.

    You don't have to do anything with the first iPod that you don't use anymore. If you are planning on keeping it, put in a drawer in your house and forget about it.
    You don't need a second account to use with the new iPod. I use one Appl e ID and iTunes library for two iPods, and two iPad. I have different content on all four devices. You can select exactly what you want to sync to each device and it can be different content on all devices.

  • I have an old Ipad and an IPad Air. I used one Apple ID for both IPads. Now I wish ti split the iCloud storage and separate the two. I want to change my new IPad Air to a New Apple ID. How do I do it?

    I have an old Ipad and an IPad Air. I used one Apple ID for both IPads. Now I wish to split the iCloud storage and separate the two. I want to change my new IPad Air to a New Apple ID. How do I do it?

    Go to Settings > iCloud > Delete Account, and enter your Apple ID password. Then sign in with the new ID.
    NOTE: "Delete Account" just means it will be deleted from the iPad. The account itself will not be deleted.

  • I share an Apple ID with someone but we are now on iOS8 and getting each others messages on our iphones and ipad. How can I split the account safely as well as protect icloud backed up data?

    I share an Apple ID with someone but we are now on iOS8 and getting each others messages on our iphones and ipad. How can I split the account safely as well as protect icloud backed up data?

    Use different Apple IDs for iMessage (and also FaceTime) to avoid getting each others text messages (and FaceTime calls).  One of you should go to Settings>Messages>Send & Receive (and Settings>FaceTime), tap the ID, sign out, then sign back in with a different ID.  You can continue to shared the same ID for the iTunes store and other services.

  • How can you get a compilation album to show up as one album rather than be split up but song and artist?

    how can you get a compilation album to show up as one album rather than be split up by song and artist? I've got loads of albums on iTunes that are compliations and they are all mixed up by track/ artist. Even when you click 'show album' it still just shows the album title and then the artist in alphabetical order - so the album is replicated several times
    Can anyone tell me how to amalgamate compliation albums please?

    This web page will help you: http://samsoft.org.uk/iTunes/grouping.asp

  • Is it possible to print more than one picture at a time on a single page and if so, how?

    is it possible to print more than one picture at a time on a single page and if so, how?

    Hi Rowegarth.
    HP Photo Creations offers several ways to print multiple photos on a page. Here's a link to some preset grids. If you don't have HP Photo Creations already, you'll be prompted to download the software. (It's a free download.)
    You could also start with a "Design Your Own" collage print with a white theme.
    This video shows some ways to print multiple photos in HP Photo Creations to make them easier to cut out:
    www.youtube.com/embed/VRoGjhXPm4I?rel=0
    The beginning shows an older version of the software, but the second half (at 1:17) explains the grid settings. 
    Hope this helps,
    RocketLife
    RocketLife, developer of HP Photo Creations
    » Visit the HP Photo Creations Facebook page — news, tips, and inspiration
    » See the HP Photo Creations video tours — cool tips in under 2 minutes
    » Contact Customer Support — get answers from the experts

Maybe you are looking for

  • Tutorial 7: Compiling Applications

    C:\medrec_tutorial\src\physicianEar>ant -f mybuild.xml Buildfile: mybuild.xml build: [java] Loading source file C:\medrec_tutorial\build\physicianEar\physSessio nEjbs\com\bea\medrec\controller\PhysicianSessionEJB.java... [java] Constructing Javadoc i

  • Grid Control for windows

    Hi Experts, We're trying to download and install Oracle grid control for windows 64bit but we can't find any 64bit release! Can we safely download and install Enterprise Manager 11g Grid Control Release (11.1.0.1.0) - Windows 32bit from http://www.or

  • Broadcaster issues.

    I'm trying to use Quicktime Broadcaster for live streaming an event over the web for work. I've got a couple of problems doing this, and I can't seem to find a solution anywhere. I'm using a MacBook Pro with OSX 10.5.4, Quicktime Broadcaster version

  • MacBook will not launch Dock

    MacBook will not launch dock, is very slow and not performing properly?

  • Unable to setup new Airport Extreme

    Just purchased a new Airport Extreme (model A1521)  I am getting a blinking amber light.  When I go to AirPort Utility and go to Other Wi-Fi Devices (1), it sees my AirPort Extreme and tries to Gather Information then I get "An unexpected error occur