Please Help! What causes JTable to shrink w/in JScrollPane?
I've looked everywhere for the answer for this, and lots of people have the same problem, but it never seems to get answered.
I have a JTable (3 columns) in a JScrollPane.
printerTable.setModel(data, colNames)
scrollPane = new JScrollPane(printerTable, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); Initially, the columns fill the entire width of the scrollpane. But when I refresh the data, the columns shrink and a white space is left on the far right side. What do I need to do to get the columns to always span the width of the scrollpane? Do I have to fire events?
I've tried all sorts of things, including...
printerTable.setPreferredScrollableViewportSize(printerTable.getPreferredSize());
printerTable.sizeColumnsToFit(-1)and I've tried setting preferred, min and max widths. Is there some order you have to put them in?
This is soooo frustrating...I've spent days trying to get this right and I haven't accomplished anything.
Thanks for trying to help guys! Actually I think I've finally gotten it to work! What a relief!
I figured I post it, since I've seen lots of posts from people having the same problem...
I created my own class that extended JTable and overrode the getScrollableTracksViewportWidth() to return true (I was only going to have 3 columns, not any more).
The other things that I had to do were:
queueTable.setAutoCreateColumnsFromModel(false);
queueTable.setPreferredScrollableViewportSize(new Dimension(200, 150)); //w x h
queueTable.setAutoResizeMode(MyJTable.AUTO_RESIZE_OFF);Plus, I removed the following that I had put in previously:
//queueTable.setPreferredSize(new Dimension(290,900));
//queueTable.setPreferredScrollableViewportSize(queueTable.getPreferredSize());I also didn't need to set the min, max, & preferred column widths or the preferred size of the table.
Similar Messages
-
I am unable to open some of apps, even one inbuilt app like camera, Example : regarding apps like Clash of clans and Bike race TFG.whenever I try to open these games, it start opening and in middle of opening , it sent me back to home page of my mobile. Please help what to do ?and with camera it open a blank black page ...... Please help ?
AmishCake has given you the correct steps for this issue. What is probably happening is you have too many apps running in the background or the ones that you have open are conflicting in some way with the one you are trying to use, so closing everything out and a good reboot should resolve it.
Also, make sure your device is updated and all the apps are updated. Sometimes when the app is updated and the iOS is not, can cause behaviour like this.
If it continues, back up your device and restore it.
http://support.apple.com/kb/ht1414 -
My iphone 5 doesn't sync with itunes on my pc. it says this computer has previously been synced to another io6 device or iphone? please help what to do?
The error message you're seeing is likely the other way around -- i.e. something like "This iPhone has previously been synced with a different computer". There's no problem syncing multiple iOS devices to the same computer.
However, the reverse is not true for the iPhone -- you cannot connect an iPhone to another computer without it being erased, even if you manually manage music and video. So, it sounds like you've been syncing your iPhone to a different computer?
Also, 5.1 (not 5.0.1) is the latest iOS. -
While installing windows with bootcamp error showing "A require Cd/Drive driver is missing" in the middle of installation m not able to install windows on my mac . Please help what to do ??
What DVD drive are you using?
-
I have Iphone 4s on iso 6.1.3 I have tried to Update it to Iso 7.0.4 but the phone stuck on Recovery mode and now i cant update it or restore it to the old iso so please help what i should do?
READ the article from which the question was posted and follow all the troubleshooting steps.
-
I bought a iPhone and I was able to log into my iCloud with no problem and when I tried to update it it kicked me out and now it's asking me for the old apple user please help what can I do...?
Contact the original owner, and ask them to remove the device from their icloud.
http://support.apple.com/kb/PH13695
HTH -
Hi When i create the downpayment process in the invoice i get amount as value but my requirement is in percentage even after i select the percentage basis milestone billing please help what can be done
downpayment percentage , so if i want 50 percent of order value to be paid and when i go to faz type the invoice is created for 0 value that 50 percent of the amount is not getting calculated , where as when i enter in order same as 50 percent in amount it gets calculated in invoice, any help ?
-
I have got my iPhone 5 and i have forgot my passcode i have tried to restore and update via my windows computer and it still says sorry this iphone has a password please enter it before you sync but i dont know it ? Please help what do i do????!!
Locked Out, Forgot Lock or Restrictions Passcode, or Need to Restore Your Device
1. iOS- Forgotten passcode or device disabled after entering wrong passcode
2. iPhone, iPad, iPod touch: Wrong passcode results in red disabled screen
3. Restoring iPod touch after forgotten passcode
4. What to Do If You've Forgotten Your iPhone's Passcode
5. iOS- Understanding passcodes
6. iTunes 10 for Mac- Update and restore software on iPod, iPhone, or iPad
Forgotten Restrictions Passcode Help
You will need to restore your device as New to remove a Restrictions passcode. Go through the normal process to restore your device, but when you see the options to restore as New or from a backup, be sure to choose New.
Also, see iTunes- Restoring iOS software. -
my apple id have been blocked an i do not remember the identity or security question please help what can i do?
If your account is disabled you might be able to re-enable it via this page : http://appleid.apple.com, then 'reset your password'
You might then need to log out of your account on your iPhone and iPad by tapping on your id in Settings > iTunes & App Storeand then log back in so as to 'refresh' the account on it.
For your security questions, if you have a rescue email address (which is not the same thing as an alternate email address) on your account then the steps half-way down this page will give you a reset link on your account : http://support.apple.com/kb/HT5312
If you don't have a rescue email address then you will need to contact Support in your country to get the questions reset.
Contacting Apple about account security : http://support.apple.com/kb/HT5699 (you can also try this link if you can't get your account enabled via the above)
When they've been reset (and if you don't already have a rescue email address) you can then use the steps half-way down the HT5312 link above to add a rescue email address for potential future use -
I received message: cannot download, select tools, download only and download manually (something like that). Please help, what does this mean?
Exactly what it says.
Do as the message says. -
My iPhone apps wouldn't open they just blink for a second and the home screen comes back again...i tried installing a free app from the AppStore but it didn't work and also tried resetting the iPhone but ddnt work as well please help what do i do??
Oh my gosh I had the EXACT same problem, and for ages I couldn't figure out how to fix it until today. Here's what I did:
First I went onto my computer, opened itunes, and un-installed tumblr, vine and kik. These were the apps I was having problems with (it said I had them on my phone but, like you, they didn't show).
Then I went to the itunes store, searched for each one, and it said I could update them so I did (just FYI: for tumblr a window popped up saying "please click ok to confirm you are 17 years or older", so I did that also)
When I went back to my phone and tried installing them again (still on my computer), it worked!
I hope this helps, because it was incredibly frustrating. Good luck! -
I bought an apps "Latitude". when i tried to see my friends list its showing error - "nsurlerrordomain error 999". Please help what should i do??
Google 'nsurlerrordomain error 999' and see the hits there!
-
I receive this message ,repeatedly,when I try to update an App through App store:Error code 1009.Please help,what should I do?
The App Store is not available in Iran.
-
I am unable to download Acrobat XI Standard purchased 19Feb15 & unable to locate on your web site simple steps to do this - please help; what am I not doing?
Make sure you have cookies enabled and clear your cache. If it continues to fail try using a different browser.
-
I have 0.01$ in my account and it's not allowing to change my country detail before I spend. There is nothing I can spend 0.01$ on. Please help, what can I do?
gee hong wrote:
I have 0.01$ in my account and it's not allowing to change my country detail before I spend. There is nothing I can spend 0.01$ on. Please help, what can I do?
Contact iTunes Customer Service and request assistance
Use this Link > Apple Support iTunes Store Contact
Maybe you are looking for
-
A problem with the Bembo font in Pages
I've designed a document using the Bembo font and it keeps substituting "Expert" for "Regular." I've actually removed "Expert" from my font book and yet I'm still having this problem. Any suggestions for how to fix this glitch?
-
Safari on my iPad won't display this URL
http://radar.weather.gov/radar.php?rid=LWX&product=NCR&overlay=11111111&loop=yes Any clues?
-
Site Not Working On Firefox?
Hello. This might be more of an issue with Tumblr itself, as opposed to Firefox, but I figured it would be worth posting here as well, since this is an issue that seems to be happening only on Firefox. I have contacted Tumblr regarding this issue, so
-
HI, after I have opened a file or two, when I attempt to open a third I get a "cannot complete request due to a program error" And can't open anything else until I quit the program and open it again. I've tried re-installing the software, but to no
-
Adobe 9.0 Pro deleting signature field
How do you delete a signature field in adobe 9.0 pro or standard? I can clear the signature, but not delete it entirely. I need to show engineers how to do this in case they create it the wrong size or in the wrong place. In adobe 7.0 pro and standar