Problems displaying GUI and fillRect()

Hello all, thanks for reading this post ... this is a four part question:
1)I have a JFrame set up with JButtons along the bottom. There is open space at the top where I would like to display some 2D drawing like fillRect(). In my paint method, when I use fillRect(), my buttons would disappear until I ran the mouse over them. To fix this problem I used a super.paint(g) before my fillRect() and in my paint method. Is there a better way to disiplay 2D images with a GUI?
2)I am dispalying 2D images directly to the JFrame. Should I use another type of java container like a JPanel to do the 2D output? If so, how would I alter and use the paint method of JPanel (for example) so that I could call it from JFrame.
3)I need to display repeated rectangles with the fillRect() function. Right now I am including the fillRect() call in the paint method and using another method to loop repaint. I am getting many errors and have a feeling that there is an easier way to achieve repeated display of rectangles. Can anyone offer a better way?
4)The title bar of my JFrame steals some pixels away from the area that I am trying to draw to. Consequetly, if I try to paint to the coordinates (0,0) i cannot see the coloring becuase it is behind the title bar. I read in a book about something called insets that have variables such as .top .bot .left .right that have the size of the margins taken up (e.g. the title bar). I tried to get such information from my JFrame but didn't have much luck. Any and all help is greatly appreciated.
To recap, I have a JFrame as my main program, with JButtons at the bottom and open space at the top for displaying 2D images.

Follow this sample:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Draw2 extends JFrame 
     Tpan     board = new Tpan();
     JButton jb1    = new JButton("sample1");
     JButton jb2    = new JButton("sample1");
public Draw2()
     super();
     setBounds(1,1,500,400);     
     addWindowListener(new WindowAdapter()
    {     public void windowClosing(WindowEvent ev)
               dispose();     
               System.exit(0);
     getContentPane().setLayout(new BorderLayout());
     getContentPane().add("Center",board);
     JPanel con = new JPanel();
     getContentPane().add("South",con);
     con.add(jb1);
     con.add(jb2);
     setVisible(true);
public class Tpan extends JPanel
public Tpan()
     setBackground(Color.pink);
public void paintComponent(Graphics g)
     super.paintComponent(g);
     g.setColor(Color.black);
     for (int i=0; i < 35;i++)
          g.setColor(new Color(i*7,100,250-i*6));
          g.drawRect(i*9,i*6,50,50);
public static void main (String[] args)
     new Draw2();  
}       Noah

Similar Messages

  • Problem in Gui and Component

    hi ,
    i am developing a mobile application using j2me midp. I am using LWUIT for using create GUI,
    now i want some requirements. first one is i want editable combobox, that is to type the combobox
    like swing, it is possible in j2me midp or any other gui tool kit like LWUIT. and second one is
    i want to remove text field border, that is i dont required the border of the text field.
    please help me how to solve my problem,
    thanks in advance,
    With Regards,
    Ganesh Kumar

    hi ,
    i am solve my second problem, that is to remove the text field border,
    to make the textfield method setBorderPainted( ) is make false then the border is not visible,
    now i want the major problem is editable combobox, please give some solution.
    With Regards,
    Ganesh Kumar

  • Problem Displaying file and doind a redirect

    Hello,
    I am displaying a file using a wpg_docload.download_file(v_bfile); call from a PL/SQL procedure that is called on a button
    which works fine once I put a call to APEX_APPLICATION.g_unrecoverable_error inside the procedure , as below.
    APEX_APPLICATION.g_unrecoverable_error := FALSE;
    The button is supposed to automatically refresh (reload, resubmit) the page once that operation is finished. However the page does not refresh unless I remove the APEX_APPLICATION.g_unrecoverable_error line, which in turn means the file is not displayed.
    I have tried putting in a APEX_APPLICATION.g_unrecoverable_error= TRUE at the end of the procedure and in Apex where the button is called but the system is not having any of it.
    How can I get the file to display (dialog button to appear) and then the redirect to work please..

    Hi,
    The requirement is as below.
    We need to create an customize xml using some  other xmls.
    Than using the generated xml,we need to generate an pdf report.
    Then we need to sent this pdf report for printing.
        I have created a custom action block using java.
       This code takes path of xml and generates a pdf report.
       It than creates a report at particular location.
       This code is working fine in xMII 11.5. As we can store/ create files at any location. 
       But not working in 12.0. I donu2019t know why?
       Is their way around in 12.0 by which we can achieve this functionality.
    Thanks,
    Vishal J

  • PDF forms have problems displaying text and only appears when the field is selected

    Hello,
    I created some pdf forms to distribute to the company clients. But we are having some people complaining about the text visibility. When they have work in team, the pdf that they receive from a third person often appears unfill or without text, the text is only visible when the field is selected. I need to find a solution for this because our company products are base on this forms.
    If there is any addition information that I should add to understand what is happening and how to fix it, I'll be happy to write it.
    In the company, we all have mac and the forms where created innitially in Adobe acrobat 9 pro, but we have now Adobe acropabt XI pro.
    The users have both Mac and Windows systems.
    Thank you,

    This is usually caused by the form being filled-in and saved by a Mac user who is using the Preview application to view the PDF. More information is here: http://kb2.adobe.com/community/publishing/885/cpsid_88564.html
    It is a good idea to inform your users that Adobe Reader (or Acrobat) should be used to work with the forms.

  • Problem displaying data and Smart data debugging pl/sql

    I'm using JDev 9.0.5.1 build 1065, when i debug a PL/SQL function from the connections navigator, it allows me to stop at a breakpoint, but it doesn't display anything in the data or smart data panes. Do i need to change a config setting somewhere ? The PL/SQL is in an Oracle 8i database, does it need to be 10g for this functionality to work ?
    Thanks
    Alistair

    Are you trying to debug ASP.NET or a windows app or direct debugging?
    If a windows app or direct debugging, follow these steps:
    http://cshay.blogspot.com/2006/07/plsql-debugger-in-visual-studio.html
    If ASP.NET, follow part of the steps above to configure, but then use these steps for External App debugging:
    Debugging PL/SQL from .Net 2003

  • 've recently upgraded to FireFox v22.0. Originally, a legacy XBAP I use always opened correctly in FireFox and had no problems displaying or running. As of v22.

    I've recently upgraded to FireFox 22. Originally, a legacy XBAP I use always opened correctly in FireFox and had no problems displaying or running. As of 22, it won't even attempt to download the application, let alone try and display it.
    I have the windows Presentation Foundation 3.5.30729.1 installed, which is the same version I have been using in older versions.
    Can anyone shed some light on any changes that would have effected this?

    Hi, I have a similar problem. I did attempt the *.rdf fix on a test system, but it didn't work (em:maxVersion was already 22).
    We got about inflow of phone calls from our clients experiencing the problem mentioned above from the 2nd of July onwards... and more are phoning in.
    All the complaints come from clients (+- 10 so far and rising in number) using Firefox v22 (we have checked), and all of them have said that it was working previously.
    We downgraded one of the clients to an older version of Firefox, and it worked again. So far we are telling our clients to downgrade until a fix comes out, or use Internet Explorer (*blush*)

  • How to hide display details in sap gui and create ad-hoc request in UWL?

    Hi,
    how to hide display "details in sap gui" and "create ad-hoc request" in UWL?
    Please telme the step-by-step procedure to hide "details in sap gui" and "create ad-hoc request".
    Thanks,
    Rashmi

    Hi,
    Thanks for the information. It was very helpfull.
    Can you please tellme where can we fine UWL iView? I tried to find this out in two ways.
    1) Portal Content -> Content Provided by SAP -> End User Content -> Standard Portal Users -> Views -> com.sap.coll.iviews -> Universal Worklist (finally i got this iView). Here i dint find any property called "List of UWL Actions to exclude". In the link which you had given, its written that we can modify the iView and add the name of the actions under the Actions to exclude from the UWL property.
    Which iView do we need to modify and where can i find that property?
    2) I downloaded the xml file and then tried to find this property "List of UWL Actions to exclude" or " Actions to exclude from the UW". But i couldnt find both the properties in xml file.
    Thanks,
    Rashmi

  • I iPad 3 fails to recognize cellular data In a number of locations Displays "searching and No Service" I have narrowed this to device problem. What can I do?

    i iPad 3 fails to recognize cellular data In a number of locations Displays "searching and No Service" I have narrowed this to device problem. What can I do?

    Hello there, OSOSANYA.
    The following Knowledge Base article provides a great checklist of steps and additional recommendations for troubleshooting issues with cellular connection:
    iPhone: Troubleshooting a cellular data connection
    http://support.apple.com/kb/ts3780
    Follow these steps for help troubleshooting cellular data issues on your iPhone. After performing each step, please test to see if the issue is resolved.
    Toggle airplane mode: Tap Settings, turn airplane mode on, wait three seconds, and then turn off again.
    Restart your iPhone.
    Make sure that your software is up to date:
    Check for a Carrier Settings Update: Tap Settings > General > About.
    Check for an iOS Software Update: Tap Settings > General > Software Update.
    Note: Some updates may require a Wi-Fi connection.
    Remove the SIM Card and reinsert it. Allow the iPhone to acquire the network again.
    If your SIM card has SIM PIN enabled, try turning it off: Tap Settings > Phone > SIM PIN.
    Try another location. If a different location works, but the original location still doesn't, contact your carrier to report the issue.
    Reset network settings: Tap Settings > General > Reset > Reset Network Settings.
    Restore the iPhone as new.
    Contact your carrier to:
    Verify that the iPhone is properly set up on the account with the appropriate, current data plan.
    Verify that there are no account-related blocks.
    Find out if there are specific error messages in the carrier logs that could help determine why the issue is occurring.
    If none of the above steps resolves the issue, contact your carrier, make an appointment at an Apple Retail Store, or contact AppleCare to troubleshoot further.
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • Problems with License install, GUI and Transaction SLICENSE

    Hello,
    first of all, I am really new to SAP NetWeaver. I installed SAP NetWeaver (2004s) 7.00 Developer Workplace SP9 SR3 and it works. I want to upgrade my license from 30days to 90days and I requested a new license, which i already received.
    I'm trying to install the license via console with the command:
    saplicense -install file=<filelocation>
    At this Point I'm receiving an error:
    +SAPLICENSE (Release 700) ERROR ***
    ERROR: Connect to database failed
    DETAILS: DbSlConnect failed with return code 99
    SQL-ERROR -4008 (check DB manual for explanation)+
    I read the notes about installing the license via GUI and the transaction SLICENSE. But that is my biggest problem. Since I am really new to NetWeaver, I don't know how to get to the SAP GUI. Do I have to download the GUI? Does it come with the NetWeaver-Package? I am trying to find documentations about it, but I don't get a document that tells me where to find the GUI, how to install and configure.
    I'm hoping someone could help me out of this problem.
    regards,
    RandomStudent

    Hi Kenneth,
    thx for your answer (I rewarded points)!
    Finally I figured out how to install the license via the Visual Administrator. For everyone, who faces the same problem and doesn't know where to find infos, I describe the solution in short.
    I started the Visual Administrator via go.bat - you can find the file at <drive>:\usr\sap\<SID>\JC<Instance>\j2ee\admin (here: D:\usr\sap\J2E\JC00\j2ee\admin). Execute the .bat and login to the Visual Administrator (for more information about logging in search for "Visual Administrator" at: http://help.sap.com)
    When you are logged in and already received a file with the new license key do the following:
    Select:
    Cluster --> <your SID> --> <your Server> --> Services -->Licensing Adapter
    Register "General" shows information about your system, like the hardware key to request a license or the System ID.
    Register "Installed Licenses" shows information about the installed license, like expiration date, etc.
    Installing the License Key
    1. Use the "Install license from file" button to upload the file on register "General"
    2. Select the file with the downloaded license key
    3. Choose Open to continue
    4. Then a popup appears stating that the license has been installed successfully
    5. Restart the J2EE Engine
    Check the license key under the Installed Licenses tab.
    It's easy to do, if you know where to find it.

  • Why display hanging and software problem when upgraded to ios 8

    Why display hanging and software problem when upgraded to ios 8

    Hi Redhazel,
    Thank you for using Apple Support Communities.
    To troubleshoot this issue where you're experiencing a poor image quality with your iPhone's camera, please follow the troubleshooting below.
    Camera isn't functioning or has undesired image quality
    If the screen shows a closed lens or black image, force quit the Camera app.
    If you do not see the Camera app on the Home screen, try searching for it in Spotlight. If the camera does not show up in the search, check to make sure that Restrictions are not turned on by tappingSettings > General > Restrictions.
    Ensure the camera lens is clean and free from any obstructions. Use a microfiber polishing cloth to clean the lens.
    Cases can interfere with the camera and the flash. Try gently cleaning the lens with a clean dry cloth or removing the case if you see image or color-quality issues with photos.
    Try turning iPhone off and then back on.
    Tap to focus the camera on the subject. The image may pulse or briefly go in and out of focus as it adjusts.
    Try to remain steady while focusing:
    Still images: Remain steady while taking the picture. If you move too far in any direction, the camera automatically refocuses to the center.
    Note: If you take a picture with iPhone turned sideways, it is automatically saved in landscape orientation.
    Video: Adjust focus before you begin recording. You can also tap to readjust focus while recording. Exiting the Camera application while recording will stop recording and will save the video to the Camera Roll.
    Note: Video-recording features are not available on original iPhone or iPhone 3G.
    If your iPhone has a front and rear camera, try switching between them to verify if the issue persists on both.
    iPhone: Hardware troubleshooting
    Cheers,
    Alex H.

  • Problems displaying and editing long documents on small pages sizes

    Problems displaying and editing long documents on small page sizes
    I read this problem have called with the helpdesk they didn't know the solution but how can I find the solution:
    In Pages 09, I can't scroll down andand click on text to edit it!! All the mouse will do is draw gray transparentboxes and not place the cursor in the text. Again, like the display problem, itdoesn't happen at the beginning of the doc, but starts showing up around 50 to60 pages in ... I can't select text at the bottom of pages ... at 50 pages, thecursor can be clicked into anyplace on a page. Further and further down, the unselectablearea on any particular page creeps up from the bottom line by line: at 175pages in the unselectable area is 12 lines high; at 360 pages in theunselectable area is 25 lines high. and finally at around 440 pages down, Icannot place the cursor anywhere on any page all the way to the end of thedocument.
    I have Page versie 4.1

    What you get was described here several times.
    As we are end users like you, we can't change the app behavior.
    Under 10.6.8 you have the buttons allowing you to scroll one line up or one line down.
    Under Lion they are no longer available.
    Yvan KOENIG (VALLAURIS, France) jeudi 18 août 2011 17:53:12
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.0
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

  • My imac intel display is frozen.  Both the mouse and my network is working.  Has anyone had problems like this and were you successful at fixing it?

    My imac (Intel) display is frozen.  Both the mouse and the network are working.  I've shut down various times, pulled the cord from the receptacle on the power strip, and restarted several times.  No luck.  Has anyone had problems like this and were you successful at fixing it?  Thanks.  Would appreciate any help.  Paula

    Same problem, but a c.2009 iMac running OS X 10.9.1. Just happened overnight. Presently, I'm able to access my HD via wireless via laptop and copying all non-backed up files to an external drive. So far, Paula is the only other person I've found with this same problem and hers was three years ago! Going to keep searching for an answer.

  • Hi, since my update to OSX Yosemite, I have problems opening DW and AI CS6. A message with update to old Java SE-6 is displayed? How can I solve this problem? Thanks

    Hi,since my update to OSX Yosemite,I have problems opening DW and AI CS6. A message with update to old Java SE-6 is displayed?Thx

    You need to install Java SE 6 to run those programs. There has been quite a bit of discussion here about that. Something at one of these links should get you going...
    Prompted to install Java SE 6 Runtime | Mac OS 10.9
    Dreamweaver and Java SE 6 Runtime problem on MAC Mountain Lion OSX

  • Problem with T400 and External Display....

    I have a new T400 (less than 1 month old) with the shared memory Intel Graphics setup and I cannot get it to work with an external display of any kind.
    I've tried 2 LCD panels (one widescreen, and one 4:3), 2 analog monitors, and a video projector without any luck.  All of the displays I have tried work fine with my older Lenovo R61.
    I've updated to the newest display drivers and tried working with the various settings under Graphics properties in Vista - Single Display (notebook, monitor), Intel Dual Display, Extended Desktop, etc.  The best I got was a cloned image on the larger widescreen LCD panel that appeared for about 1 minute and then stopped.  I recreated this 4 or 5 times, but the image would not stay on the external display.
    Any ideas?
    Thanks,

    go into bios, check your video output option and whether you selected Internal + VGA, i think... i will check for you on my X60s....
    Regards,
    Jin Li
    May this year, be the year of 'DO'!
    I am a volunteer, and not a paid staff of Lenovo or Microsoft

  • Urgent solution to this problem "Attempt to reset display driver and recover from timeout failed"

    Hi wonderful people at HP,
           I would be glad if you can solve this problem in my system. I want this to be urgent enough because I am graduating by March 1st 2011 and I want many things to be completed on my system.
           I have previously purchased warranty with hp for three times for tune out service, software and hardware help but nothing has been materialized, I am sorry to say but I just lost my money.
           My system, from the time of purchase, had the same persistent problem of overheating and also heavy noise, I told this to several people of HP but they never seem to respond properly. In fact my friend had a similiar problem in DELL and they responded promptly and sent him a new computer system. I don't know what to do. It will be ok if my system can function for one more month. I WOULD BE GRATEFUL TO YOU IF YOU CAN SOLVE THIS PROBLEM.
        Regards,
        KBPN

    Re your 116 BSOD...
    "It's not a true crash, in the sense that the Blue Screen was initiated only because the combination of video driver and video hardware was being unresponsive, and not because of any synchronous processing exception".
    Since Vista, the "Timeout Detection and Recovery" (TDR) components of the OS video subsystem have been capable of doing some truly impressive things to try to recover from issues which would have caused earlier OS's like XP to crash.
    As a last resort, the TDR subsystem sends the video driver a "please restart yourself now!" command and waits a few seconds.
    If there's no response, the OS concludes that the video driver/hardware combo has truly collapsed in a heap, and it fires off that stop 0x116 BSOD.
    If playing with video driver versions hasn't helped, make sure the box is not overheating.
     Try removing a side panel and aiming a big mains fan straight at the motherboard and GPU.
     Run it like that for a few hours or days - long enough to ascertain whether cooler temperatures make a difference.
    If so, it might be as simple as dust buildup and subsequently inadequate cooling.
    I would download cpu-z and gpu-z (both free) and keep an eye on the video temps
    For more information please read this blog 
    http://captaindbg.com/bug-check-0x116-video_tdr_error-troubleshooting-tips/
    http://msdn.microsoft.com/en-us/library/windows/hardware/ff557263%28v=vs.85%29.aspx
    Advice offered in good faith. It is your decision to implement same.

Maybe you are looking for

  • How do you move pages around in a combined pdf online.

    how do you move pages around in a combined pdf online

  • Sizes In Adobe Media Encoder...

    I make a PAL movie in Premiere Pro CS3 with clips from my Panasonic GS500 camera. Export to Adobe Media Encoder CS3 and it gives an output frame size (for FLV) of 1024 x 576. I open the same sequence in Premiere Pro CS4 and Export to Adobe Media Enco

  • AVCHD 24P Cinema mode not importing correctly

    Hey, I have posted a few times about this issue, and each time I get a little closer to solving the problem. I am hoping this is the final time. I have a Panasonic AVCHD HDC-SD9 Hi Def video camera. I recorded a comedy show of mine the other night, a

  • Stanza is not working since I updated

    I have Stanza, the book app on my iPhone 3GS, but ever since I updated my iPhone it now comes up with the following error message; Unhandled exception You can try to continue but the application may be unstable. Debug details follow: Signal 11 was ra

  • Authorization issue in BAPI_MATERIAL_SAVEDATA

    Hi Experts, We have a program which uses the BAPI_MATERIAL_SAVEDATA which will update the MINLOTSIZE in the MRP view The BAPI is checking for 2 Authorization objects M_MATE_STA (Authorization to change the MRP View) and M_MATE_MAR (Authorization to c