Applet focus issues

B

Brian Peschel

(I also posted this on the java.net forums)

I have 2 issues with an applet I have inherited (didn't write it, just
support it), the first more serious than the other.

Issue 1:
Our applet runs in a browser and displays 9 jpg images displayed in a
grid. Our Canvas is only large enough for one image, so we display
scroll bars for to allow the user to see all 9 images.

If we display our applet and the browser is too small to see (ie the
bottom of the applet where the E/W scroll bar is, is not visible and
need to user the browser scroll bar to adjust the applet to see it),
the E/W scroll bar will not work. It doesn't change colors when the
mouse is over it (like the N/S scroll bar), click dragging on the bar
doesn't work, and choosing anything in the right click popup menu
doesn't work.

If we change the browser zoom (ctrl + or ctrl -) so the entire applet
is visible and restart the applet the E/W scroll bar will not work.
The reverse is also true. If the E/W scroll bar works, and we change
the browser zoom so it isn't visbile and restart the applet, the E/W
scroll bar will stop working.

Minimizing the browser and maximizing, changing to another program and
back will all get the E/W scroll bar working again.

Issue 2:
We have a similar problem with some dialogs. Our applet will popup
Dialog dialogs. Occationally, when the dialog opens, the user can not
click in any of the JTextField fir text entry. The cursor never
appears in the field. We solved this by:
class Mouse_Listener extends MouseAdapter
{
public void mouseClicked( MouseEvent e )
{
if (e.getSource() == address_text )
{
if (!address_text.hasFocus() && !address_text.requestFocusInWindow())
JOptionPane.showMessageDialog(_address_controls, "requestFocus
Failed","Warning",JOptionPane.WARNING_MESSAGE);
}
<snip>

which check for the mouse click but not the focus and throws up a
dialog that when closed, allows for entry in the field. But, this is a
hack in a half. Requiring the operator to click a dialog for fix a
focus problem seem wrong to me.

I suspect the two problems might be related (both focus issues?) but I
don't know. I can't use the showMessageDialog() hack for the scroll
bar, since I don't really have access to the scroll bar.

Any thoughts at all? This has 4 different people in my office
stumped....

- Brian
 
B

Brian Peschel

I might really help to know which browser and which platform you are
running this on.  Can we see the applet?

I have personally seen the scroll bar problem on Windows XP Home/IE 7,
XP Pro/IE 7, XP Pro/Firefox 3.0.6. I have reports from my customers
about Firefox 2 & 3 and IE 6 & 7.

I have seen the JTextField under RedHat WS3 and Fedora Core 8 Firefox
2.

I can't give the source to the applet, but I will try to make a test
applet that reproduces the problem.

- Brian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top