Who can help a newbie solve THIS one???

Ok,
I have made a class that looks like this...
class holder{
JRadioButton button = new JRadioButton();
int x =0;
int y =0;
I have now made 3 objects of class holder and placed each RadioButton from the 3 objects onto the applet screen. I have also added itemlisteners for each button.
This is my problem. When a holder object is clicked, I want to do two things. I want to change the icon AND be able to change the x and/or y variable.
I can get the source of the object by doing something like this....
AbstractButton source = (AbstractButton) itm.getSource() ;
but when I try something like this
Holder source = (Holder) itm.getSource
and then click on the button in the applet I get a ClassCastException error.
Any ideas?

class holder{
JRadioButton button = new JRadioButton();
int x =0;
int y =0;
your holder HAS a JRadioButton but not IS a JRadioButton
so you cannot do the casting like that
define like
class holder extends JRadioButton
and you can cast holder to JRadioButton
i thought u want to do sth like
class holder extends JRadioButton{ int x; int y;}
class test extends Applet {
     private holder ;
     public void init() {
     h =0 new holder();
     holder.addActionListener(new holderHandler(this)); // pass in applet
     add(holder);
     class holderHandler implements ActionListener{
          Applet applet;
          public holderHandler(Applet a) {applet =a ;}
          public void actionPerformed(ActionEvent e)
          {  changing x,y event here}
}

Similar Messages

  • Who can help me to submit this bug to the adobe indesign development team?

    I developed a indesing plug-in, and its function is to increase the two kinds of footnotes style,
    When the user selects this type of footnote style, and insert some footnote to the document
    The user then export the document to pdf。
    there is no  problem in indesign CS3 and indesign CS4.
    but in indesign CS5 and CS5.5,
    export pdf, there will be two kinds of format:
    Adobe PDF(Interaction)
    Adobe PDF(Print)
    If the user chooses to export a pdf(Interaction),there is no problem,
    but if user choose to export to pdf(print),
    All of the footnote is replaced by an ordinary Arabic numerals 1,2,3,4,......
    I think there is a bug in exported the pdf function in cs5 and cs5.5,
    so ,who can help me to submit this bug to the adobe indesign development team? thanks.
    Through the link below to download a trial version of this plugin for indesign cs5
    http://www.cppblog.com/Files/lyj2871/1380_CS5.rar

    who can help me?

  • My login option turned to disabled ,according  to the tips ,i've changed my passwords many times, but i still can't login my itunes store ,who can help me to solve the problem?

    My login option turned to disabled ,according  to the tips ,i've changed my passwords many times, but i still can't login my itunes store ,who can help me to solve the problem?

    Try here >  Can't connect to the iTunes Store
    Try disabling anti virus software and turning off the Firewall.

  • Is there anyone who can help me out in this!!!!

    Trying this for the fourth time........
    Hi gurus,
    I have posted this thread earlier also but didnt get any response, so I was just wondering did I ask something unrealistic?
    Hi gurus,
    I am working on an interface where I will be getting the production order number and then based on this order number I need to update some fields in transaction code ... CO11N...such as Quantity produced, reason of variance, batch number and posting date. So what I believe is first I need to pass the order number to the BAPI_PRODORD_GET_DETAIL to get the details of the production order and then update the production order by using the BAPI_PRODORDCONF_CREATE_TT, but my problem is I am new to ABAP I got to know what should be the process but I am not being able to implement it. So basically the program needs to pick the data from the internal table and copy it in SAP. My internal table looks liks
    data : BEGIN OF it_input occurs 0,
    order_no like afko-aufnr, "Order Number
    opr_no like afru-vornr,
    quant like afru-lmnga,
    varian like afru-grund,
    budat(10) type c,
    matnr like caufvd-matnr, "Materials
    erfmg like cowb_comp-/cwm/erfmg,
    charg like mcha-charg,
    END OF it_input.
    So can you please help me out in this..I mean step by step or if there is any other suitable way.
    Thanks,
    Rajeev .......

    Rajeev,
    Based on your post, just may not be clear what you are asking for then.
    I think your general approach that you have described is correct.  Without knowing the source of your data for the internal table, it is hard to completely provide an answer but a typical interface might look something like this:
    1.  Selection screen with parameters for the file name (If a file is the source of your data)
    2.  Load data from the file into your internal table.
    3.  Loop at your data
    4.  Call the Get Detail BAPI
    5.  Using the data returned from the get detail BAPI and your internal table create the importing, exporting, tables parameter for your Create BAPI.
    This step might need some more clarification.  I am not sure if you are using the right BAPI for what you are trying to accomplish.  First this appears to be a Create function and not a change, second, it appears that this is for Time Ticket information against a production order.  I haven't used any BAPIs for production orders before so I can't give you a definite answer.  If you cannot find an appropriate BAPI, you might also try creating a BDC/Call transaction update.
    6.  Review the error messages/return code from your production order change
    7.  Output some type of report to the user regarding successful updates, errors, etc.
    I hope this helps provide some guidance.
    Best Regards,
    Chris H.

  • Please if anyone can help me in solving this issu...

    I am in America using nokia n73(unlocked) with T-mobile
    the problem i am having is every time I restart my phone or Lock my phone I get the Voice mail Indicator saying that i have a voice mail and i tryed taking the sim card out and putting it in another phone and leaving a voice mail and deleting it then i tryed to put the sim back into the n73 but still haveing the same problem everytime I restart it does that, shows an Voice mail indication please if anyone can help me pls do thanks.
    will wait for a reply

    Update the phones software it should get rid of that symbol if it's too anoying.
    www.nokia.co.uk/softwareupdate
    Nokia N95
    V 20.0.015
    0546553

  • I can't right of left click in Pages. I upgraded to Lion and now I can't do none , who can I fix or solve this?

    Thave undate to Lion , now I can't right or left click to correct spelling errors or make Pages learn the error and its correction for the future, please help.
    Thanks

    System Preferences / Mouse / Point & Click /
    Tick Box and use the drop down menu to choose the primary and secondary mouse buttons.

  • Who can help me? write this code?

    Write java code print prime number like this
    Sample Screen Print:
    Initial matrix with N = 37
    2 3 4 5 6 7 8 9 10
    11 12 13 14 15 16 17 18 19 20
    21 22 23 24 25 26 27 28 29 30
    31 32 33 34 35 36 37
    Intermediate results (after 1st iteration)
    2 3 5 7 9
    11 13 15 17 19
    21 23 25 27 29
    31 33 35 37
    Intermediate results (after 2nd iteration)
    2 3 5 7
    11 13 17 19
    23 25 29
    31 35 37
    Intermediate results (after 7th iteration)
    2 3 5 7
    11 13 17 19
    23 29
    31 37
    Final results
    2 3 5 7 11 13 17 19 23 29
    31 37
    How to write this code ?
    Please Help me!
    Thank you so muchhh ?????

    Looks like The Sieve of Eratosthenes.
    A google search for that should help you with some logic.
    Wikipedia has a really nice animation of how it works.
    Post back when you have some source code that you need help with.
    Thanks k???? lullzz???

  • In my dock there was this weird program called "tutorial". While throwing away this program I had to fill in my password. Afterwards I tried to change my password, but my old password doesn't work anymore. Who can help?

    In my dock there was this weird program called "tutorial". While throwing away this program I had to fill in my password. Afterwards I tried to change my password, but my old password doesn't work anymore. Who can help?

    What was this program for, or did you just assume it's something you shouldn't have and therefore arbitrarily decide to "throw it away"? Exactly how did you supposedly throw it away?
    If you didn't change your administrator password, there's no reason it shouldn't work now, so that suggests you did something else, or changed it and then forgot what it was.
    You can't recover that password; you can only change it. To do that, you would need to boot from your Snow Leopard DVD, choose your language, then choose Reset Password from the Utilities menu in the top menu bar.

  • Who can help me :)--a problem with java program(reset problem in java )

    I do not know how to make the button reset,my program only could reset diagram but button.If any one who could help me to solve this problem.The problem is When the reset button is pressed, the image should immediately revert to the black square, and the 4 widgets listed above should show values that
    correspond to the black square.The code like this,first one is shapes:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class shapes extends JFrame {
         private JPanel buttonPanel; // panel for buttons
         private DrawPanel myPanel;  // panel for shapes
         private JButton resetButton;
        private JComboBox colorComboBox;
         private JRadioButton circleButton, squareButton;
         private ButtonGroup radioGroup;
         private JCheckBox filledButton;
        private JSlider sizeSlider;
         private boolean isShow;
         private int shape;
         private boolean isFill=true;
        private String colorNames[] = {"black", "blue", "cyan", "darkGray", "gray",
                                   "green", "lightgray", "magenta", "orange",
                                   "pink", "red", "white", "yellow"};   // color names list in ComboBox
        private Color colors[] = {Color.black, Color.blue, Color.cyan, Color.darkGray,
                              Color.gray, Color.green, Color.lightGray, Color.magenta,
                              Color.orange, Color.pink, Color.red, Color.white, Color.yellow};
         public shapes() {
             super("Draw Shapes");
             // creat custom drawing panel
            myPanel = new DrawPanel(); // instantiate a DrawPanel object
            myPanel.setBackground(Color.white);
             // set up resetButton
            // register an event handler for resetButton's ActionEvent
            resetButton = new JButton ("reset");
             resetButton.addActionListener(
              // anonymous inner class to handle resetButton events
                 new ActionListener() {
                       // draw a black filled square shape after clicking resetButton
                     public void actionPerformed (ActionEvent event) {
                             // call DrawPanel method setShowStatus and pass an parameter
                          // to decide if show the shape
                         myPanel.setShowStatus(true);
                             isShow = myPanel.getShowStatus();
                             shape = DrawPanel.SQUARE;
                         // call DrawPanel method setShape to indicate shape to draw
                             myPanel.setShape(shape);
                         // call DrawPanel method setFill to indicate to draw a filled shape
                             myPanel.setFill(true);
                         // call DrawPanel method draw
                             myPanel.draw();
                             myPanel.setFill(true);
                             myPanel.setForeground(Color.black);
                   }// end anonymous inner class
             );// end call to addActionListener
            // set up colorComboBox
            // register event handlers for colorComboBox's ItemEvent
            colorComboBox = new JComboBox(colorNames);
            colorComboBox.setMaximumRowCount(5);
            colorComboBox.addItemListener(
                 // anonymous inner class to handle colorComboBox events
                 new ItemListener() {
                     // select shape's color
                     public void itemStateChanged(ItemEvent event) {
                         if(event.getStateChange() == ItemEvent.SELECTED)
                             // call DrawPanel method setForeground
                             // and pass an element value of colors array
                             myPanel.setForeground(colors[colorComboBox.getSelectedIndex()]);
                        myPanel.draw();
                }// end anonymous inner class
            ); // end call to addItemListener
            // set up a pair of RadioButtons
            // register an event handler for RadioButtons' ItemEvent
             squareButton = new JRadioButton ("Square", true);
             circleButton = new JRadioButton ("Circle", false);
             radioGroup = new ButtonGroup();
             radioGroup.add(squareButton);
             radioGroup.add(circleButton);
            squareButton.addItemListener(
                // anonymous inner class to handle squareButton events
                new ItemListener() {
                       public void itemStateChanged (ItemEvent event) {
                           if (isShow==true) {
                                 shape = DrawPanel.SQUARE;
                                 myPanel.setShape(shape);
                                 myPanel.draw();
                   }// end anonymous inner class
             );// end call to addItemListener
             circleButton.addItemListener(
                   // anonymous inner class to handle circleButton events
                new ItemListener() {
                       public void itemStateChanged (ItemEvent event) {
                             if (isShow==true) {
                                 shape = DrawPanel.CIRCLE;
                                 myPanel.setShape(shape);
                                 myPanel.draw();
                             else
                                 System.out.println("Please click Reset button first");
                   }// end anonymous inner class
             );// end call to addItemListener
             // set up filledButton
            // register an event handler for filledButton's ItemEvent
            filledButton = new JCheckBox("Filled", true);
             filledButton.addItemListener(
              // anonymous inner class to handle filledButton events
            new ItemListener() {
                  public void itemStateChanged (ItemEvent event) {
                    if (isShow==true) {
                            if (event.getStateChange() == ItemEvent.SELECTED) {
                                  isFill=true;
                                  myPanel.setFill(isFill);
                                  myPanel.draw();
                            else {
                                isFill=false;
                                  myPanel.setFill(isFill);
                                  myPanel.draw();
                    else
                        System.out.println("Please click Reset button first");
              }// end anonymous inner class
             );// end call to addItemListener
            // set up sizeSlider
            // register an event handler for sizeSlider's ChangeEvent
            sizeSlider = new JSlider(SwingConstants.HORIZONTAL, 0, 300, 100);
            sizeSlider.setMajorTickSpacing(10);
            sizeSlider.setPaintTicks(true);
            sizeSlider.addChangeListener(
                 // anonymous inner class to handle sizeSlider events
                 new ChangeListener() {
                      public void stateChanged(ChangeEvent event) {
                          myPanel.setShapeSize(sizeSlider.getValue());
                             myPanel.draw();
                 }// end anonymous inner class
             );// end call to addChangeListener
            // set up panel containing buttons
             buttonPanel = new JPanel();
            buttonPanel.setLayout(new GridLayout(4, 1, 0, 50));
             buttonPanel.add(resetButton);
             buttonPanel.add(filledButton);
            buttonPanel.add(colorComboBox);
            JPanel radioButtonPanel = new JPanel();
            radioButtonPanel.setLayout(new GridLayout(2, 1, 0, 20));
            radioButtonPanel.add(squareButton);
            radioButtonPanel.add(circleButton);
            buttonPanel.add(radioButtonPanel);
            // attach button panel & draw panel to content panel
            Container container = getContentPane();
            container.setLayout(new BorderLayout(10,10));
            container.add(myPanel, BorderLayout.CENTER);
             container.add(buttonPanel, BorderLayout.EAST);
            container.add(sizeSlider, BorderLayout.SOUTH);
            setSize(500, 400);
             setVisible(true);
         public static void main(String args[]) {
             shapes application = new shapes();
             application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }second one is drawpanel:
    import java.awt.*;
    import javax.swing.*;
    public class DrawPanel extends JPanel {
         public final static int CIRCLE = 1, SQUARE = 2;
         private int shape;
         private boolean fill;
         private boolean showStatus;
        private int shapeSize = 100;
        private Color foreground;
         // draw a specified shape
        public void paintComponent (Graphics g){
              super.paintComponent(g);
              // find center
            int x=(getSize().width-shapeSize)/2;
              int y=(getSize().height-shapeSize)/2;
              if (shape == CIRCLE) {
                 if (fill == true){
                     g.setColor(foreground);
                      g.fillOval(x, y, shapeSize, shapeSize);
                else{
                       g.setColor(foreground);
                    g.drawOval(x, y, shapeSize, shapeSize);
              else if (shape == SQUARE){
                 if (fill == true){
                     g.setColor(foreground);
                        g.fillRect(x, y, shapeSize, shapeSize);
                else{
                        g.setColor(foreground);
                    g.drawRect(x, y, shapeSize, shapeSize);
        // set showStatus value
        public void setShowStatus (boolean s) {
              showStatus = s;
         // return showstatus value
        public boolean getShowStatus () {
              return showStatus;
         // set fill value
        public void setFill(boolean isFill) {
              fill = isFill;
         // set shape value
        public void setShape(int shapeToDraw) {
              shape = shapeToDraw;
        // set shapeSize value
        public void setShapeSize(int newShapeSize) {
              shapeSize = newShapeSize;
        // set foreground value
        public void setForeground(Color newColor) {
              foreground = newColor;
         // repaint DrawPanel
        public void draw (){
              if(showStatus == true)
              repaint();
    }If any kind people who can help me.
    many thanks to you!

    4 widgets???
    maybe this is what you mean.
    add this inside your actionPerformed method for the reset action
    squareButton.setSelected(true);
    colorComboBox.setSelectedIndex(0);
    if not be more clear in your post.

  • Regarding the wireless problem of my T60. Hope there is someone who can help me out. Thx.

    I have read some of the posts and i found out that some of the Thinkpad users have the problem of unable to connect wireless network using Access Connection but not Window wireless network connection. For my case, i have connect the network with both of them. In fact, when i use either one to connect, the other would be connected too.
    The problem is, sometimes when i use my wireless network, my wireless would be switched off automatically, and the wireless light is then off, and after that i cannot switched the wireless on again. I tried on it using access connection, failed. I tried Fn+F5 to on it, but no matter how many times i click on 'on', there would not be any response. The only thing i can do after this is to restart to laptop.
    I called Lenovo Support to help me solve the problem, but still failed. The first time they asked me to installed some drivers and reinstall my Intel(R) Pro/Wireless 3945ABG Network Connection. These files included 79uj29us which is a bios update, 7kwc50ww which is the wireless driver installation, 7tvu12ww which is the hotkey driver update, and last 7tku03ww, a power management driver update. But the problem remains. The 2nd time i called, they asked me to uninstall my Access Connection and use window wireless connection as they may cause conflict to each other, and they asked me to uncheck the option of 'Allow this computer to turn off this device to save power' in the power management of wireless drive in device manager, but problem persists. The last time i called the technician and he said they only can check if it is a hardware problem and there most probably be nothing else they can do for my softwares and drivers, and he also believed that it might be the network configuration of my service provider that cause the problem, but i personally do not think so as it is quite hard to believe that the my service is switching off my wireless hardware and i have other laptop in my house too but they do not experience this problem.
    Last night i discovered something new, when the wireless is off automatically again, i ran a test on the the wireless device using PC Doctor, for PCI express status test, it passed, for the wireless connectivity and signal strength test, results showed there was 'no connection', when it comes to network link test, it showed 'internal error', the TCP/IP network connection test showed failed. Then i restarted it and ran the test with the wireless switched off by my self, the PCI express status test passed too, but the remaining four test all showed 'no connection'.
    I really hope if there is someone there to help me out to solve the problem or to enlighten me what the real problem is, could it be software or hardware problem, or could it be other problems like registry or what? I greatly appreciate if anyone can help me to solve this. Thanks alot.
    Message Edited by cat_felix on 06-13-2008 09:54 PM
    Message Edited by cat_felix on 06-13-2008 09:55 PM
    Message Edited by cat_felix on 06-14-2008 04:15 AM

    I have uninstalled my Access Connection, but this problem seems to persist. IBM technician have changed the wireless card of my T60, the first few days after it was changed was very fine, no problem at all. About a week later, the problem occured again, and it happened quite frequently after that occurence. Now i really have no idea what is the cause and how to solve it. Will be greatful if there is anyone that can help me.

  • I need driver bluetooth for win 7 64bit who can help me ?

    I need driver bluetooth for win 7 64bit who can help me ?

    Does this solve your problem?
    http://windowsforum.com/threads/make-your-bluetooth-devices-work-on-windows-7.24 580/

  • Dates in email all the same when older than 2 days. I saw similare questions but no solutions , who can help me ?

    All dates in my emails (on all my 4 apple computers) are on May 5 , when older than 2 days. Is there anyone who can help me out of this very annoying problem please?
    I saw simmilar questions from people in 2008  but no answers.
    Thanks in advance.

    solved

  • Hi I have a Iphone4 in using. I couldn't find Safary, E-mail and notes from my phone one day. I made this mistake when I want to delete some programe from my phone. Who can help I recovery my phone please.

    Hi
    I have a Iphone4 in using. I couldn't find Safary, E-mail and notes from my phone one day. I made this mistake when I want to delete some programe from my phone. Who can help I recovery my phone please.
    Thanks

    Hello, HenryWang2103.
    Thank you for visiting Apple Support Communities.
    The Safari, Email and Notes applications are native to the iOS and is unable to be deleted.  Since this is the case, they are either in a folder on the iPhone, on another page or Restrictions are enabled.  You can also search for these Apps on the iPhone by touching the screen and sliding your finger down.  Here is some information regarding these features.  The information about folders is located in the user guide below.
    iPhone User Guide
    iOS: Understanding Restrictions (Parental Controls)
    http://support.apple.com/kb/HT4213
    Cheers,
    Jason H.

  • Error Message:"Cannot find or create the font 'WP-MathA'. Some characters may not display or print correctly."  Who can help me solve this problem?

    Some of the pdf files I work with (receive) come up with a comment: “Cannot find or create the font ‘WP-MathA’. Some characters may not display or print correctly.”  Who can help me solve this problem?
    Thank you in advance for  your time.
    Marlen

    Hello Anubha,
    I am having a similar problem on my machine.  I was using Word 2008 and I created a PDF inside Word.
    I am opening the file on the system itself and I am running Windows 8.1.  I am using Version 11 of Reader.
    When the PDF I created (my resume) attempts to open, it says:  cannot find or create the file Times, Bold.  Some characters may not display or print correctly. 
    However, the entire Reader keeps freezing and will not allow me to open or test print the document.  Also, it is not displaying any of the Bold Times New Roman Print.  Can you please help?  Thanks.

  • Since Ios 7 Update of my iPhone 5 I can not log into any WLAN any more - who can help to solve this major problem

    Hi all,
    I updated my iPhone 5 recently to IOS 7 - Since then I do not get any access to my home WLAN / WIFI with the iphone 5.
    At same time the iphone 3S and IPAD 1 of my wife (both IOS 5.x) still work fine in our homes WLAN / WIFI.
    Who can help to get my Iphone 5 with IOS 7 back to work in the home WIFI ?
    Thanks in advance for any possible solution.
    Best regards
    Dirk from Hamburg Germany

    Try this first.
    On the iPhone go to Settings > General > Reset and select Reset Network Settings.
    This will erase all saved wi-fi networks and settings.
    If no change after this, try resetting your modem and wireless router. Disconnect the router from the power source followed by disconnecting the modem from the power source. Wait a few minutes followed by powering your modem back on allowing it to completely reset before powering your wireless router back on allowing it to completely reset with the modem.

Maybe you are looking for

  • Cannot open display error MATE

    I installed MATE alongside XFCE but when I try to open MATE after I login at boot it just comes up with the error Cannot open display and it then exits? I used the command: exec mate-session to try and start MATE. Thanks Al. PS I've you need any more

  • [b]MiniSap and the ABAP OBJECTS book [/b]

    Hello, I have purchased the book "ABAP Objects" by Keller and Kruger.  I attempted to install Minisap and ran into a lot of problems. I suspect that I need the most recent version of this product that runs on Windows XP. Can anyone direct me to place

  • Creating CUBE through OLAP DML

    Hi We have a relational database in which we had build cubes . Now we want to convert this into multi dimensional database format . Is it possible to make cubes through OLAP dml and are these cubes accessible via OLAP access packs . Amar

  • Looking help for developing labview code [Urgent]

    Hi, I need help in developing labview code. I am new to labview and will appreciate if someone can help me in this matter. I need to control the intensity of AC load (halogen lamp with 2kW,230V,50Hz) using Labview and Arduino. But my project using in

  • Concurrency bug in SSLEngine?

    We are using the Java 1.5 SSLEngine to perform some non-blocking SSL network comms, and are seeing a Java-level deadlock occurring that doesn't seem to be covered in the "concurrency notes" in the javadocs for SSLEngine. Our software has multiple thr