Re: Possible regressionn, popupmenus not appearing to work correctly with cntl-click

2013-10-31 Thread Paul Taylor

On 31/10/2013 11:11, Leonid Romanov wrote:
I see.. While it might pose an inconvenience in some scenarios on OS 
X, I don't think it's an issue, since Apple JDK 6 behaves the same 
way, so I'm going to close the bug.


Okay no problem, I now have it working for me since using 
setComponentPopup(). The only thing I would say is that is if Cntl-Click 
is meant to work the same as Right-Click on OSX in all situations it 
does seem there is a minor issue that it breaks my old code but this is 
no longer a problem for me.


On 29.10.2013, at 15:14, Paul Taylor paul_t...@fastmail.fm 
mailto:paul_t...@fastmail.fm wrote:



On 28/10/2013 12:29, Leonid Romanov wrote:

Hello,
I've filed a bug:
https://bugs.openjdk.java.net/browse/JDK-8027374

Hi, Ive think Ive found the issue for me , I created this test case 
and it works correctly as you say


import javax.swing.*;

public class TableTest
{
public static void main(String[] args) throws Exception
{
JPopupMenu popup = new JPopupMenu(Popup);
popup.add(new JMenuItem(Copy));
JTable test = new JTable(5,5);
test.setComponentPopupMenu(popup);
test.setRowSelectionAllowed(true);
test.setColumnSelectionAllowed(true);
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
JFrame frame = new JFrame();
frame.add(test);
frame.pack();
frame.setVisible(true);
}
}

But if you comment out the line

test.setComponentPopupMenu(popup);

so that there is no popup menu then it doesn't work, CntlClick will 
change the selection.


Whether this is a bug, or correct behaviour Im not sure  ?

But the reason why this is causing an issue for me in my current code 
is that Im not using setComponentPopupMenu()instead I'm adding a 
mouse handler to the table that then decides whether or not to show a 
popup menu so I guess the logic for Jtable must not detect that it 
has a popup menu in this case. I've checked and the method was not 
added to JTable until Java 1.5 and my code was started before then so 
hopefully I can just update my code to  use the method and the 
problem will go away for me.


Paul








How do I make my Java 7 OSX App draggable on toolbar only ?

2013-10-31 Thread Paul Taylor
Things were working okay with Java 6 ( and some custom libs) but now by 
default a Java 7 application is only movable on Mac if you click near 
the top of the window (like on Windows), however if I set


toolbar.getRootPane().putClientProperty(apple.awt.draggableWindowBackground) 



I can then move the window by dragging on the toolbar. Unfortunately 
because this property is applied to the rootpane, and then is just one 
rootpane for the frame that the whole applications is a part of the 
window moves where-ever I drag on it, I only want to be able to drag on 
it in the toolbar.


The main part of my application is a JTable and I really don't want the 
window to be moved when I dragclick here because it causes lots of 
problems such as I can now no longer reorder by table columns by 
dragging the table headers because that just moves the whole window. How 
can I limit movement to either:


1. Only the JToolbar
2. Everywhere except the Jtable

whichever is easiest.

thanks Paul