Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JTable in JScrollPane : dragging colums  RSS feed

 
Frank Wynants
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have the following small problem.
I have the following items :

- A JTable of several screens wide
- The JTable is inside a JScollPane
- The user is able to drag the columns to another position.

Now when the user wants to drag the 1st column all the way to the back he has to do this in steps :
1. Drag the column to the right edge of the screen
2. Scroll the JScrollPane to the right
3. Repeat step 1 and 2 until finished

Isn't it possible that when you are dragging a column and you go off screen in either direction the JScrollPane starts scrolling in that direction (when the JTable is in a JScrollPane).
Or can I attach any listener to the TableColumn's that listen for dragging and grab the current screenposition of the JTableColumn? In that case I can at least write some code to push the JScrollPane around automaticly.
 
Mom Hurley
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use this code inside of a JTable subclass:

 
Rob Spoor
Sheriff
Posts: 21047
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello "Mom",

Please read your private messages regarding an important announcement.

Thank you,

Rob
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!