Can someone help a lonely gal

I have written some of the code, in a pseodu form. Here are the two codes which it is but its not exactly what i need: here is what i need to do
1.     Make your class Demo by inheriting from JFrame
2.     add a main to the demo class
3.     Make the constructor for the frame set the frame size and make the frame visible (or you won�t be able to see it)
4.     Have the main create a instance of the frame (do you see the frame� you should)
5.     Make your DemoPanel by inheriting from JPanel
6.     Add code to the your frame constructor to create the panel and add it to the content pane. (compile and run ~ you won�t see a visible change).
7.     Go to DemoPanel and add the paintComponent method (Compile and run � no visible change)
8.     Add code to paintComponent method like the following g.drawString(�This is Java�, 1, 1);
9.     Compile and run� do you see your text?
10.     Create the bar class (no inheritance) add the instance variables. (Compile it)
11.     Add the constructor and assign the arguments to the instance variables. (Compile it)
12.     Go back to paintComponent and in it create a bar. The bar should be an instance variable NOT local (with the constructor arguments) (compile and run ~ no additional visual result)
13.     Go back to Bar and add the draw method. Make it simple set the foreground color, set the paint color. Compile it.
14.     In the Bar draw method add code to create and draw the rectangle. Compile and run.
15.     In paintComponent get the size of the panel and add code to compute the size of each bar.
16.     Add code to create two more bars (they must be instance variables) and call their paint with the right args (compile and run ~ you should see three bars)
17.     add an Boolean instance variable to indicate whether to draw the fourth bar. Set it to false
18.     Modify you code to create a fourth bar and draw it if this variable is true.
19.     Change the local variable to true to see if you new code works (test it)
20.     Cool!
21.     Add code to the bars draw to draw the message in the right place within the bar.
22.     Add a public mutor to DemoPanel to set the Boolean instance (this will be called from the frame later.
23.     Add code to the frame to detect if the window is minimized. The windowAdapter method windowDeiconified(windowEvent e) will be called. If this method is called call the method that sets the fourth bar indicator and set it to true.
24.     Add the mediaTracker stuff for the image.
25.     Done!
Here is what I have when I was just playing around with it, i am not a CS JUnkie like most of the guys.....
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;
public class RecB extends JFrame{       
DPanel pan = new DPanel();     
public RecB()
{     super();     
setBounds(6,6,320,360);          
setContentPane(pan);     
setVisible(true);}
public class  DPanel extends JPanel  {
public DPanel()
{     setBorder(new MatteBorder(2,2,2,2,Color.black));      setBackground(Color.red);}
public void paintComponent(Graphics g)
{     super.paintComponent(g);     
g.setColor(Color.yellow);     
Dimension size = getSize();     
g.drawRect(20,20,size.width-50,size.height-50);     
for (int x=0; x < 3; x++)     
g.setColor(new Color(x,x,x*80));          
g.fillRect(55+x*size.width/4,40,20,size.height-100);     }}}
public static void main (String[] args) {     new RecB();   }}      
[\code]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

This is how to start, i need more info about the Bar position and size.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class RecBt extends JFrame
       DPanel pan = new DPanel();
public RecBt(int w, int h)
     super();
     addWindowListener(new WindowAdapter()
     {     public void windowClosing(WindowEvent ev)
             {     dispose();
               System.exit(0);
     setBounds(6,6,w,h);     
     setContentPane(pan);
     setVisible(true);
public class DPanel extends JPanel
public DPanel()
     setBackground(Color.red);
public void paintComponent(Graphics g)
     super.paintComponent(g);
     g.setColor(Color.yellow);
     g.drawString("?This is Java?",10,20);
     Bar bar = new Bar(10,40,50,100);
     bar.draw(g);
public class Bar
     int x,y,width,height;
public Bar(int x, int y, int w, int h)
     this.x = x;
     this.y = y;
     width  = w;
     height = h;
public void draw(Graphics g)
     g.setColor(Color.gray);
     g.fillRect(x,y,width,height);
public static void main (String[] args)
     new RecBt(500,350);
[/code[
Noah                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • I can not send email from my iPhone 3g using me dot com. Can someone help?

    I have had my iPhone 3g for 2 weeks now I believe and in this time have received tons of e mails but when I try to reply or send a new e mail I get the message "The connection to the outgoing server "smtp.mac.com" failed."
    I don't see why since my wifi is connected and does everything else, like surf the web, download updates to apps and receive e mail.
    Can someone help me figure this out? I also just purchased an iPod touch which will be using wifi only so I'm scared that it too will have the same problem

    I have a 1st gen iPhone that I just updated the software to 2.0.2
    Now whenever I press the mail icon it goes to the mail app for about 4 seconds, does nothing, no loading of folders, old messages, nothing.
    Then it reverts back to the home screen. Tried restarting, haven't tried restoring, thought I'd look here first.
    Anyone???

  • When I try to send email from my iPad and iphone it says that I have the incorrect username and/or password, but I know they are correct, can someone help me?

    When I try to send email from my iPad and iPhone it says that I have the wrong username and/or password, but I know they are correct.  Can someone help me?

    "Your email account" means to tap on the name of your email account. Whatever it is listed as in the settings.
    In my mail settings, one of my email accounts is a Comcast account. I tap on the Comcast name and it brings up this window.
    Then I tap on the arrow under the Outgoing mail server smtp setting to get to the next window.
    In the resulting window, I then tap on the arrow next to the smtp server under the Primary Server setting.
    That brings up this window in which I check to make sure that my user name and password have been entered correctly. If those items are missing, enter them in the appropriate fields and then tap done.

  • My ipod touch 1st gen has gone into recovery and wont restore because of a error 1 or something like that can someone help me quick this ipod is my little cousins and i dont want her mum to find out what happend

    my ipod touch 1st gen has gone into recovery and wont restore because of a error 1 or something like that can someone help me quick this ipod is my little cousins and i dont want her mum to find out what happend

    I have not seen a solution for error (1)
    make an appointment at the Genius Bar of an Apple store since it appears you have a hardware problem.
    Apple Retail Store - Genius Bar

  • Hello can someone help me I have an iphone 4 and my daughter has an ipod touch we are on the same email address but somehow with in the last 25hrs all of my contacts are gone and only hers on on my phone is there a way for me to get all my contacts back?

    Hello can someone help me I have an iphone 4 and my daughter has an ipod touch we are on the same email address but somehow with in the last 25hrs all of my contacts are gone and only hers on on my phone is there a way for me to get all my contacts back?

    If you need assistance with finding any of your restores or attempting to restore from any that happened prior to his incident follow this article
    http://support.apple.com/kb/ht1766
    IF you do find a backup that has your contacts; I'd /highly/ recommand turning off your wifi network after the restore is finished because if the issue is with your iCloud your contacts may merge back with her's.
    With iCloud you DO NOT want to share the account; bad things happen Evil evil thigns...
    But in all seriousness; if two devices have the same iCloud; iCloud is told to merge and sync infomation between hte two and can't tell that it doesn't belong to the same person

  • Some of my photos in iphoto turn blank (white) when I tried to edit the size like zoon in and out.Can someone help me on this?

    Some of my photos in Iphoto turn blank (white) when I tried to edit the size like zoon in and out.Can someone help me on this?

    As a Test:
    Hold down the option (or alt) key and launch iPhoto. From the resulting menu select 'Create Library'
    Import a few pics into this new, blank library. Is the Problem repeated there?

  • HT5429 direction is not coming in IOS 6 in india. can someone help me for the same?

    direction is not coming in IOS 6 in india. can someone help me for the same? i'm using iphone 4

    Hi Civilclerk1,
    In order to achieve your requirement, we can try to use the following expression to instead the last_name column and first_name field:
    last_name: =iif(Fields! staff_role.Value="Lead Atty" or Fields! staff_role.Value="BK Mgr" or Fields! staff_role.Value="Partner" ,Fields! last_name.Value,nothing)
    first_name: =iif(Fields! staff_role.Value="Lead Atty" or Fields! staff_role.Value="BK Mgr" or Fields! staff_role.Value="Partner" ,Fields! first_name.Value,nothing)
    Besides, if we don’t want see the blank row in the tablix, we can add a filter as below in the tablix:
    Expression:=iif(Fields! staff_role.Value="Lead Atty" or Fields! staff_role.Value="BK Mgr" or Fields! staff_role.Value="Partner" ,1,0)
    Operator:=
    Value:=1
    If there are any misunderstanding, please elaborate the issue for further investigation.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • I have an early 2011 MacBook Pro which has been running slow for a while. After looking at responses to similar problems I have downloaded and run EtreCheck and will post the output. Please can someone help me with what it all means.Thanks in advance

    I have an early 2011 MacBook Pro which has been running slow for a while. After looking at responses to similar problems I have downloaded and run EtreCheck. Please can someone help me with what it all means.
    Thanks in advance.
    EtreCheck version: 1.9.15 (52)
    Report generated 19 September 2014 08:07:14 GMT+8
    Hardware Information: ?
      MacBook Pro (13-inch, Early 2011) (Verified)
      MacBook Pro - model: MacBookPro8,1
      1 2.3 GHz Intel Core i5 CPU: 2 cores
      4 GB RAM
    Video Information: ?
      Intel HD Graphics 3000 - VRAM: 384 MB
      Color LCD 1280 x 800
    System Software: ?
      OS X 10.9.4 (13E28) - Uptime: 0 days 0:4:29
    Disk Information: ?
      Hitachi HTS545032B9A302 disk0 : (320.07 GB)
      S.M.A.R.T. Status: Verified
      EFI (disk0s1) <not mounted>: 209.7 MB
      Macintosh HD (disk0s2) / [Startup]: 319.21 GB (147 GB free)
      Recovery HD (disk0s3) <not mounted>: 650 MB
      MATSHITADVD-R   UJ-898 
    USB Information: ?
      Apple Inc. FaceTime HD Camera (Built-in)
      Apple Inc. BRCM2070 Hub
      Apple Inc. Bluetooth USB Host Controller
      Apple Inc. Apple Internal Keyboard / Trackpad
      Apple Computer, Inc. IR Receiver
    Thunderbolt Information: ?
      Apple Inc. thunderbolt_bus
    Gatekeeper: ?
      Mac App Store and identified developers
    Kernel Extensions: ?
      [not loaded] com.seagate.driver.PowSecDriverCore (5.2.4 - SDK 10.4) Support
      [not loaded] com.seagate.driver.PowSecLeafDriver_10_4 (5.2.4 - SDK 10.4) Support
      [not loaded] com.seagate.driver.PowSecLeafDriver_10_5 (5.2.4 - SDK 10.5) Support
      [not loaded] com.seagate.driver.SeagateDriveIcons (5.2.4 - SDK 10.4) Support
      [loaded] com.sophos.kext.sav (9.1.55 - SDK 10.7) Support
      [loaded] com.sophos.nke.swi (9.1.50 - SDK 10.8) Support
    Launch Daemons: ?
      [loaded] com.adobe.fpsaud.plist Support
      [loaded] com.microsoft.office.licensing.helper.plist Support
      [running] com.sophos.autoupdate.plist Support
      [running] com.sophos.configuration.plist Support
      [running] com.sophos.intercheck.plist Support
      [running] com.sophos.notification.plist Support
      [running] com.sophos.scan.plist Support
      [running] com.sophos.sxld.plist Support
      [running] com.sophos.webd.plist Support
      [running] com.trusteer.rooks.rooksd.plist Support
    Launch Agents: ?
      [loaded] com.divx.dms.agent.plist Support
      [loaded] com.divx.update.agent.plist Support
      [running] com.sophos.uiserver.plist Support
      [running] com.trusteer.rapport.rapportd.plist Support
    User Launch Agents: ?
      [loaded] com.adobe.ARM.[...].plist Support
      [running] com.amazon.music.plist Support
      [loaded] com.google.keystone.agent.plist Support
      [not loaded] jp.co.canon.Inkjet_Extended_Survey_Agent.plist Support
    User Login Items: ?
      iTunesHelper
      TomTomHOMERunner
      AdobeResourceSynchronizer
      Dropbox
    Internet Plug-ins: ?
      FlashPlayer-10.6: Version: 15.0.0.152 - SDK 10.6 Support
      DivX Web Player: Version: 3.2.1.977 - SDK 10.6 Support
      AdobePDFViewerNPAPI: Version: 11.0.09 - SDK 10.6 Support
      AdobePDFViewer: Version: 11.0.09 - SDK 10.6 Support
      Flash Player: Version: 15.0.0.152 - SDK 10.6 Support
      EPPEX Plugin: Version: 10.0 Support
      Default Browser: Version: 537 - SDK 10.9
      OVSHelper: Version: 1.1 Support
      QuickTime Plugin: Version: 7.7.3
      SharePointBrowserPlugin: Version: 14.4.4 - SDK 10.6 Support
      iPhotoPhotocast: Version: 7.0 - SDK 10.7
    Safari Extensions: ?
      Ultimate
    Audio Plug-ins: ?
      BluetoothAudioPlugIn: Version: 1.0 - SDK 10.9
      AirPlay: Version: 2.0 - SDK 10.9
      AppleAVBAudio: Version: 203.2 - SDK 10.9
      iSightAudio: Version: 7.7.3 - SDK 10.9
    iTunes Plug-ins: ?
      Quartz Composer Visualizer: Version: 1.4 - SDK 10.9
    3rd Party Preference Panes: ?
      Flash Player  Support
      Perian  Support
      Trusteer Endpoint Protection  Support
    Time Machine: ?
      Skip System Files: NO
      Auto backup: YES
      Volumes being backed up:
      Macintosh HD: Disk size: 297.29 GB Disk used: 160.38 GB
      Destinations:
      Data [Network] (Last used)
      Total size: 2 TB
      Total number of backups: 99
      Oldest backup: 2012-04-20 17:05:32 +0000
      Last backup: 2014-09-18 23:49:25 +0000
      Size of backup disk: Excellent
      Backup size 2 TB > (Disk size 297.29 GB X 3)
      Time Machine details may not be accurate.
      All volumes being backed up may not be listed.
    Top Processes by CPU: ?
          6% InterCheck
          5% iCalExternalSync
          3% WindowServer
          2% CalendarAgent
          2% SystemUIServer
    Top Processes by Memory: ?
      152 MB SophosScanD
      147 MB InterCheck
      106 MB SophosAntiVirus
      66 MB Dropbox
      57 MB com.apple.iTunesLibraryService
    Virtual Memory Information: ?
      161 MB Free RAM
      1.55 GB Active RAM
      1.41 GB Inactive RAM
      902 MB Wired RAM
      611 MB Page-ins
      0 B Page-outs

    Uninstall Trusteer software
    http://www.trusteer.com/support/uninstalling-rapport-mac-os-x
    Remove Sophos
    https://discussions.apple.com/message/21069437#21069437

  • So I download photoshop cc (2014) and when I go to open the program, it gives me an error message and shuts the program down. It says," A problem cause the program to stop working correctly. Windows will close the program." Can someone help me please?

    So I download photoshop cc (2014) and when I go to open the program, it gives me an error message and shuts the program down. It says," A problem cause the program to stop working correctly. Windows will close the program." Can someone help me please?

    I've got the same issue and it affects all my adobe software.  You are not alone as I have seen several postings looking for the answer to this help request.

  • My itunes wont work and wont let my uninstall and then reinstall the newer version as its asking me too! i keep getting an error message!...please can someone help?

    please can someone help me to unistall itunes from my laptop control panel, this means it also wont let me install the latest version!

    I also have Jolly's problem. I found the iMovie 9.0.9 folder and tried to launch the older version of iMove. It would not launch. I removed all of the iMovie preferences from the Preferences folder, removed iMove 10 from the applications folder, and restarted my Mac. iMove 9.0.9 still won't launch and I can't access my videos created with the older version of iMovie. Is there a way to uninstall iMovie 10 and reinstall iMovie 9.0.9?
    I am running Yosemitie on a  iMac.
    Paul

  • HT1338 I cannot open itunes. When I try, a popup says I need quicktime 7.5.5 but I cannot download it. Can someone help??

    I cannot open itunes. When I try, a popup says I need quicktime 7.5.5 but I cannot download it. Can someone help??

    Quicktime 7.5.5 can be downloaded from this link.
    http://support.apple.com/downloads/#quicktime

  • I cant install or uninstall my itunes. I get this error 'the feature you are trying to use is on a network resource that is unavilable' Now ive seen the solutions on here but im using windows 8.1. Ive tried all options so please can someone help?

    I cant install or uninstall my itunes. I get this error 'the feature you are trying to use is on a network resource that is unavilable' Now ive seen the solutions on here but im using windows 8.1 and none of them work for me. Ive tried all options so please can someone help?

    That doesnt work for me. I removed itunes through the windows cleaner method as shown in other posts and re-installed itunes. Now im getting this error
    iTunes was not installed correctly. Please reinstall iTunes
    Error 7 (Windows error 126)
    Also my Microsoft office has stopped working after i deleted Itunes which is really strange.
    Can somebody provide me a solution please....

  • I am trying to print a PDF file to a legal size paper and I would like for it to fill up the page. How do I do this? I went into the settings and changed it from letter to legal, but it's still printing out the same size. Can someone help me, please?

    I am trying to print a PDF file to a legal size paper and I would like for it to fill up the page. How do I do this? I went into the settings and changed it from letter to legal, but it's still printing out the same size. Can someone help me, please?

    Are you trying to Print to PDF or are you trying to Print a PDF file to a physical printer?

  • HT3702 I'm trying to open an iTunes account and was asked to provide one of each:credit card details or gift card details.i provided a gift card details and yet I'm being asked to contact the support team!!! Pls can someone help me out on this..thanx. Bre

    I'm trying to open an iTunes account and was asked to provide one of each:credit card details or gift card details.i provided a gift card details and yet I'm being asked to contact the support team!!! Pls can someone help me out on this as I cant enjoy my new iPad 3 without buying apps

    Brenda, the easiest way to contact the support team is thru the iTunes Customer Service website:
    http://www.apple.com/support/itunes/contact/

  • TS1717 When I try and start iTunes after trying to intall the 11.4 update on my Windows 7 laptop, it says to reinstall iTunes and "Windows Error Code 193" I tried ave the same failed response. Can someone help?

    When I try and start iTunes after trying to intall the 11.4 update on my Windows 7 laptop, it says to reinstall iTunes and "Windows Error Code 193" I tried ave the same failed response. Can someone help?

    Hi inharmony35,
    If you are having issues with iTunes after an attempted update, you may want to try the steps in the following articles:
    Apple Support: Removing and reinstalling iTunes and other software components for Windows Vista, Windows 7, or Windows 8
    http://support.apple.com/kb/HT1923
    Apple Support: Issues installing iTunes or QuickTime for Windows
    http://support.apple.com/kb/HT1926
    Regards,
    - Brenden

Maybe you are looking for