Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (753)
Games in Android Showcase (228)
games submitted by our members
Games in WIP (842)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / JInput / 2D scrolling with PowerBook/MacBook trackpad or Mighty Mouse? on: 2006-05-27 19:48:37

I would like to support two-dimensional scrolling with the Mighty Mouse trackball and the PowerBook scrolling trackpad, but I cannot figure out how to do it.

I tried to use AWT event handlers, but Apple's JRE only posts MouseWheelEvents for the vertical scroll component, and the listener is completely idle when only the horizontal component is non-zero.

(It'd be great if I could also provide cross-platform support for those PC mice that support horizontal scrolling action as well by rocking the mouse wheel right or left, but I can do without that for now.)

When i ran the controller test, I noticed that the "Apple Optical Mouse" has a Z axis that is controlled by horizontal movement on the trackball, but there is no axis to detect vertical motion (i.e. typical mouse wheel events).  For the internal keyboard/trackpad, JInput could detect X and Y finger movement, but there was nothing to indicate whether the user had one finger down (mouse movement) vs. two fingers down (scrolling).

If there's a way to make this work using JInput, I'd really appreciate your help.

2  Java Game APIs & Engines / JOGL Development / Resize GLCanvas freezes 15" PowerBook on: 2006-01-25 04:26:10
Hi, I am encountering a bug wherby resizing a GLCanvas in a JFrame results in my 15" PowerBook with ATI Radeon 9700 to freeze completely.  I can't command-tab to a different app, I can't access the dashboard, expose, or the dock, and my application does not respond to input from the mouse or keyboard.  Sometimes the mouse pointer moves for a short time, but eventually that freezes too.  Ultimately, I have to do a hard reboot.

I am running MacOS X 10.4.4 with Java 1.5 Release 4 Preview and JSR 231 beta 2.  Reverting back to JOGL 1.1.1 I do not experience the problem.

I have been unsuccessful at producing a small test program that causes a crash, and every demo I've tried works fine too.  I know that's not particularly helpful, but there was one old issue that seemed very similar (Issue 67):
but I can't figure out why switching from JOGL 1.1.1 to JSR 231 would suddenly cause me to experience a similar issue, and I thought perhaps someone might have an idea for me to try.

Here's a copy of the reshape method, which gets called every time a resize occurs; however, I can't reliably break inside the method, which leads me to believe the error is caused on another thread, but I have no idea how or where yet.  I know it's not enough to run or test, but if you see something suspicious in it that could lead to problems, please let me know as well...


   public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height)
      gl = drawable.getGL();
      //glu = drawable.getGLU();
      gl.glViewport(x, y, width, height);

      mapView.setPosition(15, height - 125);
      updateNow = true;

   /** In case window changes shape */
   void resetProjection(GLAutoDrawable drawable)
      if(width<0||height<0) return;
      gl = drawable.getGL();
      //glu = drawable.getGLU();
      // Select The Projection Matrix

      // Reset The Projection Matrix

      // Calculate The Aspect Ratio Of The Window
      System.out.println("Viewport: " + (int)width + ", " + (int)height);
      System.out.println("Perspective: " + (float)width / (float)height + ", " + depth);
      glu.gluPerspective(30.0f, (float)width / (float)height, 0.1f, depth);
      // Select The Modelview Matrix

      // Reset the Camera
3  Java Game APIs & Engines / JOGL Development / Re: Modal JDialogs disappear in presence of GLCanvas on: 2006-01-19 22:53:48
Ken, upgrading from Release 3 to Release 4 preview fixed my bug.  Sorry I didn't notice that bug report first.  Thanks for your help!
4  Java Game APIs & Engines / JOGL Development / Modal JDialogs disappear in presence of GLCanvas on: 2006-01-19 19:59:39

I am working on a multi-frame application that includes the use of a GLCanvas inside a JFrame.  When a modal JDialog is made visible, it renders until the user moves the mouse or presses a key, at which point it vanishes.  The only way to get it back is pressing Command-tilde until it reappears.

I am running MacOS X 10.4.4 and Java 1.5 Release 3.  I think it used to work with Release 1 and 2, but I have not yet had an opportunity to test it.  The problem exists for both JOGL 1.1.1 (and earlier) as well as the latest beta release of JSR 231.  The problem does not exist on Windows XP or Linux.

I developed a small test program that demonstrates the bug.  When the GLCanvas "gl" is in the JFrame, the dialog invoked by the JButton disappears.  It does not matter whether the dialog's parent is the frame itself, the hidden "null" JFrame, or some other Window.  Swap in the GLJPanel gl2, and the dialog problem does not occur.

Anyone aware of this problem, whether it's a bug in JOGL, and if there are any workarounds?


import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class DialogTest {
   public void init() {
      GLCanvas gl = new GLCanvas();
      GLJPanel gl2 = new GLJPanel();
      final JFrame frame = new JFrame("Test");
      frame.setLayout(new BorderLayout());
      frame.add(gl, BorderLayout.CENTER); // SWITCH BETWEEN GL & GL2 TO SEE EFFECT.
      JButton button = new JButton("Dialog");
      frame.add(button, BorderLayout.SOUTH);
      button.addActionListener(new ActionListener() {
         public void actionPerformed(ActionEvent e) {
            new JDialog(frame, true).setVisible(true);
      frame.setBounds(100, 100, 500, 500);

   public static void main(String[] args) {
      final DialogTest dialogTest = new DialogTest();
      SwingUtilities.invokeLater(new Runnable() {
         public void run() {
Pages: [1]
ivj94 (583 views)
2018-03-24 14:47:39

ivj94 (48 views)
2018-03-24 14:46:31

ivj94 (374 views)
2018-03-24 14:43:53

Solater (61 views)
2018-03-17 05:04:08

nelsongames (109 views)
2018-03-05 17:56:34

Gornova (151 views)
2018-03-02 22:15:33

buddyBro (693 views)
2018-02-28 16:59:18

buddyBro (91 views)
2018-02-28 16:45:17

xxMrPHDxx (493 views)
2017-12-31 17:17:51

xxMrPHDxx (733 views)
2017-12-31 17:15:51
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!