Drawing issues

I create a jframe and a jpanel and try to add graphics to the jpanel (I also tried the jframe) but the graphics do not come up. What am I doing wrong? The code that I have is:
public void showStats(){
          Graphics g;
          JFrame tframe = new JFrame();
          JPanel p = new JPanel();
          tframe.setSize(200,200);
          tframe.add(p);
          tframe.setVisible(true);
          p.setLayout(null);
          g = p.getGraphics();
          g.setColor(Color.red);
          g.fillRect(10,10,50,50);
     }When a button is clicked it calls this method.

Tyler0976 wrote:
I create a jframe and a jpanel and try to add graphics to the jpanel (I also tried the jframe) but the graphics do not come up. What am I doing wrong? It's all wrong as you don't get graphics via getGraphics, you use a paintComponent override in your JPanel. Please read the Sun graphics tutorials for details.

Similar Messages

  • Re-draw issues after upgrade

    Dear All, After doing the upgrade to FCP 5.1.4 I am experiencing screen re-draw issues in the browser and viewer primarily. Did the upgrade screw with the video ram? I am using an ATI Radeon 9650 card, worked fine before the upgrade. My monitors are two Sony G520 21" 1152x870 resolution with Millions of colors and 75 Hertz refresh rate.
    When I am in standard layout and am in List View in the Browser it doesn't consistently redraw when I open different bins or move the window around. In the viewer it will stay on one tab even after I have clicked on another. FCP is the only app open but I did notice re-draw problems in PSD when it was the only app open as well. Suggestions, fixes, time to upgrade the video card? Thanks Paul.

    Under the apps tab in iTunes, is sync apps checked? Checks in the boxes for the apps you want to sync to your phone?

  • Remoteapp Server 2012 std drawing issues

    Hello!
    We are hosting an application trough Remoteapp on Server 2012 std. We have been struggling with a screen drawing issue where for example text in a textbox does not appear unless the textbox is clicked or borders of boxes are hidden until moving mouse over
    them. Running the application trough full rdp session works perfectly. Our client machines are running on Windows 7 with latest updates. 
    We have tried changing some remoteFX settings but nothing seems to be working. Does anybody have solution or ideas what might work for the described issue?
    Thanks

    Hi,
    Thank you for posting in Windows Server Forum.
    Any furhter update for your case. Did you check with manufacture of your application, is this supported as RemoteApp?
    As test what happens when you publish paint or notepad as RemoteApp, can you work easily with that.
    Thanks.
    Dharmesh Solanki
    TechNet Community Support

  • 2D Screen Draw Issues - KT880 Delta

    Ok, here I am again after resolving all the other issues.
    It would appear that I am having some slight 2D screen draw issues.  As with everyone else that has posted in these forums along the same lines with the KT880 Delta everything is fine with 3D.  For some reason it is only with 3D.
    So far I have done the following:
    Moved my Soundblaster Live Card to the 5th PCI Slot to avoid any conflict.
    Installed, Uninstalled and reinstalled both sound and nVidia drivers
    Disabled VLink 8x in the bios
    Set AGP to 4x in the bios (I only have a 4x AGP card currently)
    Set the cache to 128mb
    First installed the correct 4-in-1 drivers, then superceded thoses with the Hyperion drivers instead.
    Despite all this I am still getting draw issues when minimising and maximizing windows, scrolling through web sites, and dragging open windows around the desktop.  However, I have tried 2d drawing tests on windows media player 10, as well as pitstop (that actually told me I had a good setup!!)
    So, not too sure what to do...any more help would be great.
    Specs are:
    MSI KT880 Board
    Sempron 2800+ 2.0ghz CPU
    1.5Ghz DDR333 memory
    Gainward MX440 128Mb 4x AGP card
    Creative Soundblaster Live! 1024 card
    350w PSU (Not sure what type it is!!!)
    I hope thats enough information

    This appears to be a recurring problem with the KT880 across several different graphic cards (mostly NVIDIA).  I've never seen so many complaints specific to 2D graphics collectively as have been reported here for just one particular mainboard.  There is talk of a BETA BIOS that solved at least one case, but not others:
    KT880 Slow 2D Performance with Leadtek 6600GT AGP
    KT880 Screen Draw problem
    KT880 DELTA mainboard and 2D speed decrease
    MSI kt880 Delta + Graphics card = problems
    KT880 Slow Screen Draw and other problems
    KT880 DELTA FSR Problem with graphics in Win XP
    The number of reported cases is more than the # of threads because some users entered into existing threads to report they had the same problem with KT880.  MSI should be investigating this issue.

  • Streaming Video and Bitmap Draw issues.

    Hello all,
    In the current application I'm developing, I have a custom
    video console. While watching a video, certain points in the
    timeline will pop up a dialog box that gives the user the ability
    to switch to a related video. If the user clicks the button to view
    the related video, a 3D effect flips the current "main" console to
    a secondary "branching" console - much like the flip effect the
    iPhone uses. The videos are streaming from FMS 3, the client
    application was developed in Flex, and we are using Alex Uhlmann's
    Distortion Effects to achieve the 3D flip effect.
    When I first started developing the application, I ran in to
    the infamous "Security sandbox violation: BitmapData.draw" error
    whenever I would try the flip. After some investigation on the web,
    I found that I needed to set the Client.videoSampleAccess property
    in my FMS application's main.asc to allow bitmap snapshot access. I
    did so, and that seemed to do the trick. After playing with the
    application a bit more, however, I found that the error would still
    come about if I did the following:
    1. Pause the video (stream)
    2. Perform a seek while paused.
    3. Attempt the flip effect.
    When I did the above, the error came back. If I paused,
    performed a seek, and then unpaused the video, everything worked
    fine. If I pause and then immediately do the flip without a seek,
    everything works fine.
    It seems as though when you pause and then perform a seek,
    the player forgets that it has permission to do a frame grab until
    you restart playback.
    Has anyone else had this issue, or anything similar? If so,
    how did you solve it?
    Thanks,
    --G
    (For reference, here is the actual Error that is getting
    thrown)
    SecurityError: Error #2123: Security sandbox violation:
    BitmapData.draw:
    http://localhost/Bison/trunk/BisonClient/bin/BisonClient-debug.swf
    cannot access rtmp://localhost/digitaltutors. No policy files
    granted access.
    at flash.display::BitmapData/draw()
    at
    sandy.util::DistortImage/renderVector()[C:\workspaces\flex2.0.1\AlexFlexLibrary\sandy\uti l\DistortImage.as:190]
    at
    sandy.util::DistortImage/initialize()[C:\workspaces\flex2.0.1\AlexFlexLibrary\sandy\util\ DistortImage.as:107]
    at
    com.adobe.ac.mxeffects::SimpleDistortion/initDistortImage()[C:\workspaces\flex2.0.1\AlexF lexLibrary\com\adobe\ac\mxeffects\SimpleDistortion.as:501]
    at
    com.adobe.ac.mxeffects::SimpleDistortion/renderSides()[C:\workspaces\flex2.0.1\AlexFlexLi brary\com\adobe\ac\mxeffects\SimpleDistortion.as:357]
    at
    com.adobe.ac.mxeffects::SimpleDistortion/flipFront()[C:\workspaces\flex2.0.1\AlexFlexLibr ary\com\adobe\ac\mxeffects\SimpleDistortion.as:98]
    at
    com.adobe.ac.mxeffects.effectClasses::FlipInstance/updateFront()[C:\workspaces\flex2.0.1\ AlexFlexLibrary\com\adobe\ac\mxeffects\effectClasses\FlipInstance.as:46]
    at mx.effects::Tween/
    http://www.adobe.com/2006/flex/mx/internal::doInterval()[C:\dev\flex_201_gmc\sdk\framework s\mx\effects\Tween.as:567
    at
    mx.effects::Tween$/timerHandler()[C:\dev\flex_201_gmc\sdk\frameworks\mx\effects\Tween.as: 177]
    at flash.utils::Timer/_timerDispatch()
    at flash.utils::Timer/tick()

    Hi,
    I've been searching all over for someone having the same
    problem that I am.
    I'm seeing nearly the same thing that you are. I have
    SWFVerification turned on and the swf copied over to the correct
    directory. If I stream an FLV and attempt to capture grab the
    bitmap data it works fine. Always.
    If I try the same thing with a .mov or .mp4 file it mostly
    works, but sometimes (after doing basically the same thing you've
    described in your message), I get the SecurityError. If I try again
    after a delay of a few seconds, sometimes it works. When that
    doesn't work, if I seek a 1/10th of a second ahead in the video
    then try again, it almost always works. But sometimes that, too,
    fails.
    Have you found a reliable solution to your problem? Has
    anyone else seen this issue? I would file a bug for FMS, but it
    looks like the bug-tracking system for FMS is not public. It would
    be nice for it to be public.
    regards,
    david

  • Finder freezing on folder display (icon draw issue)

    I've got a weird issue with one computer. MacPro totally loaded (12-core, 16GB RAM, RAID card w/three drives as RAID5). Fast as anything as you might expect.
    Problem is with the Finder freezing when opening folders. It can happen with any folder, but it's inconsistent. Computer is used by a photographer so most images are image files (jpeg, tiff, Canon raw). I suspect the issue is with icon drawing and/or some cache related to that. I have, however, seen this happen with folders that contain nothing but other folders.
    Specifically, the user will open a folder. The Finder will begin to draw its icon previews. Most of the time no problem. Some of the time the Finder will freeze midway through the drawing (some icons remain as generic icons at time of freeze). Activity Monitor says Finder is at 2400%, which is a bit startling unto itself. Only way out is to restart the Finder.
    To test, I wrote an AppleScript which opens and closes a large series of folders (roughly 50 different folders). I'm able to duplicate the problem using this script. It's a different folder each time, and one interesting thing is if the script makes it through all 50 folders fine once, it'll do it fine forever until the next reboot (I stopped it at 2000 runs on two occasions). I can post the script if anyone is curious.
    The system is pretty clean, Photoshop and a few other regular apps, nothing tricky. I cleaned all the caches with Snow Leopard Cache Cleaner. I repeated the test with a freshly created user on the same system, with the same results. Repaired permissions, ran DiskWarrior, etc. Ran the extended hardware test from the OS DVD, no trouble.
    I thought it might be a Quicklook think, but I don't see any third-party plugins at all.
    I have not done an OS reinstall, as I'd like to actually solve this problem. If I run out of ideas I'll do that.
    Looking for any thoughts or suggestions.
    Thanks,
    Mitch

    I believe I've solved this problem. Disabling the processor's hyperthreading was the solution.
    To do this, I issued this command in the Terminal:
    sudo nvram SMT=0
    then immediate rebooted.
    Finder hasn't frozen since. I've rebooted and run my test script several times.
    Looks like Hyperthreading is an issue in many circumstances, including specifically the preview of large TIFF files. There's a developer tool called Processor.prefpane (installed with XCode) which can temporarily disable it. That's how I determined it was the cause. The above terminal command is permanent (the prefpane's settings reset to default after reboot).
    I'll update here if I run across additional information.

  • Direct Draw Issues (K7N2G-L & Me)

    Direct Draw causes a failure & often a automatic system rebooot.
    First off, I have
    -all the latest msi drivers
    -latest nividia drivers (as far as i know)
    -latest direct x (9)
    I have run all diagnostic direct x tests, and they ALL pass. I have also tried various bios configurations.
    Ive probably put aover 35 hours attempting to cure this issue, from format/install, XP Pro, to ME (me is more stable). And MASSIVE amounts of different bios configurations.    ;(
    I noticed that direct draw version is the same when i had direct x 8, as it is with 9. Is an old version of direct draw set into the motherboard somehow?
    SOMEONE HELP IF YOU CAN!

    Sounds like it may be hardware, if you did all that and still have a problem.  As far as I know directx stays on your harddrive and is a part of the actual operating system.  Thus when you reformat, it is erased.  I used to have a gainward GF2MX (that I tortured inhumanely) that had a similar problem with directdraw.  whenever I started any directdraw game, the OS would scream and then show multicolored bars across the screen, after some deduction, it turned out that the gainward tweak program that came with the card installed fine in xp, but really puts its foot in my computer's ramslot whenever it started any 2d action.  Just a thought, but it sounds like more of a potential hardware problem to me like the actual vidcard itself.

  • Graphics.draw() issues

    I have a custom UIComponent that always measures 50x50 pixels
    (in the measure() function). I use the Graphics object to draw a
    filled box that covers the whole area. I then draw a few circles
    and add text outside of the box. I do this so that when I reference
    the object, I know the (0,0) coordinate is at the top left of the
    box and I dont worry about the text or circles.
    Some problems occur when I draw circles only on the left
    side, or when I draw a filled circle on the right side: I get an
    infinitely wide filled box whose origin (0,0) is where I just drew
    the circle. Ill try to post an image somewhere so you can see this
    problem.
    Has anyone else seen this, or is there some problem inherent
    in drawing outside of an objects measurements?

    I think I have found my probelm:
    graphics.beginFill()
    graphics.drawRect(...)
    graphics.endFill()
    This code is in the UpdateDisplayList() function of my custom
    component. I commented out the drawRect function, and saw that the
    phantom box still appeared in the same distinct color defined for
    the code in quiestion(different than all other fills used, so I
    know it is THIS fill that is the problem). And the box's
    coordinates directly correlate to a line that I draw earlier. This
    leads me to believe that the UpdateDisplayList function gets called
    again before the end fill.
    Ill try throwing in endFills, or try placing this fill code
    earlier in the updateDisplayList method.

  • I am having a major screen drawing issue on multiple devices

    Both a tablet using jellybean and a droid2 using gingerbread, pages are mostly drawn in lines.. Tried GPU, font size settings... Etc. Been a problem since upgrade from her 29.xx

    Does it look like https://bug819183.bugzilla.mozilla.org/attachment.cgi?id=700652 or https://bug819183.bugzilla.mozilla.org/attachment.cgi?id=700651 ?
    What is the model and manufacturer of your tablet?
    Will check to see if we have a droid 2 on Wednesday.

  • Serious performance issues with no solution in sight

    I hate to be in such desperate need of help, but these forums have been extraordinarily helpful before, so I'm hoping someone will be able to help me with this series of problems.
    I honestly don't know how to describe the problem beyond that it seems like the computer is coming apart.
    The problem started about a week and a half, maybe two weeks, ago. I was having problems with Safari at first. Every time I used it, I would get the spinning ball, and it would take several minutes to open. If Safari was opened, the computer seemed to just lock up. No other applications could be opened, and no folders could be used. On top of that, whenever that spinning ball appeared, a series of clicking sounds could be heard coming from the upper left hand portion of the laptop (not the screen). The only way I could make it stop was to force quit (and even that was a luck of the draw issue).
    I took the computer in to be checked out, but their scans and tests showed the same results as mine: nothing is wrong. The problem has since spread beyond Safari, which I ended up erasing from my computer. That same rhythmic clicking happens whenever the spinning ball appears. I have tried to find some kind of pattern to the sound/spinning ball, but have thus far been unsuccessful.
    It has happened when using iTunes, saving with appleworks, having AOL instant messenger open, using Firefox, using quicktime. Whenever it happens, my system basically locks up and renders all applications useless. Force quitting is the only way I can get things going again, and even then it can take several minutes for me to even be able to force quit.
    Also, software updates quit before I can download them.
    I apologize for the long post, but I want to try and provide as much information as possible.
    To me this sounds like a failing hard drive, and that is what the tech thought, but the tests just show nothing is wrong, and I cannot comprehend why.
    My many thanks in advance for any help you can provide.

    Hi Samuel,
    I will agree that louder than normal clicking is a sign of something wrong with the hard drive. But you might just be hearing the hard drive working normally, it just might be doing it a lot more.
    If you haven't tried a permissions repair, try one. It's worth a try, and I have known it to improve the performance of my Macs to some extent.
    Also, if you have access to it, Try DiskWarrior. DiskWarrior is a program that will take your hard drive and rebuild the directory for it, clearing up errors and improving overall performance.
    If you've got the means to do this, try reformatting your system. It's a lot of work, I'll admit, but perhaps something got corrupted and it could be messing up your performance.
    Another thing you can try is to boot OS X from some sort of external hard drive (if you happen to have a friend who happens to own an external hard drive with OS X on it... wait, am I the only one??? darn.) and see if the problem exists when running off the other drive. If you don't happen to have such a hard drive (I mean, everyone's got a spare external hard drive with OS X installed on it, don't they?) you can simply boot a friend's Mac in FireWire target disk mode (boot the computer while holding T key), connect the 2 computers, and boot your system from the friend's hard drive (by holding the option key at startup). Of course, if none of your friends own Macs, you need to find better friends!
    Basically, though, if your computer successfully boots from one of these other systems and doesn't exhibit these symptoms, then it's something with your hard drive. Try first to reformat (or at least re-install OS X), and if that doesn't work, you'll have to do a repair.
    If you have to resort to calling tech support, I'll bet you $10,000 that they're going to ask you to reset the PMU and/or the PRAM on your system. Your computer could have dirt on it, and they'd have you reset the PRAM and the PMU.

  • Flash CC Brush Tool abruptly stops drawing when stage size is small

    When using the Brush Tool, I'm having an issue that the stroke I'm drawing will abrupty cut off at a certain point on the screen (roughly halfway down the monitor, it doesn't relate to the canvas position or any coordinates).  This seems to happen when I have the Stage size set to a smaller size (64 x 64 pixels for example).  I've been able to reproduce the same behavior on multiple files, and on both a Windows 8.1 machine and a Windows 7 machine, both using the up-to-date version of Flash CC.  Both machines are dual monitor, I'm not sure if that plays a factor in this.
    To reproduce: 
    1.  Create a new FLA in Flash CC and set the stage size to 64 x 64 pixels.
    2.  Use the Brush Tool and attempt to draw from the top to the bottom of the screen (zoom level and position on the canvas does not matter, as long as your cursor is going from near the top of your monitor to the bottom of your monitor).
    3.  The stroke will abruptly cut off mid-drawing at a certain point on the screen, roughly half-way down.  You can continue to draw and move upwards and it will reappear when it crosses this barrier again.
    This does not happen if the stage size is set to something larger (640 x 480 for example).  This also does happen in Flash CS5 or CS6, and have only noticed this happening in Flash CC.
    This is happening using the mouse for drawing, and also happened when I tested it on a different PC with a Wacom tablet attached.
    Is this happening for others as well, and is there any fix for this behavior?  (aside from always using a large stage size)

    Hi All,
    Just want to update you all that the latest Flash CC 2014 release(14.0.0.110) has the fix for this drawing issue.
    This release also features
    * New and improved Motion Editor
    * SVG export
    * WebGL for animation
    * Variable Width Tool
    * Tweening for variable-width strokes
    * Object-level Undo
    * Export as Projector
    * HTML5 extension support
    and much more...
    To know more about what's new and exciting in Flash CC 2014, please visit
    Flash CC 2014 Overview : Animation software | Download free Flash Professional CC trial
    Flash CC 2014 Blog Post :  http://blogs.adobe.com/flashpro/2014/06/18/flashprofessionalcc2014/
    Thanks!
    Mohan

  • [Bug?] Hypertrend Draws 'Fake' Gaps in Data

    Hi
    I have noticed Hypertrend drawing gaps in the data (when there is actually data there). This can be confirm when you zoom in on the data. Is this a known issue, or is there any workaround/configuration? The images are from Hypertrend in LabVIEW, but we have seen it in MAX too.
    Cheers
    -JG
    Certified LabVIEW Architect * LabVIEW Champion
    Solved!
    Go to Solution.

    Here are some prior discussions on the subject...
    http://forums.ni.com/t5/Real-Time-Measurement-and/Distributed-System-Manager-Historical-Trend/m-p/99...
    Also see attachment for a Jing video of the problem.  This occurs in DSM 2009 and 2010 and on multiple machines.
    Here is the final result after much rangling with NI:
    From: Mark Black [mailto:[email protected]]
    Sent: Thursday, January 21, 2010 4:53 PM
    To: Sachs, Michael A. (MSFC-ET30)[Intelligent Systems]
    Cc: Roger Hebert
    Subject: Re: DSM issues
    Hi Mike,
    We do have a CAR for this issue (#178809), but its a general CAR for these
    types of Hypertrend drawing issues that your case fits into. Currently
    this bug is not targeted to be fixed for SP1, but I have contacted our Shanghai
    development team for more an update.  Have you seen this issue on multiple
    different systems?  Have you seen this issue with plots not tied to your
    GPS synched cRIO?
    Thanks,
    Mark Black
    Product Support Engineer - LabVIEW R&D
    National Instruments
    [email protected]
    (512) 683-8929
    Attachments:
    2010-10-18_0907.zip ‏3018 KB

  • Muttng and putty drawing characters

    So, this has been bugging me for a time and I can't ever figure out the exact reason this happens.
    When I use putty to connect to a remote server (with TERM set to xterm-256color) and load up muttng, I get drawing characters that look like this
    Note the 'x's should be vertical lines and the 'mq' should be horizontal lines... but nope.
    I've tried messing with the fonts to no avail. Putty is set to UTF-8 mode with unicode line drawing chars, and my locale is UTF-8 enabled.
    This does *not* happen to be a problem with 'mc' (which uses slang for drawing) however, so I don't think it's a drawing issue in general. I expect it's ncurses only...
    Any ideas?

    Hmmm interestingly enough, this seems to be caused by setting putty to utf-8 mode. If I switch putty back to latin1, I get appropriate drawing characters.
    Anyone know why that is?

  • Having a issue with CS5

    I started a drawing in CS4 and currently working on it in CS5 which is why I'm wondering its the reason why I'm getting this issue. My issue is that my layers are locking sort of. Like if I place a colour on the layer I cant place a colour ontop of the previous colour. It allows me to place the new colour around it but not on it. It was not like this but now its slowly happening to all of the layers I have for this picture so could you please tell me what I'm doing wrong and if I can fix this?
    Also I'm getting a issue where the colours are changing on me. Colours that I placed down turn out diffrent if I use the eyedropper like the hue or it turns out a bit lighter than the colour I'm trying to get. Bit of help with this issue too please?

    Turn off OpenGL in the prefs and use the correct brush types. I can't really make sense of your description, but hardware drawing issues due to bad OpenGL setups and e.g. using the color replacment tool or mixer brush instead of the conventional brush seem to explain the problems best.
    Mylenium

  • Getting screen re-draw, color blotches on certain Macs using ARD 3

    Getting screen re-draw, color blotches on certain Macs using ARD 3
    Has anyone seen this. Serious re-draw issues when observing / controlling certain Macs with ARD 3, have seen this sometimes with ARD 2.
    Buttons, boxes get blotched and can not see what you are doing, disconnecting and re-connecting does not solve it.
    Power Mac G5 Dual 2.0   Mac OS X (10.4.7)  

    Have you tried reinstalling the ARD client? Are the systems that have this problem running 10.4.7?

Maybe you are looking for

  • How do I set up a new iphone so that contacts, calanders, and mail do not sync to the other phones in my houshold?

    I just purchased a new iPhone 4S for my 11 year old daughter. After setting it up today, and entering in our apple ID, all of my contacts appeared in her contact list, same with emails and messages. How do I set it up so that all my garbage isn't in

  • Imac and external webcam

    Hi all, I have a G5 with an external isight. I'm getting a new iMac soon. My questions is...in my business the external cam is handy in that I can move it anywhere. If I need to show a client a tool I'm working on I can do so. With an iMac I have to

  • Intel iMac won't play DVD

    I have an Intel iMac purchased in late 2009 and the superdrive has quit playing DVDs. It will burn all types of media and will play CDs and will read and install software CDs but will not play a DVD. These are new commercial movies. After inserting t

  • Sliding Panels Question

    Hi there. I'm new to Spry, and I'm using 1.6.1 in Dreamweaver CS3. I want to create sliding panels to showcase some work I've done, but I wanted to know if it's possible to build a scroll function for one panel which will have multiple pieces of work

  • Another "connection drops" thread

    i browsed around the first page and it seems a lot of people have been experianceing this. Now, i was away at college the past year so i was used to high speeds i got, but i should NOT have to wait 10 minutes to watch a 3 minute youtube video. no one