Automating scrolling of a JTable when model gets updated
Hi,
I have a JTable in a JScrollPane with a table model that updates in real time and I need to keep the currently selected row on the same place on screen (for example when a row is inserted before the selected row I'd like the scroll pane to automatically scroll one row down so the selected row remains at the same location on screen).
the scrollpane before the row insertion:
row A
row B
row C
row D (selected)
row E
now 'row F' is inserted between B and C
row B
row F
row C
row D (selected)
row E
(row A is scrolled out of sigth and D remains (visually) the 4th row in the view)
Is there any easy way how to achieve this ? I tried a number of approaches but all end up with an annoying scrollpane jitter.
I'd try to call JViewPort's scrollRectToVisible(Rectangle contentRect) for the JScrollPane.getViewPort() and keep the parameter Rectangle's size the same (JViewPort.getViewRect()) but adjust the y-position by amount returned by JTable.getRowHeight() + JTable.getRowmargin(). This would be done after row wuold be added and only if vertical scrollbar is visible.
Maybe this is what you have tried already. Anyway I hope this helps.
Similar Messages
-
I have a used iMac 21.5 in that i would like to reset the apple id so when I get updates in goes to my id instead of the previous owners id. Which in the case is a relative. How can I do this ?
The Mac, it's OS and the iLife apps are still associated with the original owners Apple ID.Normally the original owner needs to follow the process to prepare a Mac for selling or giving it to someone else. They need to call Apple Care and request that their Apple ID be disassociated from the Mac, erase the Mac and install the most recent version of OS X that shipped on the Mac, reinstall the iLife apps and deauthorize the Mac from their iTunes account.
If you have a bill of sale of some sort and can prove the Mac beongs to you, Apple may be able to assist you. Call Apple Care and explain the issue. -
Icon in StandardTile causes tile to re-enter container when model is updated
Hi,
I am building an app with a TileContainer and respective StandardTiles. The number and info properties of these tiles are bound to a global model which is updated by an interval timer.
If the tile has an icon set, an animation lets fly in this tile into the container every time the model is updated. This makes the tile container unusable.
Example: http://jsbin.com/jipetize/3/edit
Can this be confirmed to be a bug? Any workarounds?
Cheers,
MatthiasHi Matthias,
Seems to be issue with SAPUI5 Icon. if we provide icon other than sapui5 icons then it is working fine for eg http://jsbin.com/jipetize/5/edit
Regards,
Chandra -
Dynamic update of cursor records when table gets updated
Hi,
I am having a table with 4 columns as mentioned below
For a particular prod the value greater less than 5 should be rounded to 5 and value greater than 5 should be rounded to 10. And the rounded quantity should be adjusted with in a product starting with orderby of rank with in a prod else leave it
Table1
Col1 prod value1 rank
1 A 2 1
2 A 6 2
3 A 5 3
4 B 6 1
5 B 3 2
6 B 7 3
7 C 4 1
8 C 2 2
9 C 1 3
10 C 7 4
Output
Col1 prod value1 rank
1 A 5 1
2 A 5 2
3 A 3 3
4 B 10 1
5 B 0 2
6 B 6 3
7 C 5 1
8 C 5 2
9 C 0 3
10 C 4 4
I have taken all the records in to a cursor. Once after rounding the request of 1st rank and adjusting the values of next rank is done. Trying to round the value for 2nd rank as done for 1st rank. Its not taking the recently updated value(i,e adjusted value in rounding of 1st rank).
This is becoz of using a cursor having a value which is of old value.
Is there any way to handle such scenario's where cursor records gets dynamically updated when a table record is updated.
Any help really appreciated.
Thanks in AdvanceHi,
Below is the scenario. Which I am looking for.
ITEM_ID(A)
ITEM_ID Value Date
A 3 D1
A 5 D2
A 3 D3
A 5 D4
A 3 D5
A 5 D6
Rounding for Item A has to be done for the rows less then D2 and rounding value is
x and value adjustment to be done from very next row.
--For record D1 rounding to be done and value adjustment is to be done from D2 to till the end untill the adjustment value is 0.
--For record D2 (updated value has to be taken from rounding which updated in D1 row rounding) and the adjustment has to be done from very next row D3 to till the end or adjustment value is o.
--For D3 row onwards no rounding has to be done.
ITEM_ID(B)
B 7 D1
B 8 D2
B 9 D3
B 5 D4
B 4 D5
B 3 D6
Rounding for Item has to be done for the rows less then D3 and rounding value is
y and value adjustment to be done from very next row.
--For record D1 rounding to be done and value adjustment is to be done from D2 to till the end untill the adjustment value is 0.
--For record D2 (updated value has to be taken from rounding which updated in D1 row rounding) and the adjustment has to be done from very next row D3 to till the end or adjustment value is o.
--For record D3 (updated value has to be taken from rounding which updated in D2 row rounding) and the adjustment has to be done from very next row D4 to till the end or adjustment value is o.
--For D4 row onwards no rounding has to be done.
Thanks in Advance
Edited by: unique on Apr 16, 2010 11:20 PM -
I manually manage my music on my iPhone 4S but I used to be able to update song information, lyrics for example, in iTunes and it would update on my iPhone when I synced it. It no longer does that. I've never had this problem before and I updated both iTunes and the iPhone firmware and no luck. I don't think this is something new in iOS (at least I hope Apple isn't that stupid), so does anyone have any ideas?
Hello! Unfortunately, MusicFree got removed from the app store, along with all the other music downloader apps. We hope to release a new version of it, but it will not have the downloading capabilities.
-
App tabs are not saving nor highlighting when I get updates
When I restart Firefox, my app tabs sometimes saves, and sometimes they do not. Also I open a new window in a current session, my app tabs do not save between windows. I would expect them to be on every window I opened; otherwise, they'd really be no different from normal tabs.
Also, Firefox says that when an app tab updates, it will highlight. However, my hotmail app tab and my facebook app tab will not highlight no matter how many emails or facebook notifications I receive.
Edit:
Is there a way to have the app tab save the page you pinned. For example, have it save my facebook wall and have it open my facebook wall when I restart firefox instead of having it load a friend's profile page?The app tabs feature is still in a relatively early stage of development. The option to remember app tabs independently of sessions has not yet been implemented, but it will be part of the release version of Firefox 4.
-
How can I get right data in a cell of JTable when table enter editing
how can I get right data in a cell of JTable when table enter editing
how can I get right data in a cell of JTable when table enter editing
-
Ipad will come on when you hit home and then slide the unlock bar works fine - then when you get to the home page where the icons are, nothing works - not the home button, it wont rotate, scroll, cant choose icons...nothing. help!
The home button is the main button off the screen - where is the sleep button? When I hit home I only see the lock slider (its black) and a button that has a flower on it that pulls up photos we took that are on the ipad. Thanks for your help!
-
JTable containing checkbox column is not getting updated
My application has a JTable and the first column is made up of checkboxes I have added a mouse listener for this table and implementd mousePressed(MouseEvent) method also. So when the user presses the mouse on these checkboxes I will update my loca data structure. Now the problem is this, when the user presses and drags the mouse to some other place(out of the current cell) then the table is not getting updated(the cell is not changing its value). But my local data structure is getting updated as the event is already fired. Please suggest me a solution for this.
Thanks in advance
Varunthanks for your information. Actually I have seen this tutorial before but I think my case is little different. Sorry for not explaining it completely. My table has got a checkbox column header and another checkbox which is not part of the table. The second column in the table contains a user object. User can select rows by clicking on the checkbox header (select all rows/ deselect all rows), by clicking on individual cells or by clicking on the third checkbox provided for a specific purpose. So whenever the user does this "selection" operation I update one member variable in the user object which is in the second column. I tried putting my code in the setValueAt() method of my table model but couldn't make it work because of my lack of experience in swing or programming. So please tell me whether what you have suggested is valid or not. I added a mouse listener because there was a requirement to show some information to the user when he do a double click on one column of the table.
-
When I get to the login page on my macbook, I type in my password and it starts to load, but then the screen turns blue and it goes back to the login.
Iv tryed this numerious times still keeps going back to pasword. Can not get any further. Tried restart holding shift key.. still nothing. What do i do?Thank you for your help.
I couldnt get to the hard drive/ desktop. Soft login not even working. So i could not do any of that.
In the end i took it to Apple and its actually the hard drive on its way out. A common issue with that series of Mac. Funny seeing i dont use this mac much. However being 2.5 years old and out of warrently, Apple have recognise this issue with this series/ Model and installing a new hard drive at no cost.
Very luck and greatful. And not feeling so dumb that it was something i did or could troubleshoot myself.
Hope this helps others that it just might be your hard drive failing. -
During iTunes installation, when it comes to installation phase "Registering iTunes automation server"... I am getting following error message:
"Microsoft visual C++ runtime Library"...
"Runtime Error! Program: C:\program files (x86)\iTunes\iTunes.exe"
"R6034
An application has made an attempt to load the C runtime library incorrectly. Please contact the application's support team for more information."
My system is Windows 7 Enterprise - Service Pack1Check the user tip below.
https://discussions.apple.com/docs/DOC-6562 -
My macbook pro shuts down unexpectedly when battery gets to 20% and is not plugged in
Why does my macbook pro keep shutting down when it gets to 20% without warning?
here is my battery information:
Battery Information:
Model Information:
Serial Number: SMP-ASMB014-3774-64a
Manufacturer: SMP
Device name: ASMB014
Pack Lot Code: 0002
PCB Lot Code: 0000
Firmware Version: 0110
Hardware Revision: 0500
Cell Revision: 0102
Charge Information:
Charge remaining (mAh): 3395
Fully charged: No
Charging: No
Full charge capacity (mAh): 3677
Health Information:
Cycle count: 1148
Condition: Fair
Battery Installed: Yes
Amperage (mA): 385
Voltage (mV): 12442
System Power Settings:
AC Power:
System Sleep Timer (Minutes): 10
Disk Sleep Timer (Minutes): 10
Display Sleep Timer (Minutes): 5
Automatic Restart On Power Loss: No
Wake On AC Change: No
Wake On Clamshell Open: Yes
Wake On LAN: Yes
Display Sleep Uses Dim: Yes
Battery Power:
System Sleep Timer (Minutes): 10
Disk Sleep Timer (Minutes): 10
Display Sleep Timer (Minutes): 2
Wake On AC Change: No
Wake On Clamshell Open: Yes
Display Sleep Uses Dim: Yes
Reduce Brightness: Yes
Hardware Configuration:
UPS Installed: No
AC Charger Information:
Connected: Yes
Charging: No
WHAT DOES IT ALL MEAN??That many cycles is amazing service. A battery that consistently shuts down at about the same charge level percentage every time probably has a bad cell (that info came form an Apple technician) and needs to be replaced.
It's given you far longer service than many of us get, and may be a new record around here for cycle count! -
I have a Mac Os X and a Sony HDR-CX7 camcorder. When I get onto the Sony webpage to download the program so I can import my movies, they only have programs Windows. How do I get this for my Mac.
You shouldn't need any application except what you already have: iMovie, iDVD, iPhoto....
To check on compatibility with your model camcorder, check these out:
https://support.apple.com/kb/HT3290
http://support.apple.com/kb/TS3356
Some formats are not readable by the above; you can use something like MPEG Streamclip to convert the footage or Quicktime Pro (as mentioned in one of the articles). -
My horizontal scroll bar went missing when I maximise the window. How do I fix them?
My horizontal scroll bar went missing when I maximise the window. How do I fix them? I tried everything; such as auto hide the task bar. Even with this, I still can't see the horizontal scroll bar. I even tried the following and I still can't see the horizontal scroll bar.
1) In a new tab, type or paste about:config in the address bar and press Enter. Click the button promising to be careful.
(2) In the search box above the list, type or paste dom and pause while the list is filtered
(3) Double-click the dom.disable_window_open_feature.scrollbars preference to switch it from false to true. By choosing true, you disable sites from deciding whether there can be scrollbars on a window, and Firefox uses its standard behavior for the page.
If you want to always get other bars, here are the corresponding settings:
Menu Bar: dom.disable_window_open_feature.menubar
Navigation Toolbar: dom.disable_window_open_feature.toolbar
Bookmarks Toolbar: dom.disable_window_open_feature.personalbar
Please help.Can you post a screen shot?
Taking a Screen shot; '''''Windows > Start >''''' search box '''''> Snipping Tool'''''.
Save the picture(s) to your desktop. Now look at the '''Reply''' box below.
Do you see the button under it that says '''Browse'''? Click it and then select
the screen shot(s) from the desktop. -
I recently got a Wireless-G Broadband Router modele WRT54GS. When I get to step 8 on the setup disk, I press "Next", and it starts to check my computer's settings. It then asks for a password, so I enter "admin" like I've been told. It starts to check my computer's settings again, and then asks for the password. It keeps happening. Am I doing something wrong?
I have Windows 7. I'm getting signal, but it's not letting me connect to the internet at all (except for Google, for some reason). Oh, and it's brand new, straight out of the box. Thanks.Perhaps you need to do the manual way of setting up the router.
For Cable connection, here's the procedure.
For DSL connection, here's the procedure.
Maybe you are looking for
-
New Partner Function in CRM (Solution Manager Service Desk)
Hi CRM Gurus!, Even if this problem is present in my Solution Manager Service Desk I'm creating this thread here in CRM Forum because I thin'k I need the experience of one CRM Expert. Í´ve created this question in Solution Manager Forum also but I
-
How to download adobe download manager
i wanted to download a trail but it said i must install adobe download manager i treid but i don't now how can someone plz hlp me
-
Maximum LUN size (2TB?) on Mac OS X Server 10.4.9 (Intel)
We have a newly acquired Xserve (Quad Xeon) with the Apple (LSI OEM) Dual-Channel 2Gb FC HBA. The system is attached via a Sun (QLogic OEM) SANbox2-16 switch to a Sun 3511 (SATA-based FC array). The Sun 3511 is configured with a single RAID5 volume/p
-
Adobe photoshop starter edition - tags
I want/need to reinstall my computer. But, I got a problem with Adobe photoshop starter edition. I would like to save all the created/assigned tags for my photo collection (+ 5000 photo's) So, here is the question. Where are the tags saved (filename
-
Constant re-authorization of purchased music
When I open Itunes, i can play all my purchased music fine. But when I open IDVD or an IPhoto slide show that uses purchased music, it constantly asks to authorize the computer to play the song again. Its to the point where I cannot even open idvd wi