craftleft.gif (3002 bytes)QuickTable
Home | API | Tutorial | Download | Support | Contact topblack.gif (108 bytes)


QuickTable User Cp  |  Register  |  Members  |  Search  |  Help
    |- QuickTable Discussion Forums > Events/Actions Post New Topic   Post A Reply
TableHeader MouseListener printer friendly version
next newest post | next oldest post
Author Messages
brunorobertson
Unregistered
Edit or delete this message Reply w/Quote
Posted Monday, March 26, 2007 @ 23:01:25  

Hi, I am trying to perform an action when a user hold CTRL and Click over a ColumnHeader.

How is the best way to do it?

I am trying to add a Mouselistener on the original Table Header:
quicktable.getTable().getTableHeader().addMouseListener(listener);

The event is fired. But I dont know how can i get the Modifiers for check if the Control was holded.

Can you help me with this little task?

Thanks a lot

Bruno

brunorobertson
Unregistered
Edit or delete this message Reply w/Quote
Posted Monday, March 26, 2007 @ 23:04:41  

Look: The problem that i have is that the keyCode returnet is wrong:

if ( e.getModifiers() == KeyEvent.VK_CONTROL ) {
System.out.println("Control Pressed");
}

System.out.println("Control Key: " + KeyEvent.VK_CONTROL);
System.out.println("Modifiers: " + e.getModifiers());

ControlKeyCode is 17.
When you hold Control and click: prints 18 (Shift key code)
If you hold Shift everyhing works fine.

I really dont know what is happening...

Thanks

Bruno

brunorobertson
Unregistered
Edit or delete this message Reply w/Quote
Posted Monday, March 26, 2007 @ 23:07:51  

Ok Thanks a Lot.

Forget this issue ... My fault! :)

I didn't see that the MouseEvent has an isControlown() method

Please ignore it.

Thanks

Bruno

brunorobertson
Unregistered
Edit or delete this message Reply w/Quote
Posted Monday, March 26, 2007 @ 23:10:38  

Ok based on this, now I have aquestion (really):

when i click on column header, this column is sorted.
I would like to avoid the sort operation when a user hold control and click on the header.

Is it possible?

Thanks a lot.

Bruno

Admin
Board Owner

Gender: Unspecified
Location:
Registered: Jul 2003
Status: Offline
Posts: 9

Click here to see the profile for Admin Send email to Admin Send private message to Admin Find more posts by Admin Edit or delete this message Reply w/Quote
Posted Tuesday, March 27, 2007 @ 16:01:35  

This discussion might be helpful
http://quicktable.org/discussion/cutecast/cutecast.pl?forum=11&thread=243

You can also search on 'sort' in forum which would give some other threads related to this.

Post New Topic   Post A Reply Jump to:
Contact Us | QuickTable - A Java DBGrid | Privacy Policy All times are GMT -5 Hours.
Welcome to QuickTable Forums, Guest!  
Login
Username :
Password :
In order to fully utilize the abilities of this board, you are required to register as a member. Registration is free, and allows you to do lots of things including turning on or off certain features of this board. Register now!
Powered by CuteCast v2.0 BETA 2
Copyright © 2001-2003 ArtsCore Studios