Help with buttons and graphics

ok all I get on this is about a hundred runtime errors starting with NullPointerException.
public class Ers2View extends FrameView{
Image image;
static Paint paint;
public Ers2View(SingleFrameApplication app) {
super(app);
initComponents();
slapButton = new javax.swing.JButton();
slapButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
slapButtonActionPerformed(evt);
private void slapButtonActionPerformed (java.awt.event.ActionEvent evt) {                                          
     Graphics g= image.getGraphics();
     Paint rect=new Paint();
     Paint.paint(g);
(new file)
package ers2;
import java.awt.Graphics;
public class Paint{
public static void paint(Graphics g) {
     g.drawRect (10, 10, 200, 200);
ok guys comon I really need help on this one. Im using netbeans btw.

AndrewThompson64 wrote:
>
No i know where the problem is but i have no idea how to fix it. I think part of the problem is that I never tell it to draw on the JPanel. But Netbeans makes weird code so im not sure how to make the drawRect command implemented on the panel.>
- People about these parts comment on Java problems, not Netbeans problems. Netbeans has its own [forums for Netbeans problems|http://forums.netbeans.org/] (<- link), try them.
- As far as the Java code goes, you will get a much better chance of help if you..
a) Post an SSCCE (<- link), rather than random code snippets that you think encapsulate the problem. Let's face it, you don't know the answer, and until you do, you cannot be sure the fix is to be found in the code snippets you post. Can you?
b) Post code in between code tags to retain the formatting and indentation. To do that, select the code and click the CODE button on the Plain Text tab of the message posting form.Easy there tiger, this is not a netbeans problem, so he is in the right place.
The code does look to be SSCCE or close anyways (remove the ... lines and if it still compiles and run I would say this is SSCCE).
The code tags is a huge problem here though. I am trying to read it without getting a headache, best as I can tell the OP seems to be doing some really funny stuff with paint. Like is he overriding paint to paint a square? That can't be good!
JSG

Similar Messages

  • Hi there... I need a little help with buttons and their actions using flex builder 4.5

    I run a repo company and have zero experience in the developing applications and I could use some help from anybody that is willing to give it.... Here is a basic idea of what I need...  let's say there are 3 states... state 1 has a question that says "car you read this?" and a "yes" and a "no" button... when you select either answer, you go to slide 2.  Slide 2 with have a question like "Is the sky brown?" and a "yes" and a "no" button and when either button is selected, you are taken to Slide 3.  Slide 3 needs to be some sort of a text form that is created by the user selecting the buttons and the screen would say something like "yes, i can read this.  no, the sky is not brown", or "no, I can't read this.   yes, the sky is brown" .  I know how to get the buttons to take the user to the correct new slide, but I do not know how to get the buttons to insert specific text somewhere else when any button is selected.... Can anybody help me?  Youtube is only getting me so far, and my kids are driving me nuts while I'm trying to figure this monster out...  I've gotten several slides created and some screens have several buttons, I just need to see what I need to put in the code to get it to do this type of function 

    Also where can I read up on setting my .Xdefaults and xmonad.hs file? I ripped someones from this forum, and it works nice, but I want to make my onw, but cant find any decent documentation. Thanks.
    At the moment, the best source for configs are those posted in the screenshots thread (for both Xdefaults and xmonad.hs), the xmonad config archive (and the available docs from the root page on that site), and our own thread.  Unfortunately you'll have to sort of scrounge for good docs on the xmonad.hs at the moment, since most of the information was written for the 0.4 version of xmonad.  The configuration has since been made MUCH simpler.
    Hope that helps some.

  • Help with buttons and hovering over them

    Hey all,
    I'm having trouble with a certain portion of code that I can't seem to get. What I want to do is display some sort of text when I hover the mouse over a specific button. I do not want to do this with a tool tip as there are other issues with using that method. So I need to print out something onto a JLabel whenever the JButton has the mouse over it. The catch is, the button may or may not have the current focus. How would I go about doing this? I have worked on it for a couple hours now and cannot figure it out. Thanks for the help.

    how would i differentiate between each specific button that has this listener? what i mean is i have about 8 different buttons that i want to do this for, so would the code go like this:
    public void mouseEntered(MouseEvent me) {
           if( me.getSource().getComponent() == myButton){
                     System.out.println("Just a test");
    }i'm not near a compiler currently but i think that is correct. or am i wrong?

  • Help with buttons and AS3

    I need urgent help for a college project, I've drawn a map and I have some photographs that appear on the map from the timeline one after another. I want the timeline to be activated when I press a Button On the map of where I've been on holiday but I have no Idea how to put it together.

    While I can offer a couple ideas, you'll need to spend some time figuring out how to use Flash... maybe get some formal training with it.
    For the photographs, create each set of them as a movieclip, and give each movieclip an instance name so that you can control its visibility using code.  Initially you will want to set the visible property of them all to false, likely done in the first frame of the timeline (ex: imageGrp1.visible = false; ).  Then you will use your buttons to make them visible.
    To code one of the buttons, you need to assign it an instance name as well.  Then you need to assign an event listener for that button to detect when it gets clicked, and an event handler function to go with the event listener... the listener calls the function into action when the event occurs.
    ex:
    // the event listener for a button with an instance name of imgGrp1Button...
    imgGrp1Button.addEventListener(MouseEvent.CLICK, showGrp1);
    // and the event handler function for the CLICK listener
    function showGrp1(evt:MouseEvent):void {
          imageGrp1.visible = true;
    If you want to hide any visible set when you select a new one, then you can create a function that sets them all visible = false and call that function both at the start in frame 1 and in each button event handler function (before you set the selected set to be visible).

  • Need help with button and motion tween...

    I'm trying to create a simple game. Right now I have one button that when clicked moves the character across the screen. My issue is trying to make the player stop looping after I click the button. If I just insert stop for the last frame it will only loop once and stop, but it will not play again after the button is clicked. I've tried using players_turn boolean but couldn't get that to work. Any help will be appreciated. Thanks!
    [AS]
    package
        import flash.display.MovieClip;
        import flash.events.MouseEvent;
        import flash.events.KeyboardEvent;
        import flash.ui.Keyboard;
        import flash.events.Event;
        import flash.ui.Mouse;
        public class Main extends MovieClip
            //Player variables
            var players_turn:Boolean = true;
            //Enemy variables
            public function Main()
                //Add event listeners
                buttonAttack.addEventListener(MouseEvent.CLICK, onButtonAttackClick);
            //Event handlers
            function onButtonAttackClick(event:MouseEvent):void
                if (players_turn == true)
                    //Player attacks enemy
                    player.gotoAndStop(2);
                    trace("attack");
                    trace(players_turn);
            //trace(players_turn);
            /*if (players_turn == false)
                player.stop();
                players_turn = true;
    [/AS]

    player is a symbol that is classic tweened. It has to frames. The first is a still frame with a stop action. The second has been converted as a symbol to show the player move across the screen and back.   When the attack button is clicked the player moves across the screen and back but it keeps on looping. If I add a stop action to the last frame it will move and comeback and stop but it will not move anymore when the button is clicked again.

  • Need help with buttons and fading clips

    howdy,
    I have 3 buttons on a stage that play 3 different movies.
    While no button is pressed, there is a looping video on the stage
    playing. When a button is pressed, that looping movie needs to fade
    out and fade in the movie that button calls for. I have attached
    script but it isn't working at all. Not sure where to go from here.
    thanks for your help.

    Hello again,
    Now I'm completely lost. Where should I add that code in your
    last post?
    thanks.

  • Help with buttons and timing

    I have four buttons, each with an advanced action.  Only the first one works.  I know it's related to the button timing, but I can't figure out how to fix it.

    Let's try some troubleshooting 101.  Remove the complexity to isolate the issue.
    Try setting each button just to have a Continue action again and test. This will show whether the problem is with the buttons or with the Advanced Actions you've assigned to them.
    If the buttons work fine with Continue actions, try dragging your first button off the stage area into the scrap area and then test the slide again.  If the button that is first in line NOW works, but others don't, then I would look at these advanced actions carefully because there may be something in the logic that is fouling things up. 
    For example, standard actions do not release the playhead unless you also add an extra Continue action line, whereas Conditional Actions do not require this same Continue action.
    Rod Ward
    http://www.infosemantics.com.au/troubleshoot-adobe-captivate

  • Help with games and graphics

    AMD athlon 64 X2 Dual-core processor 3600+
    RAM-512mb
    Operating system-win xp
    motherboard-msi-k9ngm
    Nvidia geforce 6100
    have directx 9.0 c .Have all the latest drivers.
    Games like RTCW-behind enemy lines,FIFA-2005,Empire Earth-2,HALO etc cant be run...
    The images i get when i run these games are absolutely scrambled..Nothing can be
    made out..I have tried all kinds of drivers and also changing settings but nothing has worked..Games like aoe-2 and diablo-2 did run tho...cs works in software mode but not in opengl...
    Can somebody out there plez help me...

    hello, welcome to forum.
    onboard VGA provide basic/limited gameplay. if you want to game install external PCI-E VGA.
    install chipset drivers: http://download.msi.com.tw/support/dvr_exe/mbd_dvr/NV61xx-Chipset_8.26_2kxp_WHQL.zip
    reboot
    install latest DirectX: https://forum-en.msi.com/index.php?topic=105196.0
    install VGA Drivers: http://download.msi.com.tw/support/dvr_exe/mbd_dvr/C51_WinXP2K2003_8205.zip
    reboot
    install Dual Core HotFix V4 --> https://forum-en.msi.com/index.php?topic=103843.0
    reboot
    install Dual Core Optimizer --> http://www.amd.com/us-en/assets/content_type/utilities/Setup.exe
    reboot
    re-test

  • Help with buttons :S

    hi all,
    i'm new to flash but i have an idea whats going on with webpages. I need some help with buttons! i have a website and its has a stage and 9 different flv's (screens). I've been trying to read online and i can't find out how to navigate to different screens, example below
    home          |            |
    about us     |  stage   |
    contact       |            |
    you click one one button it updates the stage. also i'm using actionscript 2.0.
    thanks for any help ahead of time
    Thank you,

    Is it a wi-fi or cellular connection that isn't working?  If its wi-fi and other people/computers/phones can connect check your settings.  If its cellular, are other people's phones (on the same carrier) working in the same location? If other people can't connect then it is likely a network problem.  If others can you may need to reset/restore you iPhone.

  • Help with writing and retrieving data from a table field with type "LCHR"

    Hi Experts,
    I need help with writing and reading data from a database table field which has a type of "LCHR". I have given an example of the original code but don't know what to change it to in order to fix it and still read in the original data that's stored in the LCHR field.
    Basically we have two Function modules, one that saves list data to a database table and one that reads in this data. Both Function modules have an identicle table which has an array of fields from type INT4, CHAR, and type P. The INT4 field is the first one.
    Incidentally this worked in the 4.7 non-unicode system but is now dumping in the new ECC6 Unicode system.
    Thanks in advance,
    C
    SAVING THE LIST DATA TO DB
    DATA: L_WA(800).
    LOOP AT T_TAB into L_WA.
    ZDBTAB-DATALEN = STRLEN( L_WA ).
    MOVE: L_WA to ZDBTAB-RAWDATA.
    ZDBTAB-LINENUM = SY-TABIX.
    INSERT ZDBTAB.
    READING THE DATA FROM DB
    DATA: BEGIN OF T_DATA,
                 SEQNR type ZDBTAB-LINENUM,
                 DATA type ZDBTAB-RAWDATA,
               END OF T_TAB.
    Select the data.
    SELECT linenum rawdata from ZDBTAB into table T_DATA
         WHERE repid = w_repname
         AND rundate = w_rundate
         ORDER BY linenum.
    Populate calling Internal Table.
    LOOP AT T-DATA.
    APPEND T_DATA to T_TAB.
    ENDLOOP.

    Hi Anuj,
    The unicode flag is active.
    When I run our report and then to try and save the list data a dump is happening at the following point
    LOOP AT T_TAB into L_WA.
    As I say, T_TAB consists of different fields and field types whereas L_WA is CHAR 800. The dump mentions UC_OBJECTS_NOT_CONVERTIBLE
    When I try to load a saved list the dump is happening at the following point
    APPEND T_DATA-RAWDATA to T_TAB.
    T_DATA-RAWDATA is type LCHR and T_TAB consists of different fields and field types.
    In both examples the dumps mention UC_OBJECTS_NOT_CONVERTIBLE
    Regards
    C

  • I use iphone 3GS, after upgared to ios5, my phone restart when i took picture with   button and while playing music .. what happened?

    I use iphone 3GS, after upgraded to ios5, my phone restart when i took picture with   button and while playing music .. what happened?

    Basic troubleshooting steps in the following order.
    1. Reset. Press and hold both Power and Home Buttons together till Apple Logo appears.
    2. Restore to a backup.
    3. Backup, Restore in iTunes and setup as new.

  • I am just starting out in graphic design and I wanted to know how to get more involved with either adobe and or graphic design? I am really very interested in working with adobe and graphic design more and becoming more involved with both!!

    I am just starting out in graphic design and I wanted to know how to get more involved with either adobe and or graphic design? I am really very interested in working with adobe and graphic design more and becoming more involved with both!!

    I have now recently downloaded 10.0.2 which is confusing in itself, as, as far as I can ascertain that is actually version 11, but I'm not even sure about that.
    Version 10.0.2 is the newest version and the successor to GarageBand '11 (version 6.0.5).
    The '11 is referring to the iLife '11 suit of multimedia application - the older GarageBand was a part of this bundle.
    Have a look at Edgar's graphical enhanced manuals, the explain very detailed how things work and why. You can buy them as iBooks from the iBook store or directly from the page:
    http://DingDingMusic.com/Manuals/

  • Help with count and sum query

    Hi I am using oracle 10g. Trying to aggregate duplicate count records. I have so far:
    SELECT 'ST' LEDGER,
    CASE
    WHEN c.Category = 'E' THEN 'Headcount Exempt'
    ELSE 'Headcount Non-Exempt'
    END
    ACCOUNTS,
    CASE WHEN a.COMPANY = 'ZEE' THEN 'OH' ELSE 'NA' END MARKET,
    'MARCH_12' AS PERIOD,
    COUNT (a.empl_id) head_count
    FROM essbase.employee_pubinfo a
    LEFT OUTER JOIN MMS_DIST_COPY b
    ON a.cost_ctr = TRIM (b.bu)
    INNER JOIN MMS_GL_PAY_GROUPS c
    ON a.pay_group = c.group_code
    WHERE a.employee_status IN ('A', 'L', 'P', 'S')
    AND FISCAL_YEAR = '2012'
    AND FISCAL_MONTH = 'MARCH'
    GROUP BY a.company,
    b.district,
    a.cost_ctr,
    c.category,
    a.fiscal_month,
    a.fiscal_year;
    which gives me same rows with different head_counts. I am trying to combine the same rows as a total (one record). Do I use a subquery?

    Hi,
    Whenever you have a problem, please post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) from all tables involved.
    Also post the results you want from that data, and an explanation of how you get those results from that data, with specific examples.
    user610131 wrote:
    ... which gives me same rows with different head_counts.If they have different head_counts, then the rows are not the same.
    I am trying to combine the same rows as a total (one record). Do I use a subquery?Maybe. It's more likely that you need a different GROUP BY clause, since the GROUP BY clause determines how many rows of output there will be. I'll be able to say more after you post the sample data, results, and explanation.
    You may want both a sub-query and a different GROUP BY clause. For example:
    WITH    got_group_by_columns     AS
         SELECT  a.empl_id
         ,     CASE
                        WHEN  c.category = 'E'
                  THEN  'Headcount Exempt'
                        ELSE  'Headcount Non-Exempt'
                END          AS accounts
         ,       CASE
                        WHEN a.company = 'ZEE'
                        THEN 'OH'
                        ELSE 'NA'
                END          AS market
         FROM              essbase.employee_pubinfo a
         LEFT OUTER JOIN  mms_dist_copy             b  ON   a.cost_ctr     = TRIM (b.bu)
         INNER JOIN       mms_gl_pay_groups        c  ON   a.pay_group      = c.group_code
         WHERE     a.employee_status     IN ('A', 'L', 'P', 'S')
         AND        fiscal_year           = '2012'
         AND        fiscal_month          = 'MARCH'
    SELECT    'ST'               AS ledger
    ,       accounts
    ,       market
    ,       'MARCH_12'          AS period
    ,       COUNT (empl_id)       AS head_count
    FROM       got_group_by_columns
    GROUP BY  accounts
    ,            market
    ;But that's just a wild guess.
    You said you wanted "Help with count and sum". I see the COUNT, but what do you want with SUM? No doubt this will be clearer after you post the sample data and results.
    Edited by: Frank Kulash on Apr 4, 2012 5:31 PM

  • MOVED: [Athlon64] Need Help with X64 and Promise 20378

    This topic has been moved to Operating Systems.
    [Athlon64] Need Help with X64 and Promise 20378

    I'm moving this the the Administration Forum.  It seems more apporpiate there.

  • I have problems with buttons and Forms in my trial proof of Indesign CC, how can I fix it?

    I have problems with buttons and Forms in my trial proof of Indesign CC, how can I fix it?

    Moved to InDesign forum.
    You can start by telling us what the problem is.

Maybe you are looking for

  • Two people using the same Mac for tutorials.

    I went through a tutorial with the writer of a program and he was walking me through the program while he was in his home city and state. I believe this 'sharing' was set up in our .Mac accounts. I do remember him telling me to get ready to accept a

  • Firefox will not display videos since Yosemite migration

    Good day! I run an early 2011 15" MacBook Pro, 2,2 GHz Intel Core i7 with 4g 1333 MHz DDR3 Memory, and an Intel HD Graphics 3000 with 384 Mo. Firefox is 34.0.5. Since I migrated to Yosemite (10.10.1), the browser I use (Firefox) will not display the

  • Realm does not work

    hi, i do have a problem with the "realm" funktion in SL Server. I want to have an accsess control for my wiki. So i set everyone access none an add some user. Testing it, i found out, that this "Realm" funktion doese not work. Looking into the list o

  • D6060 low ink light and no print.

    The low ink warning light blinks, printer does not print, but all cartridges are between 50 and 100% full.  No paper jams apparent.  Have followed directions to reset printer (remove cartridges, turn off, wait 10 mins, turn on). Same result with blin

  • How to prevent Evaluate User Policies to run for Bulk loaded users?

    Hi, I have an OIM 11G R2 environment, where i did a bulk load of abount 200,000+ users, and all the users' accounts were created using target recon. How do I prevent the evaluate user policies scheduler from running for these users? Any ideas are wel