Can anyone teach me how to create a JTable
In my project, i would like to make a class extends JTable for which it can function like the excel one.
This means that the table can split into two parts.
Each of them have a standalone view and can let user to update the table.
Had some time to spare so a quick rough example.
Note this makes use of the TableModel created by JTable when passed an Object[][].
I'd recommend instead that you create your own TableModel and pass that to both JTables yourself.
import javax.swing.*;
import javax.swing.table.*;
public class SplitTableDemo extends JFrame
public SplitTableDemo(String title) {
super(title);
// prepare data
int cols = 26;
int rows = 200;
Object[][] data = new Object[rows][cols];
for (int j=0; j<rows; j++) {
for (int k=0; k<cols; k++) {
data[j][k] = new String("");
// prepare column names
Object[] columnNames = new Object[cols];
for (int m=0; m<cols; m++) {
char c = (char) (65+m);
columnNames[m] = String.valueOf(c);
// create first table view
JTable upperTable = new JTable(data, columnNames);
// create second table view with same model (obtained from first)
TableModel tm = upperTable.getModel();
JTable lowerTable = new JTable(tm);
// put tables in ScrollPanes
JScrollPane upperScroller = new JScrollPane(upperTable);
JScrollPane lowerScroller = new JScrollPane(lowerTable);
// display in split pane
JSplitPane sp = new JSplitPane(JSplitPane.VERTICAL_SPLIT, upperScroller, lowerScroller);
this.getContentPane().add(sp);
public static void main (String[] args)
SplitTableDemo splitTableDemo = new SplitTableDemo("Split Table Demo");
splitTableDemo.pack();
splitTableDemo.show();
}
Similar Messages
-
Hello!
Can anyone teach me how to connect iphone 4S to ipad retina using bluetooth. I tried, but the devices won't discover each other at all. I just wanted to connect to share contact details so I don't have to key in one by one.
Many thanks
InjinYou need to go to the App stores and find compatible apps. iOS device do not natively have to ability to transfer info to a computer via BT to a computer.
With iOS 8 you can use AirDrop -
Can anyone explain me how to create a transparent table(z table) dynamicall
Can anyone explain me how to create a transparent table(z table) dynamically in the program.
Hi,
Look at the below link
http://www.sap-img.com/ab030.htm
Regards
Sudheer -
can anyone tell me how to create a dvd to play on my tv from a slideshow on my mac
Not in the Classic forum:
http://discussions.apple.com/docs/DOC-2463
Try iLife, iDVD, or iPhoto. AppleTV may also help. -
Can anyone teach me how to draw this photorealistic picture?
Dear all,
Is there anyone that could teach me how to draw the "photorealistic" detail in the picture attached?
Monetary compensation is available.
Thank you very much
DavidIt is essentially simply paths created with the Pen tool. Then filled with colos and/or gradients. There's nothing special about it.
-
Can anyone show me how to create a scheduled app to run
hi
i have a application that needs to be run at certain time daily. i was wondering if anyone here can show me how to do that? thanksthanks, i have never used either to run java app. however i had used window's schedule task to run other window programs before. is there any sample to use both to run java prgram? thanks
-
Can Anyone Tell Me How to Create Greeting Cards with Photoshop Elements 7 or 8?
I need a 7x10 page setup so that when the card is folded to a 5x7 my photo is landscape on the outside of the card. Currently I can only find a 8 1/2 x 11 paper size.
Thanks,
Lexington59In Photoshop Elements 8 Editor, go to the Create tab, and you will see Greeting card, with 5x7 page size.
-
Can anyone guide me how to create the databse with or without using the GUI
I need to create the Database from SQL prompt can any body tell me the links where i can find some sample scripts to do that....Thanks
Hi,
I would like to mention few stuffs too..
for manually.
1. startup nomount pfile=path of the pfile.
2. run the create datbase script.
3. run catalog.sql, catproc.sql script.
that was the brief idea,but you need to create your sample pfile,setting up your dir locations,setting envrmnts variables.
for gui envrmnts you have DBCA , use it and forget about all the cavtes.
thanks
Alok. -
Hi,can someone teach me how to use save command in netbeans 6.7 ME
hi,can anyone teach me how to save every information i stored on a form1,like datefield, textfield,and saving it in another form2, is there a code for that?, and showing in form2 the saved information,is it possible? and how in visualMidlet. tnx
and please,anyone,help me throughout my mobile applications,because it's kinda complicated for a starter like me.. my application is called Calendar Event Texter, in which I specify the date, and time, the recipient and the message to be send automatically through its' assigned date and time. Is it possible? please someone help me..tnx
-
Teach me how to create the opening "hallway" sequence using Adobe After Effects
I need to create a memorial video for a loved one that passed away. Can someone teach me how to create the opening "hallway" sequence using AE? here is the video from youtube: https://www.youtube.com/watch?v=4191kcW07f0 . Thanks
I'll give a very brief overview but, presuming that you are new to After Effects, understanding and executing on this overview will require learning the basics of After Effects.
You'll be creating a 3D scene based on a few 3D layers: one each for the floor and each wall. Each of those 3D layers will be a precomposition layer; the wall layer with the pictures will be based on a precomposition in which you have placed your pictures as individual layers. You will create some 3D lights shining down from above. You'll create a 3D camera that you will then animate to move down the hallway.
As I said, that is a very brief overview. Understanding each of those pieces will require some learning. After Effects is not a simple application, so you do need to be prepared to put in some learning time if you are going to do this yourself. Here is the place to start: http://adobe.ly/AE_basics
All that said, I would recommend that you hire someone to do this for you. Learning a new and complex creative application under the time pressure (and other pressure) that you are under may be too much to ask. -
Is it possible to create a schedule in Labview . Example: i want to off the lights at 7pm and want it on at 8am. If there is can anyone teach, its for a school project. Im using labview 2011...thx
Since this is a school project I recommend you do the work yourself. You will not learn asking others to do it for you. In addition, folks here will not do your homework for you. We are however more than wiling to answer specific questions for you. Post what you have done or tried and ask specific questions. I am confident you will get assistance.
And to answer your question, yes LabVIEW can be used to implement a scheduling program.
Mark Yedinak
"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot -
Why can't I update my iOS 5.1.1 to 6.1.6? I get the unknown error 1601 every time I try. Could anyone teach me how to fix it? I need a concrete answers/suggestions. Thanks!
Click here and follow the instructions.
(104277) -
Adobe did not automaticly attach itself to a tab in my microsoft programs durnig the instal. Can anyone tell me how to manualy get Adobe acrobat 10 to create an Adobe tab in my Microsoft programs? IE:Outlook, Word, Excel??
Thank you for your response. Yes I do have office 2013 and From reading forums it appears I might be out of luck to get the add in tab. I can still print to it so I will adapt and move on.
Again thanks for your help. -
Can anyone tell me how to slow down a commercial track in Garage band 10.00 I was able to do this in the earlier version of Garage Band quite easily and it is a good tool for being able to teach new dances, but I find I am unable to do it in the new version, which has just been updated. I would be grateful for any help.
Just found it.
Select your track with song imported from iTunes, open the Track Editor window, and in the head of the track editor and press the "Flex" marker. Make sure "Enable Flex" is set,
Then change the tempo of your project. -
can anyone tell me how to restore my itunes library and playlists? After I downloaded mountain lion my library is missing and my devices can be synced to only one library ...the missing one
That .itl file actually is the library -- at least the critical part of it although the library is actually many files and folders.
Try starting iTunes and immediately hold down the option key. When it asks, guide it to the .itl file.
It's really hard to say without being able to poke around your computer. Upgrading should not delete the old library, but still it happens to the very, very few which is why we make backups before updating. If the old library file is gone then so are your playlists. You can always see if the following is of any use:
iTunes: How to re-create your iTunes library and playlists - http://support.apple.com/kb/ht1451
Maybe you are looking for
-
Hi All, I recenly installed Oracle 10g Release 2 on Windows 2003 Standrad Edition.. And getting an error in my alert log file... ORA-07445: exception encountered: core dump [ACCESS_VIOLATION] [unable_to_trans_pc] [PC:0x60518765] [ADDR:0x4] [UNABLE_TO
-
Please Help! Can't open files
Recently I have been unable to open pdf files to view. Not sure what has changed but I have downloaded the adobe reader several times, open the file and get a message that says adobe is installed, open and running. When I go to view a file, I get a
-
Error in approve the leave request in MSS
Hello, i m new in ESS/MSS.. right now working on maintanance project...All configuration settings are done by other guy. - I m facing error in approving the leave request in MSS .. it open a error page as of no page found ... can any body tell me the
-
Using Intel Solaris 8 with 2 monitors
We are developping an application under Solaris 8 Intel that will use 2 monitors. We have learn that Matrox and Colorgraphics provide twin head boards that, when driven by a XiGraphics driver, will manage the 2 monitors. Did anyone have this experien
-
Consuming HTTPS based external service
Hello, I am trying to generate consumer service proxy, for a HTTPS based service within the same organization, but I am trouble generating the proxy. Below is the error from task bar. *Exception occurred in communication framework:Error in HTTP Frame