Custom Tab order within a JTable

Hi,

     I have a JTable instance with two columns and certain number of
rows. The first column (on the left) lists the property name and right
column lists the value of the corresponding property. The property
values are editable (by the user) whereas the property names are not.
The default tab order takes a right/down approach. However I wish that
as the tab is pressed, only the editable fields (i.e. the right column
stack) get focus.
     To be clear, I want the tab order to be 

cell(0,1) -> cell(1,1) -> cell (2,1) ... cell(0,1) ...  where
cell(ROW,COL) is the cell at the intersection of row ROW and col COL.

     Do you know how is this possible. I know that the tab order can
be set for different components, but I dont know how to do it within a
JTable. Can you please help me out.

Thanks in advance,
Mahim.
0
absletters
10/11/2004 8:07:12 PM
comp.lang.java.gui 8307 articles. 0 followers. Post Follow

1 Replies
1654 Views

Similar Articles

[PageSpeed] 28
Mahim wrote:
> Hi,
> 
>      I have a JTable instance with two columns and certain number of
> rows. The first column (on the left) lists the property name and right
> column lists the value of the corresponding property. The property
> values are editable (by the user) whereas the property names are not.
> The default tab order takes a right/down approach. However I wish that
> as the tab is pressed, only the editable fields (i.e. the right column
> stack) get focus.
>      To be clear, I want the tab order to be 
> 
> cell(0,1) -> cell(1,1) -> cell (2,1) ... cell(0,1) ...  where
> cell(ROW,COL) is the cell at the intersection of row ROW and col COL.
> 
>      Do you know how is this possible. I know that the tab order can
> be set for different components, but I dont know how to do it within a
> JTable. Can you please help me out.
> 
> Thanks in advance,
> Mahim.

You can write your own Action classes that performs the appropriate cell 
navigation and link those Actions to the keys "selectNextColumnCell" and 
"selectPreviousColumnCell" in the ActionMap of the table. (These are the 
strings that map to Tab and Shift-Tab keys respectively in the default 
InputMap of a JTable).

If you do not want to rely on this implementation detail, you can modify 
the InputMap of the JTable to map the Tab / Shift-Tab keystrokes to some 
other string values, and map those strings to your custom actions in the 
ActionMap.

BK

0
Babu
10/13/2004 6:40:50 AM
Reply:
Similar Artilces:

how to define "global" function from within class method?
I have defined class X. Anytime X is inherited (say, by Y), I want to generate a global function definition def y(...) { ... } The hook I am using is class X def self.inherited(child) ... end end What should go into the ...? Should it be Object.class_eval "def #{child.name.downcase} ... end" ? Thanks itsme213 schrieb: >I have defined class X. Anytime X is inherited (say, by Y), I want to >generate a global function definition > def y(...) { ... } > >The hook I am using is >class X > def self.inherited(child) > ... > ...

Need help to custom the rand function ,
Hi guys, I was wondering how could i get a random number exemple between 1 and 100 but with n% of getting some value over a number x. Thanks a lot in advance. Fred Fred wrote: > Hi guys, > > I was wondering how could i get a random number exemple between 1 and > 100 but with n% of getting some value over a number x. > > Thanks a lot in advance. > > Fred > If you want n% chance of getting a value over x, then it isn't a random number. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstuckle...

US-MI-Kalamazoo: SAP Business Analyst, Inventory/Order Processing; C-P (45306632418)
US-MI-Kalamazoo: SAP Business Analyst, Inventory/Order Processing; C-P (45306632418) ==================================================================================== Position: SAP Business Analyst Reference: SMC01458 Location: Kalamazoo MI Duration: C-P Skills: 4+yrs working knowledge of the use of SAP in the Inventory and Order Processing support area along with a knowledge of the business processes. Experience in the consumer products industry. Strong in one or more of the following SAP modules: SD...

custom format attributes?
I want to extract the DEFAULT length for a set of custom formats. Is there a more elegant solution than PROC FORMAT CNTLOUT=... LIBRARY=... for accessing this information in Base SAS? I have been looking for a system function call accessable through %sysexec or a SASHELP view. Thanks, Dwight Eggers dwight.e.eggers@aexp.com On Wed, 28 Jan 2004 14:20:05 -0500, Dwight Eggers <dwight.e.eggers@AEXP.COM> wrote: >I want to extract the DEFAULT length for a set of custom formats. Is >there a more elegant solution than > PROC FORMAT CNTLOUT=... LIBRARY=... >for accessing this ...

[News] How Microsoft Continues to Ruin OLPC and Abuse <strike>Poor Children</strike> Customers
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Why is Microsoft underpowering One Laptop Per Child? ,----[ Quote ] | Linux is a natural fit for this emerging market. Microsoft, understandably, | wants to cut Linux off at the knees. It's just unfortunate that Negroponte | has capitulated: OLPC used to talk about freedom, then it tried to pretend it | was simply about price...and now it's no longer even about price. | | [...] | | It's about giving kids the crappiest spec that Microsoft's market share can | afford. That is shameful. `---- http://www.cnet.com/8301-13505...

Finder NSBrowser custom class
Ok probability the Finder column list is not a real NSBrowser... a strange sublclass? uhm :-/ Is there around an example of custom NSBrowser with special NSCell? I have searched a lot but nothing... only a "stupid" example ad ADC. In article <1h0rwus.h8rs8bm93cn4N%malcom.mac@g-mail-.com>, malcom.mac@g-mail-.com (malcom) wrote: > Ok probability the Finder column list is not a real NSBrowser... a > strange sublclass? uhm :-/ > Is there around an example of custom NSBrowser with special NSCell? I > have searched a lot but nothing... only a "stupid&quo...

What tag to use for iTunes ordering
I have a collection of over a thousand MP3s to put in iTunes. I would like to keep them in the proper play order and use the Album, Artist, Title, etc. for the titles of the subdivisions. Of course, I could number those, but it would be nice if I don't have to. Track number is limited to three digits. Is there any ID3 tag I can use, that iTunes will map to a particular column that I can use for ordering? -- Wes Groleau ----------- I've been framed! ... http://www.useit.com/alertbox/9612.html In article <0S_xf.500$sq.309@trnddc01>, Wes Groleau <groleau+news@freeshell.org&g...

Custom Software Development
iTechArt Group - Custom Software Development and Offshore outsourcing Company http://www.itechart.com/ Offshore custom software development company iTechArt - Web site and Content Management Solutions development, CMS consulting: Ektron, Drupal and DotNetNuke iTechArt Group provides high quality custom software development services and offshore software development. On December 2006, iTechArt Group became an authorized Microsoft Certified Partner. This means that our company has been recognized by Microsoft for our vast expertise and authorized to custom software development; provide IT ser...

Transparent custom folders icons
I haven't got my system update yet, because it's too darn big to download over a dialup modem with a slow rural connection, so I'm still running 10.2.3 I want transparent folder icons. I downloaded two utilities that were supposed to be able to do it, and they didn't work. I can make the icons easily enough using the dev tools included with the system, but then I don't know how to attach them to my folders. In article <1g9gdvx.u2nuhkunk2hhN%mbottorff@mac.com>, Michelle Bottorff <mbottorff@mac.com> wrote: > I haven't got my system update yet, beca...

Q) Order of dynamic linkage
Hi, I was extremely surprised to gather from a colleague that, at least in the Linux environment, for applications that need shared libraries, the dynamic linker first searches the /usr/lib directory, then the /lib directory, then the directories specified by the LD_LIBRARY_PATH environment variable. Is this true for all flavors of Unix as well? I was thinking all along that the LD_LIBRARY_PATH environment variable trumps everything else. Is there any way to change this search order? I am running into a problem because I want to link my application against a version of a shared library th...

VB .asp web page -- needs Order by myDistance
Hi all: I have this challenge. This following code snip generates and writes a list of dealers that meet a use-entered distance criteria according to user-entered zip code location. It's performing fine, EXCEPT... I need the results sorted by distance, ascending. I've pasted the bit of code below. The thing is online at: http://www.easy-arch.com/ZipCodeLookup/dealerlocator.asp Can someone please help be get these results sorted by distance ? TIA ******************************************************* <% strConnect = "DRIVER={Microsoft Access Driver (*.m...

NVHOST Website Design & Custom Programming Supports Cancer Charities
NVHOST.com wants to make the world a better place! We will donate 10% of revenues for any new website design, search engine optimization, or custom programming project, $999 or higher, to cancer charities. Just include CANCER in your Customer Support communication or mention it if you call. How can NVHOST.com help grow your business and help charity at the same time? Please visit us at www.nvhost.com or call us at 866-469-4678 today. ...

LV 8 Bug?: graph on a tab in a subpanel
If there is a graph placed on a tab control, the graph updates as it should.&nbsp; If there is a graph in a sub-panel, the graph updates as it should.&nbsp; Now if there is a graph placed on a tab control in one vi and you try to insert that vi into a sub-panel of another vi, the graph does not update correctly.&nbsp; In other words: if the graph = A, the tab control = B, and the sub-panel = C; then A+B, A+C, and B+C all work, but A+B+C does not.&nbsp; Has anyone else come across this or know a work around? "Has anyone else come across this or know a work around?" &a...

Order of attachments in Multipart POST
Does anyone know of a way to control the order of file attachments sent in a multipart POST statement? They seem to be sent in a random order each time. use HTTP::Request::Common; use LWP::UserAgent; my $ua = LWP::UserAgent->new; my $response = $ua->request(POST 'http://www.foo.com/forminput.cgi, Content_Type => 'form-data', Content => [ file1 => ["/home/dwake/file1"], file2 => ["/home/dwake/file2"], ] ); The order in which file1 and fil...

How to make this custom textarea?
Hello all, I'm trying to make the step 2 of import process of Ms Excel in Javascript. Take a look at what I'm trying to do here: http://tiger.towson.edu/~knoagb1/screencap.jpg Now, this is what I have got: http://tiger.towson.edu/~knoagb1/javascript/textslicer.html The idea is to get the positions of created guidelines in an array; a server side script would use this array to split the file and then import into excel. But I have many troubles. First of all, my ruler should move as the scrollbar scrolls right. And I should be able to add guideline beyond the size of the textarea, ie i...

9.4.0rc2 fixed order rrset's
Hi list, I've tried to configure fixed order rrset's in the newest 9.4.0rc2, and I'm having a problem- they don't seem to work. No error is produced. When I do a dig against my 'cluster' record, I'm still returned the A records in a round-robin order. Running BIND in debug mode, no errors that relate to the rrset-order configuration statement are visible. Below are my named.conf, zone file & debug output. Has anyone ever got fixed-order rrset's to work with any version of 9.4 since the functionality was introduced? Regards, - John ...

to customize my Frame
Hi, I am trying to make a E-device look JFrame, I've considered to override few ComponentUI method, like try to create new border with my left, bottom,right,top image... doesn't succeed much V.V . Anyone guru can shed some light here... Cheers kev ...

custom allocation and custom type
Hi all, I am trying to create a custom tuple type. I want it to live in a custom memory region, which will be a memory-mapped file. Its contents cannot be PyObject*. They have to be offsets into mapped memory. GetItem( i ) would return: (PyObject *)( t->ob_item[ i ]+ mmap_base_addr ); In the constructor, each item x would be stored as: BYTE* x_offset= x- mmap_base_addr; t->ob_item[ 0 ]= x_offset; For starters, only ints, strings, and other tuples will be members. I'll work out the list type and user-defined classes at a later time. Each will be required to be alr...

Custom Scanf Routine
I have tried to write my custom scanf function on the lines of minprintf provided in K&R2.In the function myscanf() i access memory directly using the address passed to the function .Can it be dangerous ? I am getting the correct output though.Any help is appreciated. /*Include Files*/ /*Assisting Functions*/ int flushln(FILE *f){ /*Code*/} char *input(char *message){/*Code*/} static int getInt(void){/*Code*/} /*My Custom Scanf Routine*/ int myscanf(const char* format,...) { va_list ap; const char *p; int count = 0; int temp; va_start(ap,format); for( p = format ; *p ;p++) { if(...

Removing Customize Dropdown on a Custom Toolbar
I have an Access 2003 front-end database with custom toolbars. The toolbars work fine. One annoying feature is that at the far right edge of each custom toolbar there a small dropdown arrow. When you hover over it with the mouse, a ControlTip Text of "Toolbar Options" is displayed. If you then click on the dropdrown arrow, it displays a popup menu of "Add or Remove Buttons", with a fly-out menu with the toolbar name at the top and "Customize..." at the bottom. Normally you can use this to customize your menus and toolbars. In my case, I disable the custom...

Re: All customers PAY YOU IN CASH !!!
DO NOT DELETE, PRINT IT, READ IT AND MAKE SOME BIG BUCKS. IT HAS WORKED SO WELL, THIS IS MY THIRD TIME AROUND. I QUIT MY BORING JOB AND WORK AT THIS ABOUT ONE TO TWO HOURS A DAY PROCESSING ORDERS, INCLUDING MY DRIVE TO THE BANK! SO GO FOR IT, YOU WILL BE GLAD YOU DID! EARN $100,000 PER YEAR SENDING E-MAIL OR PLACING FREE CLASSIFIED ADS!!! Dear Friend, You can earn $50,000 or more in the next 90 days sending e-mail. Seem Impossible? Read on for details; is there a catch; NO, there is no catch, just send your emails and be on your way to financial freedom. "AS SEEN ON NATIONAL ...

concurrent signal assignment: order can matter?
Hi, until now I thought that with concurrent statements order does not matter. = Then I wanted to demonstrate delta delay effects with several versions of a= n RS-FF. However, the simulator I use (Active HDL 8.3) produces different results fo= r the following 3 versions: concurrent_1: qni <=3D not (s and qi); qi <=3D not (r and qni); =20 concurrent_1: qi <=3D not (r and qni);=20 qni <=3D not (s and qi); concurrent_3_with_process: process(s,qi) begin qni <=3D not (s and qi); end process; =20 process(r, qni) begin qi <=3D not (r and qni); =20 en...

AdaGIDE 7.42 and tabs
Does anybody know how to force AdaGIDE to use HT properly (tab stop = 8)? -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de Dmitry A. Kazakov wrote: > Does anybody know how to force AdaGIDE to use HT properly (tab stop = 8)? Tools => Global settings => [Editor tab] => Indent Spaces/block => 8 -- Jeff Carter "C++ is like giving an AK-47 to a monk, shooting him full of crack and letting him loose in a mall and expecting him to balance your checking account 'when he has the time.'" Drew Olbrich 52 On Sun, 10 Dec 2006 14:34:20 GMT, Jeffrey R. Carter...

Feather plots customization not working
Hi all, According to the feather function help file, one can change the display of a feather graph using LineSpec. "feather(...,LineSpec) draws a feather plot using the line type, marker symbol, and color specified by LineSpec. " According to LineSpec, to make a line bolder, we use 'LineWidth'. Here is the code from the help file to graph a feather plot: theta = (-90:10:90)*pi/180; r = 2*ones(size(theta)); [u,v] = pol2cart(theta,r); feather(u,v); This works. Now, if you code: theta = (-90:10:90)*pi/180; r = 2*ones(size(theta)); [u,v] = pol2cart(theta,r); feather(u,...

Recordset's Order and Database's Physical Order?
Hi,guys! I have a table below: CREATE TABLE rsccategory ( categoryid NUMERIC(2) IDENTITY(1,1), categoryname VARCHAR(20) NOT NULL, PRIMARY KEY(categoryid) ) Then I do: INSERT rsccategory(categoryname) VALUES('url') INSERT rsccategory(categoryname) VALUES('document') INSERT rsccategory(categoryname) VALUES('book') INSERT rsccategory(categoryname) VALUES('software') INSERT rsccategory(categoryname) VALUES('casus') INSERT rsccategory(categoryname) VAL...