Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / March 2005

Tip: Looking for answers? Try searching our database.

Cross platform compatibilty (Windows ME)

Thread view: 
Joe - 13 Mar 2005 21:39 GMT
I'm teaching myself java and have been trying a small gui
example from a book, using swing.

Basically, it creates a window with a couple of pull-down
menus. I've found it to work fine on solaris, linux and
Windows 98 machines. However, if I run it on my Windows ME
laptop then the menus drop down, but if the mouse is moved
over them then they are dead - ie. nothing is hightlighted
or can be selected.

As a java beginner, I'm at a loss to know what the problem is
or how to resolve it. Anyone got any ideas?

I'm using Java 1.5.0_01 on both the Windows 98 and Windows ME
machines.

Thanks in advance,

Joe
John McGrath - 14 Mar 2005 05:33 GMT
> Basically, it creates a window with a couple of pull-down
> menus. I've found it to work fine on solaris, linux and
> Windows 98 machines. However, if I run it on my Windows ME
> laptop then the menus drop down, but if the mouse is moved
> over them then they are dead - ie. nothing is hightlighted
> or can be selected.

I just tried a simple JMenu example on an ME box, and it worked fine.
It was using 1.5.0_02, but I have no reason to believe that would be
different from _01.

Signature

Regards,

John McGrath

Thomas Weidenfeller - 14 Mar 2005 09:11 GMT
> Basically, it creates a window with a couple of pull-down
> menus. I've found it to work fine on solaris, linux and
> Windows 98 machines. However, if I run it on my Windows ME
> laptop then the menus drop down, but if the mouse is moved
> over them then they are dead - ie. nothing is hightlighted
> or can be selected.

We can only guess, since you didn't provide any code (small, complete,
compiles and runs). Maybe it is one of these:

a) A broken graphics driver. Java is known to react strange with older
graphics drivers

b) You mixed up your event handling

c) You mixed up your threading handling.

/Thomas

Signature

The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq

Joe T - 14 Mar 2005 18:20 GMT
>> Basically, it creates a window with a couple of pull-down
>> menus. I've found it to work fine on solaris, linux and
[quoted text clipped - 14 lines]
>
> /Thomas

Hi Thomas,

Sorry, I didn't want to clutter up the posting with code as I have verified
that the code is OK, as it runs correctly everywhere apart from my Windows ME
laptop. Just though someone might immediately be aware of a Windows ME issue.

The code is actually from the book "Beginning Java 2" by Ian Horton. To reduce
the posting size, I have stripped it down to contain just one menu:

Main file Sketcher.java:
========================
import java.awt.Toolkit;
import java.awt.Dimension;

public class Sketcher {
  public static void main(String[] args) {
        window = new SketchFrame("Sketcher");
        Toolkit theKit = window.getToolkit();
        Dimension wndSize = theKit.getScreenSize();

        window.setBounds(wndSize.width/4, wndSize.height/4,
                wndSize.width/2, wndSize.height/2    );

        window.setVisible(true);
  }

  private static SketchFrame window;

}

SketcherFrame.java:
===================
// Frame for the Sketcher application
import javax.swing.JFrame;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.JMenuItem;

import javax.swing.JCheckBoxMenuItem;
import javax.swing.JRadioButtonMenuItem;
import javax.swing.ButtonGroup;

import javax.swing.KeyStroke;
import java.awt.Event;

public class SketchFrame extends JFrame {
  // Constructor
  public SketchFrame(String title) {
    setTitle(title);                             // Set the window title
    setDefaultCloseOperation(EXIT_ON_CLOSE);

    setJMenuBar(menuBar);                        // Add the menu bar to the window

    JMenu fileMenu = new JMenu("File");          // Create File menu

    // Construct the file pull down menu
    newItem = fileMenu.add("New");                // Add New item
    openItem = fileMenu.add("Open");              // Add Open item

    menuBar.add(fileMenu);                       // Add the file menu
  }

  private JMenuBar menuBar = new JMenuBar();     // Window menu bar

  // File menu items
  private JMenuItem newItem, openItem;

}

On my Windows 98 machine, if I click on the "File" menu then it drops down and
the "New" and "Open" options are highlighted as I move the mouse over them -
as they should.

Investigating this stripped down version I have found further odd behaviour
on my Windows ME laptop. I need to double-click on the "File" menu to get it
to drop down, but then nothing is highlighted if I move the mouse over it.
I've also notice that when I close the window down it has a tendency to leave
behind residual graphics on the desktop.

The laptop is a Toshiba Satellite (2001 vintage) and I recently did an OS
re-installation with the manufacturer supplied recovery disk - so the
video drivers are as supplied by Toshiba. However, I have just downloaded
and installed the latest available drivers from the Toshiba web site and
I still get the same behaviour. I've used the laptop from new as my main
machine and this is the first time I have have any graphics related problems.

Out of curiosity I installed the Jedit program, since it is a Java application.
I've found that the drop down menus work, but are a bit sluggish and there is
a tendency for two items to be highlighted simultaneously. Again, if I try on
my Windows 98 machine then everything is OK.

This is really frustrating, at the moment the only way I can do java
development on my laptop is to start an x-server and connect wirelessly
to my linux desktop machine!

Regards,

Joe

   
Joe T - 15 Mar 2005 19:38 GMT
Hi Thomas,

I did a bit more research and have discovered that the problem is
due to the use of a Trident Cyberblade graphics card:

    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4839812

I found that if I add the "-Dsun.java2dd3d=false" switch to the Java
call then the gui acts as it should.

Thanks for pointing me in the direction of graphics card bugs.

Regards,

Joe

>> Basically, it creates a window with a couple of pull-down
>> menus. I've found it to work fine on solaris, linux and
[quoted text clipped - 14 lines]
>
> /Thomas


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.