public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug AWT/21978] New: GCC 4.0 Awt and Swing problem linux 9.0
@ 2005-06-09 10:26 abilalh at yahoo dot com
  2005-06-09 12:40 ` [Bug AWT/21978] GCC 4.0 Awt and Swing problem pinskia at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: abilalh at yahoo dot com @ 2005-06-09 10:26 UTC (permalink / raw)
  To: java-prs

hi, i have redhat linux 9.0 installed(everything) in my pc, and i installed
gcc4.0, but when i complied the java program from deitel&deitel it throws
exceptions,


[root@dsn-bilal java test]# ./PopupTest
Exception in thread "main" java.awt.AWTError: Cannot load AWT toolkit:
   at java.awt.Toolkit.getDefaultToolkit() (/opt/gcc4.0/lib/libgcj.so.6.0.0)
   at java.awt.EventQueue.invokeLater(java.lang.Runnable)
(/opt/gcc4.0/lib/libgcj.so.6.0.0)
   at javax.swing.SwingUtilities.invokeLater(java.lang.Runnable)
(/opt/gcc4.0/lib/libgcj.so.6.0.0)
   at javax.swing.RepaintManager.addInvalidComponent(javax.swing.JComponent)
(/opt/gcc4.0/lib/libgcj.so.6.0.0)
   at javax.swing.JComponent.revalidate() (/opt/gcc4.0/lib/libgcj.so.6.0.0)
   at javax.swing.JComponent.setOpaque(boolean) (/opt/gcc4.0/lib/libgcj.so.6.0.0)
   at javax.swing.JPanel.JPanel(java.awt.LayoutManager, boolean)
(/opt/gcc4.0/lib/libgcj.so.6.0.0)
   at javax.swing.JPanel.JPanel() (/opt/gcc4.0/lib/libgcj.so.6.0.0)
   at javax.swing.JRootPane.createGlassPane() (/opt/gcc4.0/lib/libgcj.so.6.0.0)
   at javax.swing.JRootPane.getGlassPane() (/opt/gcc4.0/lib/libgcj.so.6.0.0)
   at javax.swing.JRootPane.JRootPane() (/opt/gcc4.0/lib/libgcj.so.6.0.0)
   at javax.swing.JFrame.createRootPane() (/opt/gcc4.0/lib/libgcj.so.6.0.0)
   at javax.swing.JFrame.getRootPane() (/opt/gcc4.0/lib/libgcj.so.6.0.0)
   at javax.swing.JFrame.frameInit() (/opt/gcc4.0/lib/libgcj.so.6.0.0)
   at javax.swing.JFrame.JFrame(java.lang.String) (/opt/gcc4.0/lib/libgcj.so.6.0.0)
   at PopupTest.PopupTest() (/root/java test/PopupTest.java:13)
   at PopupTest.main(java.lang.String[]) (/root/java test/PopupTest.java:67)
   at gnu.java.lang.MainThread.call_main() (/opt/gcc4.0/lib/libgcj.so.6.0.0)
   at gnu.java.lang.MainThread.run() (/opt/gcc4.0/lib/libgcj.so.6.0.0)
Caused by: java.lang.ClassNotFoundException:
   at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader)
(/opt/gcc4.0/lib/libgcj.so.6.0.0)
   at java.lang.Class.forName(java.lang.String) (/opt/gcc4.0/lib/libgcj.so.6.0.0)
   at java.awt.Toolkit.getDefaultToolkit() (/opt/gcc4.0/lib/libgcj.so.6.0.0)
   ...18 more
[root@dsn-bilal java test]#


i have installed gcc4.0 in /opt/gcc4.0 directory and i have checked its paths
using $PATH and $LD_LIB_PATH variables, i have previously installed gcc3.2.2 i
dont know what to do, please tell me step by step to resolve it, i dont know
weather any body have executed any swing program on gcc4.0 or not,



Version-Release number of selected component (if applicable):


How reproducible:
here is the java file

// Fig. 13.8: PopupTest.java
// Demonstrating JPopupMenus
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;

public class PopupTest extends JFrame {
   private JRadioButtonMenuItem items[];
   private Color colorValues[] = 
      { Color.blue, Color.yellow, Color.red };

   public PopupTest()
   {
      super( "Using JPopupMenus" );

      final JPopupMenu popupMenu = new JPopupMenu();
      ItemHandler handler = new ItemHandler();
      String colors[] = { "Blue", "Yellow", "Red" };
      ButtonGroup colorGroup = new ButtonGroup();
      items = new JRadioButtonMenuItem[ 3 ];

      // construct each menu item and add to popup menu; also
      // enable event handling for each menu item
      for ( int i = 0; i < items.length; i++ ) {         
         items[ i ] = new JRadioButtonMenuItem( colors[ i ] );
         popupMenu.add( items[ i ] );
         colorGroup.add( items[ i ] );
         items[ i ].addActionListener( handler );                
      }

      getContentPane().setBackground( Color.white );

      // define a MouseListener for the window that displays
      // a JPopupMenu when the popup trigger event occurs
      addMouseListener(
         new MouseAdapter() {
            public void mousePressed( MouseEvent e )
               { checkForTriggerEvent( e ); } 

            public void mouseReleased( MouseEvent e )
               { checkForTriggerEvent( e ); } 

            private void checkForTriggerEvent( MouseEvent e )
            {
               if ( e.isPopupTrigger() ) 
                  popupMenu.show( e.getComponent(),
                                  e.getX(), e.getY() );               
            }
         }
      );    

      setSize( 300, 200 );
      show();
   }

   public static void main( String args[] )
   {
      PopupTest app = new PopupTest();

      app.addWindowListener(
         new WindowAdapter() {
            public void windowClosing( WindowEvent e )
            {
               System.exit( 0 );
            }
         }
      );
   }

   private class ItemHandler implements ActionListener {
      public void actionPerformed( ActionEvent e )
      {
         // determine which menu item was selected
         for ( int i = 0; i < items.length; i++ )
            if ( e.getSource() == items[ i ] ) {
               getContentPane().setBackground(
                  colorValues[ i ] );
               repaint();
               return;
            }
      }
   }
}

-- 
           Summary: GCC 4.0 Awt and Swing problem linux 9.0
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: AWT
        AssignedTo: fitzsim at redhat dot com
        ReportedBy: abilalh at yahoo dot com
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21978


^ permalink raw reply	[flat|nested] 10+ messages in thread
[parent not found: <bug-21978-10794@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2005-10-16  1:47 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-09 10:26 [Bug AWT/21978] New: GCC 4.0 Awt and Swing problem linux 9.0 abilalh at yahoo dot com
2005-06-09 12:40 ` [Bug AWT/21978] GCC 4.0 Awt and Swing problem pinskia at gcc dot gnu dot org
2005-06-15 13:23 ` abilalh at yahoo dot com
2005-06-15 14:19 ` pinskia at gcc dot gnu dot org
2005-06-15 17:38 ` abilalh at yahoo dot com
2005-06-15 18:16 ` pinskia at gcc dot gnu dot org
2005-06-18 12:57 ` abilalh at yahoo dot com
2005-06-19  1:07 ` rmathew at gcc dot gnu dot org
2005-06-20 14:53 ` abilalh at yahoo dot com
     [not found] <bug-21978-10794@http.gcc.gnu.org/bugzilla/>
2005-10-16  1:47 ` [Bug awt/21978] " pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).