Nonnested classes can or can't be marked protected or final?

Why couldn't I do this all in the same file?
public class Test2 extends Test1
runMyFunc();
protected class Test1
void runmyFunc() { //do something cool }
Doesn't the protected modifier allow all subclasses within the same package
to access its methods? Does the absence of a package declaration (there
isn't meant to be one in this example) indicate that these two classes are not
in the same package? I'd figure that they'd both be in the default package.
Thanks
Paul

Well, there is no such thing as a protected modifier for (non-inner) classes.
A (non-inner) class is either public or not (giving it default or package-private access). So the following code will compile: public class Test2 extends Tes1
  // whatever you want
class Test1
  // whatever you want
}

Similar Messages

  • I have safari in my iPad but bookmark is not working. I can not book mark any things.  How do I get back my bookmark working so that I can open the web page I have already booked marked.  Thank you for your answer

    I have iPad 2.
    The safari bookmark was working yesterday.  Today book mark is not working.  I can not book mark anything. 
    Did I do anything to prevent stopping bookmark to store?  Please help me how to get back working my bookmark.  Thank you.

    See if this works.
    Quit the Safari app completely and reboot the iPad. Go to the home screen first by tapping the home button. Double tap the home button and the recents tray will appear with all of your recent apps displayed at the bottom. Tap and hold down on any app icon until it begins to wiggle. Tap the minus sign in the upper left corner of the app that you want to close. Tap the home button or anywhere above the task bar.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.

  • ORA-29534 error for Class can not be resolved

    HI,
    I am trying to load and resolve a third party jar file which has some JMS classes. But while using the loadjava utility,
    "loadjava -u scott/tiger@dbname -r -v -genmissing weblogic.jar"
    i get "ORA-29534: referenced object <Class Name> could not be resolved" error for most of the classes.
    This Jar file has around 15000 classes definitions and it takes almost a complete day to load and resolve it. Even after taking so much of time it is unable to resolve all the classes and give a runtime exception Class can not be resolved for some class.( i have created the oracle java stored procedure successfully)
    I need a help on this very urgently...
    Thanks in advance....
    Sachin

    Sachin,
    There are many possible causes for the error you are getting, for example:
    1. The DBMS_JAVA package is corrupt.
    (Have you previously successfully loaded JARs -- or even java classes -- into the database?)
    2. A java version mismatch.
    (What Oracle database version are you using, and what java version is your JAR file compatible with?)
    You say,
    Surely they are loaded but not resolvedIs this a question, or a statement? Have you verified that the classes are loaded and not resolved? I use the following query for this:
    select DBMS_LONGNAME(OBJECT_NAME), STATUS
      from USER_OBJECTS
    where OBJECT_TYPE like 'JAVA%'The value for the STATUS column should be 'VALID'.
    I'm only guessing, but you may find more information (regarding the error you are getting) in the Oracle log files. Have you checked them?
    Have you tried searching the MetaLink Web site?
    http://metalink.oracle.com
    (Search for "ORA-29516", perhaps.)
    Good Luck,
    Avi.

  • Yosemite many troubling system log messages:  For example:  com.swarmcast.mlbnexdefautobahn ;main class can't be found, iTunes msgs, location msgs, audit warnings

    I'm receiving many concerning messages on my macbook pro: 
    MacBook Pro (Retina, Mid 2012)
    2.6 GHz Intel Core i7
    16 GB 1600 MHz DDR3
    NVIDIA GeForce GT 650M 1024 MB
    OS: Yosemite 10.10 (upgraded)
    These messages start logging and never stop...  452 messages in 11 minutes.  
    11/11/14 11:17:33.878 AM MLBNexDefAutobahn[421]: main class can't be found.
    11/11/14 11:17:23.680 AM com.apple.xpc.launchd[1]: (com.swarmcast.mlbnexdefautobahn) Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
    11/11/14 11:17:28.586 AM com.apple.xpc.launchd[1]: (com.apple.imfoundation.IMRemoteURLConnectionAgent) The _DirtyJetsamMemoryLimit key is not available on this platform.
    11/11/14 11:17:28.809 AM locationd[58]: Couldn't find a requirement string for masquerading client /System/Library/PrivateFrameworks/Parsec.framework
    11/11/14 11:17:16.944 AM storeassetd[388]: multibyte ASN1 identifiers are  not supported.
    11/11/14 11:17:32.853 AM _nsurlstoraged[417]: audit warning: soft /var/audit
    11/11/14 11:17:32.853 AM _nsurlstoraged[418]: audit warning: allsoft
    11/11/14 11:17:32.854 AM _nsurlstoraged[419]: audit warning: closefile /var/audit/20141111181659.20141111181732
    11/11/14 11:17:34.221 AM com.apple.xpc.launchd[1]: (com.apple.imfoundation.IMRemoteURLConnectionAgent) The _DirtyJetsamMemoryLimit key is not available on this platform.
    11/11/14 11:17:36.032 AM locationd[58]: Location icon should now be in state 'Inactive'
    11/11/14 11:18:17.850 AM com.apple.usbmuxd[55]: LOCKDOWN_V2_BONJOUR_SERVICE_NAME is _apple-mobdev2._tcp,9336080d
    11/11/14 11:17:37.092 AM iTunes[332]: Entered:_AMMuxedDeviceDisconnected, mux-device:2
    11/11/14 11:17:37.092 AM iTunes[332]: Entered:__thr_AMMuxedDeviceDisconnected, mux-device:2
    11/11/14 11:17:37.092 AM iTunes[332]: tid:dc0f - Mux ID not found in mapping dictionary
    11/11/14 11:17:37.092 AM iTunes[332]: tid:dc0f - Can't handle disconnect with invalid ecid

    This cleared up the MLBNexDefAutobahn message...   not the rest however.
    Get This MLBAutobahnNexDef Whasit off my Activity Monitor
    1. Open your User folder.
    2. Go to Library folder ( might need to press down option key when select Go to find Library)> Application Support > Swarmcast
    3. Click UninstallAutobahn.command
    Wait and pray. Phew! Gone. It'll probably open your Unix terminal.
    [[EDIT: ACK! OSX Lion has hidden the Library folder. It's still there. TO find the User's Library folder in OSX, go to Finder and choose Go > Go to Folder... and type ~/Library in the box. ]]

  • Error with signed applet "class can't be instantiated"

    hi,
    I developed an applet to make a ftp connexion to upload files from the local disk and the applet is already signed. At first I compiled it with the 1.4 version and I got (from other computers) the error "class not found". Then I used the target 1.1 option and now I get the error "class can't be instantiated"
    Do I need any additional code?
    I am using all these imports
    import java.applet.Applet;
    import java.applet.AppletContext;
    import java.awt.*;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import javax.swing.JComponent;
    import javax.swing.JProgressBar;
    import javax.swing.*;
    Thanks

    go to
    Tools->Internet Options->Advanced
    Look for "Java (Sun)" (normally near Microsoft VM). I uncheck all the Microsoft VM options but am not sure if that is really necessary.
    Also play with Control Panel, you should see "Java Plug-in" in there and be able to configure browsers a bit with that.

  • Compiler says class can't be initialized

    ok, i know abstract classes can't be initialized, but i am extending my base class, but my complier says that "class ClassificationParser can't be initialized" but i am not initializing it. IF anyone can point out a problem, which i just can't see please do. Thank you..
    first is listed the base abstract class, second the extended class
    package cattlemanager.utilities.parsers;
    import java.util.Vector;
    import java.io.File;
    import java.io.IOException;
    * Title:        ClassificationParser
    * Copyright:    Copyright (c) 2001
    * Company:      None
    * @author Harold Smith III
    * @version 1.0
    public abstract class ClassificationParser
       * <p>This method returns the instance of a <code>Classification</code> objects
       * that the implementor can work with and use to there own extent. This allows
       * for the parser to read in all the file data, and insert it into the
       * <code>Classification</code> Objects that he or she wishes the user to
       * modify.</p>
       * <p><strong>Important</strong> - The <code>Vector</code> that is returned will
       *  contain a <code>Vector</code> of <code>Vector</code>'s that the implementor
       *  must work with. The reason for a <code>Vector</code> of <code>Vector</code>'s
       *  is the <code>Classification</code> data may contain several past <code>
       *  Classification</code> records.</p>
       * @return Vector the data vector.
      public Vector getData()
      { return vInternalClassificationDataObject;
       * <code>parse</code> is the default parsing mechanism for the read in data
       * that the user can integrate into there records. Using the <code>parse</code>
       * method, the implemented class will read in the specified <code>File</code>
       * and the <code>Classification</code> Objects will be initialized with tthe
       * read in data.
       * @param File the file to be parsed, should follow the specified format
       *  determined by the appropriate association.
       * @throws WrongFormatException if the file is not formatted to the standards
       *  the association has laid out.
       * @throws IOException if there is a file problem.
      public abstract void parse(File fName) throws WrongFormatException, IOException;
       * The internal <code>Vector</code> of objects that will be laid out as specified
       * in the <code>getData</code> method described within this class.
       * @see #getData
      protected Vector vInternalClassificationDataObject;
    package cattlemanager.utilities.parsers;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.DataInputStream;
    import java.io.IOException;
    import java.io.EOFException;
    import java.util.StringTokenizer;
    import java.util.Date;
    import java.util.GregorianCalendar;
    * Title:        HolsteinAssociationClassificationParser
    * Copyright:    Copyright (c) 2001
    * Company:      None
    * @author Harold Smith III
    * @version 1.0
    public class HolsteinAssociationClassificationParser extends ClassificationParser
      private HolsteinAssociationClassificationParser()
      { try
        { parse(new File("demo.ext"));
        catch (Exception e)
       * Doesn't work?!
      public static synchronized ClassificationParser createInstance()
      { return new HolsteinAssociationClassificationParser();
       * <code>parse</code> parses the <a href="www.holstein.com">Holstein
       *  Association</a> classification data as laid out in there <code>File</code>
       *  format. By using this parser, one can read in the records and access the
       *  data that they need.
       * @param File the name of the file to be parsed.
       * @throws WrongFormatException if the file is not properly formated
      private void parse(File fName) throws WrongFormatException, IOException
        try {
          // READ IN FILE
       * Creates an instance of a date for the format specified by the Holstein
       * Association
      private Date createDate(String time)
      { GregorianCalendar c = (GregorianCalendar) GregorianCalendar.getInstance();
        c.set(Integer.parseInt(time.substring(0,4)), Integer.parseInt(time.substring(4,6))-1, Integer.parseInt(time.substring(6,8)));
        return c.getTime();
    }

    ah stupid errors, i figured it out, i accidently created an instance in a class before i decided to change the class to abstract!

  • Load: AcidRainApplet.class can't be instantiated

    The error "load: AcidRainApplet.class can't be instantiated" is coming up on this bit of code, any ideas on being rid of it?
    // The "AcidRainApplet" class.
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.Date;
    import javax.swing.*;
    public class AcidRainApplet extends Applet implements KeyListener, ActionListener
      public AcidRainApplet ()
        super ();
      int width = 600, height = 450;
      int x = width / 2, y = height - 100, w = 27, h = 40;
      int count = 0;
      boolean playing = true, pause = true;
      Font endFont = new Font ("Arial Black", Font.PLAIN, 36);
      Font ptFont = new Font ("Westminster", Font.PLAIN, 28);
      int points = 0;
      int numRain = 80;
      int maxRain = 200;
      int speed = 5;
      ImageIcon imgi = new ImageIcon ("homer.gif");
      Image ch = imgi.getImage ();
      javax.swing.Timer t;
      public void init ()
        setBackground (Color.black);
        t = new javax.swing.Timer (speed, this);
        this.addKeyListener (this);
        for (int i = 0 ; i < maxRain ; i++)
          rain = new Rain ();
    } // init method
    public void paint (Graphics g)
    super.paint (g);
    g.setColor (Color.white);
    g.drawString ("" + numRain, width - 20, 15);
    if (playing)
    g.drawImage (ch, x, y, null);
    g.setColor (Color.green);
    for (int i = 0 ; i < numRain ; i++)
    g.drawLine (rain [i].x, rain [i].y, rain [i].x, rain [i].y - 10);
    if (!(pause))
    rain [i].y += rain [i].sp;
    if (rain [i].y > height)
    rain [i].x = (int) (Math.random () * width);
    rain [i].y = 0;
    rain [i].sp = (int) (Math.random () * 5) + 2;
    points++;
    else if (rain [i].x >= x && rain [i].x <= x + w && rain [i].y >= y && rain [i].y <= y + h)
    playing = false;
    else
    g.drawString ("PRESS ENTER TO PLAY AGAIN", 180, 400);
    g.setFont (endFont);
    g.setColor (Color.red);
    g.drawString ("GAME OVER", 150, 200);
    g.setFont (ptFont);
    g.setColor (Color.green);
    g.drawString ("Score: " + points, 200, 300);
    t.stop ();
    if (pause)
    g.setColor (Color.green);
    g.drawString ("PRESS ENTER", 200, 200);
    } // paint method
    public void resetVars ()
    x = width / 2;
    y = height - 100;
    count = 0;
    playing = true;
    pause = true;
    points = 0;
    maxRain = 200;
    speed = 5;
    for (int i = 0 ; i < maxRain ; i++)
    rain [i] = new Rain ();
    public class Rain extends Applet
    Rain ()
    int x = (int) (Math.random () * width);
    int y = 0;
    int sp = (int) (Math.random () * 5) + 2;
    Rain rain [] = new Rain [maxRain];
    public void actionPerformed (ActionEvent e)
    repaint ();
    public void keyTyped (KeyEvent k)
    public void keyPressed (KeyEvent k)
    int key = k.getKeyCode ();
    if (!(pause))
    if (key == k.VK_LEFT && x > 0)
    x -= 5;
    if (key == k.VK_RIGHT && x + w < width)
    x += 5;
    if (key == k.VK_DOWN && numRain > 10)
    numRain -= 10;
    repaint ();
    if (key == k.VK_UP && numRain != maxRain)
    numRain += 10;
    repaint ();
    if (key == k.VK_ENTER)
    if (pause)
    pause = false;
    t.start ();
    else if (!(playing))
    resetVars ();
    else
    pause = true;
    t.stop ();
    public void keyReleased (KeyEvent k)
    } // AcidRainApplet class

    Irrespective of the working of your program, I would suggest you remove a lot of weeds and clean the code. That would help you do easier debugging .
    Somethings I can quickly tell are,
    the constructor in AcidRainApplet not useful, Rain implementing Applet not useful, implements KeyListener, ActionListener can be delegated to another class, usage of inner class can be rethinked of delegation can be given a thought. Following code can be thought of :
      class Rain
        private  int x = 0;
        private int y = 0;
        private int sp = 0;
        Rain ()
          reset();
        public int getX() {
          return x;
        public int getY() {
          return y;
        public void setX(int x) {
          this.x = x;
        public void setY(int y) {
          this.y = y;
         public void reset() {
          x = (int) (Math.random () * width);
          y = 0;
          sp = (int) (Math.random () * 5) + 2;   
      }Good wishes,
    Rajesh

  • Class can't be instantiated

    Hi guys
    Just having trouble running this applet for some reason, in any browser. Other applets are working at the minute, so it doesn't look like a prob with the browsers or JVM.
    Heres the code, followed by the error message.
    import java.awt.*;
    import java.applet.*;
    import java.awt.event.*;
    public abstract class ColourButtons extends Applet
                                              implements ActionListener, MouseListener
         private Button colorButtons[] = new Button[7];
        private Color color = Color.black;
         int x1, y1, x2, y2 = 1;
        public void init()
              setLayout(new BorderLayout(20,20));
              Panel pWest = new Panel();
              pWest.setLayout(new GridLayout(7,1));
              for(int x =0; x <= 6; x++)
                   colorButtons[x] = new Button("   ");
                   pWest.add(colorButtons[x]);
                   add("West",pWest);
                   //add actionlisteners for each button
                   colorButtons[x].addActionListener(this);
                   if(x == 0){
                        color = Color.red;}
                   else if( x==1){
                        color = Color.blue;}
                   else if(x==2){
                        color = Color.green;}
                   else if(x==3){
                        color = Color.yellow;}
                   else if(x==4){
                        color = Color.orange;}
                   else if(x==5){
                        color = Color.black;}
                   else if(x==6){
                        color = Color.white;}
                   colorButtons[x].setBackground(color);
            setBackground(Color.gray);
        public void paint(Graphics g)
              Graphics2D g2 = (Graphics2D)g;
              g2.setColor(color);
              //create Rectangle Object
              Rectangle myRectangle = new Rectangle(x1,y1,x2,y2);
              g2.draw(myRectangle);
                       g2.drawString("HELLO", 150,100);
        public void actionPerformed(ActionEvent a)
            Button button = (Button)a.getSource();
            color = button.getBackground();
            repaint();
        public void mouseClicked(MouseEvent e)
        public void mouseEntered(MouseEvent e)
        public void mouseExited(MouseEvent e)
        public void mousePressed(MouseEvent e)
              x1 = e.getX();
              y1 = e.getY();
        public void mouseReleased(MouseEvent e)
              x2 = e.getX();
              y2 = e.getY();
    }And heres the error message.
    load: ColourButtons.class can't be instantiated.
    java.lang.InstantiationException
    at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance
    (InstantiationExceptionConstructorAccessorImpl.java:30)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
    at java.lang.Class.newInstance0(Class.java:306)
    at java.lang.Class.newInstance(Class.java:259)
    at sun.applet.AppletPanel.createApplet(AppletPanel.java:566)
    at sun.applet.AppletPanel.runLoader(AppletPanel.java:495)
    at sun.applet.AppletPanel.run(AppletPanel.java:292)
    at java.lang.Thread.run(Thread.java:536)
    Any ideas at what is wrong?
    Any help/pointers greatly appreciated
    Cheers

    ok cheers thats sorted it. For some reason it wanted it to be abstract once i added mouse listener i think.
    Anyway cheers

  • "Class can't be instantiated " error message. Help !

    Dear Java People,
    In trying to do a program that outputs a sound with every button click
    I have no compilation errors but a runtime error that says:
    "class can't be instantiated"
    below is the program and below that the error message
    thank you in advance
    Norman
    import java.util.*;
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.border.*;
    import java.applet.*;
    import java.awt.event.*;
    import java.net.*;
    public abstract class MyMusicApplet_1 extends JApplet implements ActionListener, AppletContext
         //AppletContext myAppletContext =   new AppletContext();
         //Iterator i =   myAppletContext.getStreamKeys();
         JButton myJButton;
         AudioClip acSound_1;
         AudioClip acSound_2;
         AudioClip acSound_3;
         AudioClip acSound_4;
         AudioClip acSound_5;
         AudioClip acSound_6;
         AudioClip acSound_7;
         AudioClip acSound_8;
         AudioClip acSound_9;
         JButton myJButtonSound1;
         JButton myJButtonSound2;
         JButton myJButtonSound3;
         JButton myJButtonSound4;
         JButton myJButtonSound5;
         JButton myJButtonSound6;
         JButton myJButtonSound7;
         JButton myJButtonSound8;
         JButton myJButtonSound9;
      public void init()
            try
             acSound_1 = getAudioClip(new URL ("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk"));
             acSound_2 = getAudioClip(new URL ("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk"));
             acSound_3 = getAudioClip(new URL ("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk"));
             acSound_4 = getAudioClip(new URL ("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk"));
             acSound_5 = getAudioClip(new URL ("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk"));
             acSound_6 = getAudioClip(new URL ("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk"));
             acSound_7 = getAudioClip(new URL ("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk"));
             acSound_8 = getAudioClip(new URL ("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk"));
             acSound_9 = getAudioClip(new URL ("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk"));
             catch (MalformedURLException e)
               System.out.println("Error here " );
           Container myContentPane = getContentPane();
           myContentPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
            Dimension buttonSize = new Dimension(190,100);
           Font myFont = new Font("Arial", Font.BOLD,14);
           Border myEdge = BorderFactory.createRaisedBevelBorder();
                    //create 1st button's object
                     myJButtonSound1 = new JButton("sound #1");
                    myJButtonSound1.addActionListener(this);
                   //set the button's border and size, font background and foreground
                   myJButtonSound1.setBorder(myEdge);
                   myJButtonSound1.setPreferredSize(buttonSize);
                   myJButtonSound1.setFont(myFont);
                   myJButtonSound1.setBackground(Color.orange);
                   myJButtonSound1.setForeground(Color.black);
                    //create 2nd button's object
                     myJButtonSound2 = new JButton("sound #2");
                    myJButtonSound2.addActionListener(this);
                   //set the button's border and size, font, background and foreground
                   myJButtonSound2.setBorder(myEdge);
                   myJButtonSound2.setPreferredSize(buttonSize);
                   myJButtonSound2.setFont(myFont);
                   myJButtonSound2.setBackground(Color.blue);
                   myJButtonSound2.setForeground(Color.black);
                    //create 3rd button's object
                     myJButtonSound3 = new JButton("sound #3");
                    myJButtonSound1.addActionListener(this);
                   //set the button's border and size, font, background and foreground
                   myJButtonSound3.setBorder(myEdge);
                   myJButtonSound3.setPreferredSize(buttonSize);
                   myJButtonSound3.setFont(myFont);
                   myJButtonSound3.setBackground(Color.cyan);
                   myJButtonSound3.setForeground(Color.black);
                    //create 4th button's object
                     myJButtonSound4 = new JButton("sound #4");
                    myJButtonSound4.addActionListener(this);
                   //set the button's border and size, font background and foreground
                   myJButtonSound4.setBorder(myEdge);
                   myJButtonSound4.setPreferredSize(buttonSize);
                   myJButtonSound4.setFont(myFont);
                   myJButtonSound4.setBackground(Color.pink);
                   myJButtonSound4.setForeground(Color.black);
                   //create 5th button's object
                   myJButtonSound5 = new JButton("sound #5");
                  myJButtonSound5.addActionListener(this);
                 //set the button's border and size, font background and foreground
                 myJButtonSound5.setBorder(myEdge);
                 myJButtonSound5.setPreferredSize(buttonSize);
                 myJButtonSound5.setFont(myFont);
                 myJButtonSound5.setBackground(Color.red);
                 myJButtonSound5.setForeground(Color.black);
                  //create 6th button's object
                   myJButtonSound6 = new JButton("sound #6");
                  myJButtonSound6.addActionListener(this);
                 //set the button's border and size, font, background and foreground
                 myJButtonSound6.setBorder(myEdge);
                 myJButtonSound6.setPreferredSize(buttonSize);
                 myJButtonSound6.setFont(myFont);
                 myJButtonSound6.setBackground(Color.pink);
                 myJButtonSound6.setForeground(Color.black);
                  //create 7th button's object
                   myJButtonSound7 = new JButton("Choice #7");
                  myJButtonSound7.addActionListener(this);
                 //set the button's border and size, font, background and foreground
                 myJButtonSound7.setBorder(myEdge);
                 myJButtonSound7.setPreferredSize(buttonSize);
                 myJButtonSound7.setFont(myFont);
                 myJButtonSound7.setBackground(Color.cyan);
                 myJButtonSound7.setForeground(Color.black);
                  //create 8th button's object
                   myJButtonSound8 = new JButton("Choice #8");
                  myJButtonSound8.addActionListener(this);
                 //set the button's border and size, font background and foreground
                 myJButtonSound8.setBorder(myEdge);
                 myJButtonSound8.setPreferredSize(buttonSize);
                 myJButtonSound8.setFont(myFont);
                 myJButtonSound8.setBackground(Color.yellow);
                 myJButtonSound8.setForeground(Color.black);
                  //create 9th button's object
                   myJButtonSound9 = new JButton("Choice #9");
                  myJButtonSound9.addActionListener(this);
                 //set the button's border and size, font background and foreground
                 myJButtonSound9.setBorder(myEdge);
                 myJButtonSound9.setPreferredSize(buttonSize);
                 myJButtonSound9.setFont(myFont);
                 myJButtonSound9.setBackground(Color.blue);
                 myJButtonSound9.setForeground(Color.black);
                   //add the buttons to the content pane
                   myContentPane.add(myJButtonSound1);
                   myContentPane.add(myJButtonSound2);
                   myContentPane.add(myJButtonSound3);
                   myContentPane.add(myJButtonSound4);
                   myContentPane.add(myJButtonSound5);
                   myContentPane.add(myJButtonSound6);
                   myContentPane.add(myJButtonSound7);
                   myContentPane.add(myJButtonSound8);
                   myContentPane.add(myJButtonSound9);
          public void actionPerformed(ActionEvent e)
             myJButton = (JButton)e.getSource();
            if(myJButton == myJButtonSound1)
              acSound_1.play();
            if(myJButton == myJButtonSound2)
              acSound_2.play();
            if(myJButton == myJButtonSound3)
              acSound_3.play();
            if(myJButton == myJButtonSound4)
              acSound_4.play();
            if(myJButton == myJButtonSound5)
              acSound_5.play();
             if(myJButton == myJButtonSound6)
               acSound_6.play();
                       if(myJButton == myJButtonSound7)
                         acSound_7.play();
                       if(myJButton == myJButtonSound8)
                         acSound_8.play();
                        if(myJButton == myJButtonSound9)
                          acSound_9.play();
    java.lang.InstantiationException
         at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:30)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
    load: stan_my_music_applet_1.MyMusicApplet_1.class can't be instantiated.
         at java.lang.Class.newInstance0(Class.java:306)
         at java.lang.Class.newInstance(Class.java:259)
         at sun.applet.AppletPanel.createApplet(AppletPanel.java:566)
         at sun.applet.AppletPanel.runLoader(AppletPanel.java:495)
         at sun.applet.AppletPanel.run(AppletPanel.java:292)
         at java.lang.Thread.run(Thread.java:536)

    I also tried:
    try
    for(int a=0;a<8;a++)
    {acSounds[a] = getAudioClip(getCodeBase(),(new URL ("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore" + (i + 1) + ".wrk")));
    and the error message still says:
    "MyMusicApplet3.java": Error #: 300 : method getAudioClip(java.net.URL, java.net.URL) not found in class stan_my_music_applet_3.MyMusicApplet3 at line 19
    Help !
    below is the revised code
    Norman
    import java.util.*;
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.border.*;
    import java.applet.*;
    import java.awt.event.*;
    import java.net.*;
    public class MyMusicApplet3 extends JApplet implements ActionListener
      AudioClip[] acSounds= new AudioClip[9];
      public void init()
       try
            for(int a=0;a<8;a++)
            {acSounds[a] = getAudioClip(getCodeBase(),(new URL ("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore" + (a + 1) + ".wrk")));
      catch (Exception e)
        System.out.println("Error here " );
            Container myContentPane = getContentPane();
            myContentPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
            myContentPane.add(getButton("1", Color.orange));
            myContentPane.add(getButton("2", Color.blue));
            myContentPane.add(getButton("3", Color.cyan));
            myContentPane.add(getButton("4", Color.pink));
            myContentPane.add(getButton("5", Color.red));
            myContentPane.add(getButton("6", Color.pink));
            myContentPane.add(getButton("7", Color.cyan));
            myContentPane.add(getButton("8", Color.yellow));
            myContentPane.add(getButton("9", Color.blue));
        public void actionPerformed(ActionEvent e)
           String command = e.getActionCommand();
           int index = Integer.parseInt(command)-1;
           acSounds[index].play();
       public JButton getButton(String label, Color fore)
         {          JButton button = new JButton("sound "+label);
                    button.setPreferredSize(new Dimension(190,100));
                    button.setFont(new Font("Arial", Font.BOLD,14));
                    button.setBorder(BorderFactory.createRaisedBevelBorder());
                    button.setForeground(fore);
                    button.setBackground(Color.orange);
                    button.addActionListener(this);
                    button.setActionCommand(label);
                    return button;
          }//"MyMusicApplet3.java": Error #: 300 :
    //method getAudioClip(java.net.URL, java.net.URL) not found in class
    // stan_my_music_applet_3.MyMusicApplet3 at line 19, column 24

  • Weird classpath issue in EAR.Some classes can access jars that others cant!

    Hi,
    I'm experiencing a very frustrating problem that's proving to be a bit of a show stopper for me. I would really appreciate some help...
    I have an EAR deployed successfully on Sun Appserver 8 which passes the tests from the sun EAR verifier tool. The ear contains a jar file that I built which has a stateless session bean, home, remote interfaces and rmi stubs, deployment descriptors, as well as some utility classes. The EAR also contains some third-party jars such as Hibernate, Log4-j, apache-commons etc etc. The jar I built has in it's manifest file, the classpath information to reference the other jars in the ear.
    The problem I am having is that one of the classes in a third-party jar (hibernate3.jar) cannot see a class in another of the third party jars (log4j-1.2.8.jar) and as a result is throwing a NoClassDefFoundError for org/apache/log4j/Layout while trying to initialise - the two jars are at the root of the EAR.
    Furthermore, my utility classes can access and use Log4j classes without any problem and logging command from those classes is output successfully to the server console. However, my session bean, which is packaged in the same jar as the utility classes, fails to log anything even though it uses exactly the same logger and log configuration as the utility classses.
    I have tried adding classpath information to the manifest of the EAR so that the third-party jars can pick it up but this makes no difference. Also, according to the EAR verifier tool, you are not allowed to put any classpath information in the EAR manifest.
    I have also tried deploying this in weblogic but am experiencing the same problem.
    If anyone can offer any advice or solutions I would greatly appreciate it.
    :)

    what´s type error have you?
    perhaps external libraries (located in classpath) invoke opsCommon.jar and config-3.0.jar classes. then, classnotfound is normal.
    and... why separate external libraries (opsCommon.jar and config-3.0.jar inside ear, and other in classpath)?

  • Nobody can override a mark in account for edge qualification?

    I've been an excellent Verizon customer, always made my payments on time and was diligent in doing so in order to establish a good relationship with Verizon.  I have a two year contract ending on Dec 21, 2014, and was wanting to go on the edge program.  Two months ago I had a payment due which I paid online like I always do.  A day later I received an email from Verizon saying there was an issue with my payment.  I went online quickly and noticed that my balance was not showing zero as it should.  I went ahead and went through the whole payment process again because perhaps I typed my account number incorrectly.  This payment took.  I didn't think anything of it....the payment was taken out of my account before the grace period...so it was not late (whew!).  Another bill due a month ago, made my payment online again, careful this time, and no issues. 
    I started to check online about the edge program, playing around with the phones, prices, plans, etc.  Convinced of what my choice would be, I called customer service and was very surprised to find out that at the end of my contract on Dec 21, 2014, the edge program was no longer an option for me since I now have a "mark" of a payment return in my account.  I quickly deduced this to what happened a couple of months ago when I incorrectly typed in my account number in the process of making a payment online....even though I caught it early enough before it would be deemed a late payment.  I called several times, talked to several customer service representative, each time got a different answer for the reason why I'm no longer eligible for the edge program.  I even called two local stores in the area.  Here are a few answers I got:
    "When it's time for your contract to end, we can call somebody to remove that mark in your account and eligibility in the edge program won't be an issue"
    "There's a mark in your account and you are no longer eligible for the edge program"
    "You've reached the retention department, and and I talked to our financial department, and there's nothing they can do about the mark."
    "Not even the president of Verizon can remove that mark in your account."
    "Verizon will review your account 6 months from the time when the "mark" appeared in your account for eligibility."
    So...as you can see, even though this error in the process of making a payment was caught and corrected, and a payment made BEFORE it being considered late....that "mark" in my count remains and NOBODY in the entire Verizon department can or is willing to review this incident.  So I ask everyone.....why should my choices be limited when the "mark" that happened was corrected on time and Verizon still got their payment on time....?
    Solution....I will be going to AT&T on their Next program....similar to Verizon's Edge program. 
    I know I'm only one person, and my business won't put a dent in Verizon's profit....I just thought I was establishing a relationship with Verizon by religiously paying on time.....so much for that!  And I know that the representatives who say "we value your business...you are important to us"...is nothing more than scripted verbiage and has no depth to it.
    I'm hurt, I feel unimportant in Verizon's "family"....thank God they are not the only game in town.  No amount of "We are the largest network" ads and statement is of value when you lose sight of the personal treatment of the individual.

    I can understand that things happen. With computers it is even worse. Computers are unforgiving where as human interaction can overlook such problems.
    Technically even though you admit it, your payment via a wrong account number was in fact returned. Makes no difference to the computer gods if you paid it with a valid card minutes later. The computer god is angry with you so it is unbending in its judgment.
    This is the same in any large company.
    As you said just switch services and don't anger the computer god at your new carrier.
    Good Luck

  • Can I rotate mark ups created with Adobe X on the background page of a PDF document?

    Can I rotate mark ups created with Adobe X on the background page of a PDF document?

    Thank you for taking the time to reply.
    I tried both ways and neither works.  It gives me a prompt box that I have to click "next" for every page but after going thru all pages, nothing is sent to the printer.
    Also, all directions I've read indicate it will print to the default printer.  If my default printer is on a network, will that cause problems....
    and...
    should I be getting a prompt box on every page?  I thought all this would happen behind the scenes and not force me to interact with every page.
    dc

  • Applet in ie 5.0: class can not be Instantiated

    Hi!
    My problem is an Applet, which works fine with the appletviewer and with my iExplorer 5.0.
    But when I tried to install my Application (the Applet is part of a J2EE-WebApp) on the tomcat of an other computer, I get the
    "class can not be instantiated"-Error and iE 5.0 only displays a grey box in the size of the Applet. With the appletviewer it works.
    I got the same tomcat, same mySQL and same browser on both computers.
    I also invoked the application running in tomcat on my computer from 2 other computers - on one of them, the Applet was shown, on the other, I only got this grey box.
    The version of the iExplorer was exactly the same.
    What can be wrong?

    Are you sure there is a static method in the Applet class named newAudioChip that takes a URL as an argument?

  • How can a question marked as "solved" be restored to unsolved status?

    How do you remove the “This solved my question” status icon if the answer turns out to be wrong?
    Variations of this question can be found in a few discussion threads in the Apple Support Community. I found one very similar question marked as “This solved my question.” Unfortunately the answer was, “It can't be changed.” I have reasons for trying to, at least, get a more definitive answer.
    A primary purpose of these discussions is to resolve issues. It is very frustrating to read through long threads that claim to have an answer, only to find that the question was mistakenly marked “solved.” I spent over an hour on a thread that was marked as resolved. The member that made the mistake wanted to remove the “solved” status--even asked for help several times. I finished the thread just in case either issue was resolved. No, neither issue was resolved.
    May someone, Apple if necessary, explain how to revert the “solved” status or help fix the problem? If it is a known issue with no workaround, it would be very helpful to have an explanation. Accordingly, are there plans to fix this problem, and a rough idea when? This could be a “This solved my question” hallmark worth celebrating!
    Caution: This discussion or parts of it may be revised or deleted while I attempt to find a solution or workaround. Once I've given up or the issue is resolved, I will indicate so, even if it requires a repost. Relevant contributions will be indicated either way.

    leonieDF and  seventy one pointed out, (paraphrasing) all posts can be helpful in some way, even if the original owner of the discussion didn't get their question resolved.
    Maybe if I keep using this tool I'll change my mind, but most of the time I'd rather save time getting something solved than not.
    If anyone believes there are legitimate reasons owners and participants of a discussion would benefit from the ability of the owner to reset the solved status, you're welcome to chime in.
    These excerpts from my original post express why I think a change is needed:
    Stiltskin!: “The member that made the mistake wanted to remove the “solved” status--even asked for help several times. I finished the thread just in case either issue was resolved. No, neither issue was resolved.”
    Stiltskin!: “I didn't find any entry in that thread with an answer to revert the icon. So I got the idea it wasn't common knowledge because so many posters asked the owner to fix it even though the owner kept asking how to do it.”
    A big part of why I started this discussion is because I noticed others (and myself) expressed interest in this feature (owner ability to reset a discussion's solved status). If anyone want's to respond to that, please do.
    Nobody's brought it up but my discussion's header question doesn't express what I'm talking about now. I would change it if I could. I'd encourage future contributors (if any) to read through the explanation of my question in the first post to understand my perspective beyond "How can a question marked as 'solved' be restored to unsolved status?"
    Thank you all for your input!

  • Why method local inner class can use final variable rather than....

    Hi all
    Just a quick question.
    Why method-local inner class can access final variable defined in method only?
    I know the reason why it can not access instance variable in method.
    Just can not figure out why??
    any reply would be appreciated.
    Steven

    Local classes can most definitely reference instance variables. The reason they cannot reference non final local variables is because the local class instance can remain in memory after the method returns. When the method returns the local variables go out of scope, so a copy of them is needed. If the variables weren't final then the copy of the variable in the method could change, while the copy in the local class didn't, so they'd be out of synch.

Maybe you are looking for

  • JDeveloper-Questions

    Hello,iam new in JDeveloper(10.1.3) and iam facing some problems during the transition of an application to the web.I will be graceful if somebody could help me. My questions are: 1)How can i display my error or information messages (that i have stor

  • Email Receiver: how to get the names of stored attachments?

    Hi, I hate to spam this forum. But I'm in desperate need of the names of attachments, the email receiver QPAC receives. If I select a list variable for the email receiver to store all attachments received into, all filenames appear to be lost. Also t

  • "moving" folder on BP forms

    Hello, I have added a user folder to the BP form behind all system forms. I want it to keep to the same position whatever the form mode. You can notice that according to the form mode, the number of system folders changes: In Find mode for instance,

  • Approach of using Bulk Collect

    Hi Experts, how to use bulk collect for uncertain number of columns of select statement. Master table structure: Create table tabmst (id number, cls_input varchar2(2000), price number); insert into tabmst(1,'select product, price from product',500);

  • Getting Kicked off Lan.

         I have a network with 2 desktop PCs running win7 a Macbook Pro running osx 10.7.5 and an IMac running osx 10.6.8 One of the PCs is the server and has a few HDs with a few TB stored. The other 3 computers work and edit files one a specific HD in