Is it possible to draw on a picture after loading and before displaying it?

Hi to all :)
I intend to write a small applet(connected with a server using RMI, but that's not important :) ) that represents the 'tic-tac-toe' game.
I've planned to create 3 pictures - blank, containing a circle and containing a cross.
Then I think to used 9 JButton-s and set the blank pic as an Icon for the JButton. An action event listener will change the picture to circle ot cross and so on...
I would like to draw a line over the 3 pictures for the winner at the end of the game.
Is it possible to load a circle or cross picture, then draw a horizontal/vertical/diagonal line on it at runtime and after that set it as an Icon for the Jbutton ?
Thanks in advance. Take care :)

To my knowledge, you can't overlay icons on a JButton without subclassing it and overriding paintComponent. In that case, II suppose you could try painting over all your buttons with something like:parentContainer = new JPanel() {
    @Override
    protected void paintComponent(Graphics g) {
        super.paintComponent(g);
        drawLine(0, 0, 100, 100); //etc...
parentContainer.add(myFirstButton);
//etc.

Similar Messages

  • HELP  --  KEEP LOOSING PICTURES  -- after loading show up w/ question mark

    Anyone ??!!
    I have worked on this document for over 100 hours and made several saves in between, but keep loosing pictures all the time?
    Lay-out stays OK, but the locations for many of the pics are indicated with gray squares and question marks!!
    Is Pages unable to handle Larger docs with many pics? (I have already split into 2 docs of 27 pages, but problem remains)
    PLEASE ANYONE?

    Hello Robert,
    your documents are really huge. Are the files so big or are they so manyfold? If you have the possibility (with Preview or better with Photoshop/Gimp/Seashore) you should save the images with as low size as possible. Do you want to print the portfolio or it is for screen presentation only?
    To see if there is a problem with Pages or with the images, you should have a look inside the docuemnt package folder. To do so, do a control-click onto the document icon and choose "Show Package Contents" from the appearing menu. In the new Finder window you can see all the files your Pages document contains. If you can find the images there about which Pages wrote it is missing, try to open some of them in am image editor to see if they are broken.
    If you can open them, they are okay. I think the images are made with an digital camera. Of what resolution are the images? If you need the portfolio for screen purposes only, you can calculate them down to 92dpi and a proper pixel count (for smaller display ca. 800 to 600 pixel and for larger display ca. 1280 x 960 pixel). This depends on your own likeness. I only want to give you a guess.

  • I have problems with pictures in hotmail when i use firefox. The pictures still loading and no preview . have to download to my pc to see the picture. i check with other browser like explorer and work fine, it's just with firefox. please any help?

    problem loading pictures in hotmail.

    -> If images are missing then check that you aren't blocking images from some domains. See:
    http://kb.mozillazine.org/Images_or_animations_do_not_load
    -> Check the permissions for the domain in the current tab in Tools > Page Info > Permissions
    -> Check that images are enabled: Tools > Options > Content: [X] Load images automatically
    -> Check the exceptions in Tools > Options > Content: Load Images > Exceptions
    -> Check the "Tools > Page Info > Media" tab for blocked images (scroll through all the images)
    -> There are also extensions (Tools > Add-ons > Extensions) that can block images.
    Troubleshooting extensions and themes
    https://support.mozilla.com/en-US/kb/Troubleshooting%20extensions%20and%20themes
    Check and tell if its working.

  • Unable to publish properly: pictures wont load and an error message...

    Hey, when i try to publish, i get this strange error message:
    An error occurred while publishing file “/Web/Sites/iWeb/MinkBlog/Blog/BE514CE5-757A-419B-AF30-2CB728EC2A47files/navbarbackground.png”.
    The page is published, but the pictures from my most recent publish do not come up. Any help would be great.
    strangely confused,
    Mike

    Read: http://support.apple.com/kb/ts2690

  • Is it possible to scale Illustrator files inside After Effects and retain the vector quality?

    I imported an Illustrator file into my After Effects project and scaled the ai file to 200%, but noticed that is pixelated.  Is there a way to keep the ai file vector based inside After Effects.
    Note:  I attempted to use the "Create Shapes from Vector Layer" and the paths all show up, but the fill and stroke colors disappear?? 
    Any suggestions would be appreciated.
    I am using CS6 Creative Cloud on a Windows 8 with 16 gig of ram
    Thanks,
    Paul

    Dave is right. See this:
    FAQ: Why are my vector graphics (e.g., from Illustrator) jagged or soft?

  • How can I tell LR not to automatically import pictures after editing and saving?

    Whenever I open a RAW file from LR into Photoshop and save it within Photoshop as a tiff or whatever, it gets automatically imported to the LR catalog. Is there a way to avoid this?

    klsteven wrote:
    Jim,
    I know that it`s not a raw as soon as it`s in PS. That`s why I open it as smart object.
    One more question: In the preferences there is an option "stack with original". I would expect the tiff or psd to be in a stack with the raw file. But it doesn`t get stacked with it. So what is the option supposed to do?
    It does stack with the original on my computer. Opening the raw image in Photoshop as a smart object does allow you to go back to the raw file in Camera Raw. And it adjusts the raw file. But when you close Camera Raw you are back working on the image in Photoshop. All the work you do in Photoshop is saved in the TIF or PSD. If you then go back to Lightroom and delete that TIF or PSD file you have thrown away all the adjustments done in Photoshop. Of course the raw file will be impacted by the adjustments that you made in Camera Raw, and it affected the TIF or PSD. But you're still throwing away all the Photoshop work.

  • Preview-picture making fix in After Effects CS6 before rendering

    Hello guys,I use tutorials for learning after effects cs6...I can't find how I can rendering a preview-picture which will be showed in the ready movieclip. Do we have a possibility for making a special picture/ICON in CS6 before rendering? Greetings from Torsten

    Hello Andrew, sorry about my english :-)  
    Yes I'm trying to define a special thumbnail image of a rendered clip from my timeline - I can't believe it, that AE CS6 this not can??? In a little clip with 15 sec it will rendered any picture in the middle of the timeline...I can't believe it !!! THE GREAT PROGRAMM AE CS6... :-(
    You are really sure?

  • Is it possible to draw arrows in imovie

    is it possible to draw arrows in imovie

    Yes,
    Use iMovie 06 with the GeeThree Volume Six Plug-in. Then you can Draw or write anything you like on the video frame.
    http://www.geethree.com/slick/galleries/d_v6.html
    Lots of other effects are available below.
    http://www.geethree.com/slick/index.html
    ( iMovie 08 - 11 cannot use plug-ins)

  • Is it possible to make a composite picture using Faces.  e.g. for a family xmas card ?  If so, how is it done ?

              Is it possible to make a composite picture using "Faces" for example on a family Xmas or other Greetings card ?
                   Eric

    Afraid not.
    You can make composite images with a Photo Editor and use that.
    In order of price here are some suggestions:
    Seashore (free)
    The Gimp (free)
    Graphic Coverter ($45 approx)
    Acorn ($50 approx)
    Pixelmator ($50 approx)
    Photoshop Elements ($75 approx)
    There are many, many other options. Search on MacUpdate.
    You can set Photoshop (or any image editor) as an external editor in iPhoto. (Preferences -> General -> Edit Photo: Choose from the Drop Down Menu.) This way, when you double click a pic to edit in iPhoto it will open automatically in Photoshop or your Image Editor, and when you save it it's sent back to iPhoto automatically. This is the only way that edits made in another application will be displayed in iPhoto.

  • Prompt if you please, to me are necessary programs making it possible to draw off music from the network VK, program- analog Ward, program- analog of adob Flesch pleer. if there are free, the thanks a lot

    prompt if you please, to me are necessary programs making it possible to draw off music from the network VK, program- analog Ward, program- analog of adob Flesch pleer. if there are free, thanks a lot

    Hi Christoffer,
    Thanks for the reply, excellent information! I was a bit struggling with the availability of the tokenGroups attribute, but your info makes it pretty clear.
    Do you also happen to have experience with the LDAP_MATCHING_RULE_IN_CHAIN method to retrieve nested groups? It seems to perform pretty well, retrieves all nested groups using the memberOf attribute and works on all AD environments (W2K3 SP2 or higher).
    Richard Mueller did a performance test using both methods:
    http://social.technet.microsoft.com/Forums/fr-FR/f238d2b0-a1d7-48e8-8a60-542e7ccfa2e8/recursive-retrieval-of-all-ad-group-memberships-of-a-user?forum=ITCG
    User with 14 groups:
    Method                      Groups   Ave. (10 runs) 1 standard deviation
    LDAP_MATCHING_RULE_IN_CHAIN    11     0.1664 sec.   +/- 0.0325 sec.
    tokenGroups                    13     0.0895 sec.   +/- 0.0038 sec.
    Recursive memberOf             11     0.0774 sec.   +/- 0.0021 sec.
    User with 308 groups:
    Method                      Groups   Ave. (10 runs) 1 standard deviation
    LDAP_MATCHING_RULE_IN_CHAIN   305     0.2664 sec.   +/- 0.0151 sec.
    tokenGroups                   306     1.2147 sec.   +/- 0.0271 sec.
    Recursive memberOf            305     1.2813 sec.   +/- 0.1190 sec.

  • Is it possible to show my contacts pictures when they text/sms?

    Hi,
    This could be one of those questions for things that only seem to happen on the TV. But is is possible to have a contact picture appear when I receive a sms from a contact who is already stored in my phone. I know you can do this when a call is received, but wondered if it can be done when they text.
    Cheers 

    Sorry, no. You can suggest Apple add that feature here:
    http://www.apple.com/feedback/iphone.html

  • If I YouTube have examinated small film I have been possible fix no longer on picture (since last update 26 july) now I have got a black planed in plate the blade ven the film. I cannot fast scrolle on picture.

    If I YouTube have examined small film I have been possible fix no longer on picture (Since last to update 26 july)
    now I have got a BLACK PLANED in plate the blade ven the film. Now I cannot fast scrolle on picture (since 26 july)
    I hope someone get the answer! In the Apple shop they say, may be by the next Udate it will be pepared?

    That is priceless!!!  Thanks!  I sure needed a good laugh after spending/wasting hours & days trying to either get my c6280 to give up on its Ink System Failure fixation, or find a decent replacement.  Unfortunately I need the Smart Web Printing feature that I guess only HP has, or I'd try a different brand. And now even HP has very few models with that available.
     My error msg is a little different from those previously stated, but close:  0xc18a0201.  Even tho there were frustrations with my c6280, I did like several of its unique features which are hard to find now under $100.  I hate how HP (& I suppose other brands also) are CONSTANTLY changing models & then of course ink cartridges.
    Oh heavens, I've had the c6280 a whopping 2 1/2 years!   I'm sure they want us poor slobs to have to buy a new one every year & a day!  To say nothing of the exorbitant prices for ink.  And now if this one is really dead in the water, I have SIX unused #02 ink cartridges which I cannot return---I got them in a combo pack, & for some reason have wound up with THREE lite pink & THREE lite blue cartridges, while having to buy extras of the other colors, that ran out before the others!!!   Yeah, & what's with that not being able to print in BLACK if a color runs out????
    Anyway I really loved your essay!   It's a classic!  And says it all!  I hate that we have to be 'slaves' to the electronic 'wonders'!!!

  • Possible to draw power from iPhone battery?

    Is it possible to draw power from the iPhone battery in order to power an external device? If so, how does one go about doing it?
    Thanks,
    Colin Marcus

    Colin:
    Did you ever get an answer to your question?  I have the same one.
    Thanks!
    Tom

  • Is it possible to create a single picture from the many that I have taken?

    I have about 100 pictures of dogs and cats,as well people and I was not sure if adobe elements 10 could do this. Many of the pictures are from family that has passed away and I wanted to make one large photo from all of them

    Unfortunately, you have posted to the Premiere Elements Forum. You want the Photoshop Elements Forum.
    They will give you the steps, but there are many ways to create a photo-collage. Those can differ a bit, but basically you will Open a background Image (can be a New Image w/ a colored background or an existing Image), and then the ones that you wish to include. Click on the Background Layer of each of those, and drag to the background Image. The next step is for Photoshop, and might not work in PSElements, but hit Ctrl+T (Free Transform), hold down Shift to constrain the Aspect Ratio, click one corner and drag that, to decrease/increase the size. Repeat.
    Good luck,
    Hunt

  • Any possibility for loading and changing XFL/... data at run time of Flash app?

    Hi everybody,
    I have a quick and general question for the following case:
    I want to produce some transitions and effects for a kinetic typography project in After Effects and then import these parts into Flash Professional via XFL and Bridge.
    So my actual problem is this one: my Flash application should be able to load these made transitions and effects dynamically at run-time and not from a pre-configured timeline made upfront. Because there should be dynamic text fields in these XFL data from After Effects I also need to be loaded at run-time for the kinetic typography thing.
    So is there any possible way to do / load / change the dynamic text fields in these XFL data or the order of all transitions and effects in Flash Professional at run-time or anything else?
    I know this is a special question, but I hope there would be an answer...
    Thanks for your help in advance
    Regards,
    Kevin

    Something along this model is what I had in mind:
    public class MainPanel extends JPanel
        private DrawPanel drawPanel = new DrawPanel();
        private JComboBox comboLeft = new JComboBox();
        private JComboBox comboRight = new JComboBox();
        public MainPanel()
            // add drawpanel and comboboxes to main panel
            // add item listener to comboboxes
        private class ComboListener implements ItemListener
            @Override
            public void itemStateChanged(ItemEvent arg0)
                if (...) // both comboboxes changed
                    // get values from comboboxes
                    drawPanel.setValues(left, right); // call drawpanel's method
    public class DrawPanel extends JPanel
        private int left = 0;
        private int right = 0;
        public DrawPanel()
            //setPreferredSize(....); // set panel size
        @Override
        protected void paintComponent(Graphics g)
            super.paintComponent(g);
            //... draw the line depending on the left and right value
        public void setValues(int left, int right)
            this.left = left;
            this.right = right;
            repaint();
    }

Maybe you are looking for