Help me It's Urgent check my code and solve the puzzle.......

Hi,
Im adding my code below...my problem is when i add text to my panel....whenver it exceeds it's not scrolling try to help me plzzzzzzzzzzz
/*<applet code=ScrollPaneTest.class height=300 width=300>
</applet>*/
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
class NewPanel extends JPanel
     int x=30;
     int y=40;
     NewPanel()
     this.setBackground(Color.white);
     public void draw(String str)
     Graphics g=getGraphics();
     Font font=new Font("TypeWriter", Font.BOLD, 15);
     g.setFont(font);
     g.setColor(Color.red);
     g.drawString(str, x, y);
     y=y+20;
public class ScrollPaneTest extends JApplet implements ActionListener
     JTextField text;
     JButton send;
     NewPanel panel;
     JScrollPane pane;
     Container contentPane;
     JPanel southPanel;
     JTextArea textArea;
     public void init()
          contentPane=getContentPane();
          southPanel=new JPanel();
          textArea=new JTextArea();
          contentPane.setLayout(new BorderLayout());
          text=new JTextField(20);
          send=new JButton("Send");
          panel=new NewPanel();
          pane=new JScrollPane(panel);
          southPanel.setLayout(new FlowLayout());
          southPanel.add(text);
          southPanel.add(send);
          contentPane.add(southPanel, BorderLayout.SOUTH);
          contentPane.add(pane);
          send.addActionListener(this);
     public void actionPerformed(ActionEvent e)
          JButton button=(JButton)e.getSource();
          if(button.getText().equals("Send"))
               String str=text.getText();
               panel.draw(str);
               //textArea.append(str);
               //textArea.append("\n");
It's working for TextArea but it's not working for panel...anyone can help me to solve this
Thanks in Advance!

Use real code tags (see Formatting tips before you post). Have you ever tried to preview your posting?
Why do you want to draw Strings on a JPanel in the first place (as apposed to do what normal people do, that is use some kind of JTextComponent)? Is it because you want a different Border or background color than the JTextArea's defaults?

Similar Messages

  • PO creation-ME21n-Why SAP does not check company code and Plant relation

    Hi All,
    Does someone know, why SAP does not check Plant and company code relation at the time of PO creation or how can we put validation between plant and company code at the time of PO creation.
    <b>Example:</b> Suppose i have a company 0001 which is assinged to Plant 0001. when i am creating a PO with another company code 0002(Entering at header level-Org, data) and using Plant 0001 at line item level. SAP does not do this validation.
    How can we put this check in place?
    Thanks in advance.
    Deepak

    Hello Deepak,
    There are three types of purchasing
    - Company code specific :You need to assign company code to Pur organization
    - Plant specific : You must assign plant to pur organization
    - Cross company purchasing: No assignment between company code and pur organization.
    In the case 3, the system will not check company code and plant relationship, but it will check plant and pur organization specific.
    The following is the copy of sap help text:
    You can assign a purchasing organization to one company code. This is company-specific purchasing.
    You can assign a purchasing organization to no company code. This purchasing organization can then procure for all plants assigned to it, irrespective of the company code to which the plant belongs.
    Since each plant must be assigned to a company code, the company code can be determined via the plant in each procurement transaction, even if the procuring purchasing organization is not assigned to a company code.
    A purchasing organization must be assigned to one or more plants. This is plant-specific purchasing.
    Now, check your company-code and purchase organization assignment.
    Hope this helps.
    Regards
    Arif Mansuri

  • I put in my gift card code and at the top of my home page it says that I have 15 dollars. When I go to purchase it still makes me put in the code and says that it invalid. How do I pay for something when I already put in the code? please help

    I put in my gift card code and at the top of my home page it says that I have 15 dollars. When I go to purchase it still makes me put in the code and says that it invalid. How do I pay for something when I already put in the code? please help

    See Here  >  http://support.apple.com/kb/TS1646
    If no joy...
    Contact iTunes Customer Service
    Apple  Support  iTunes Store  Contact Us

  • Good Morning.  I'm having a problem using both my Photoshop elements and premiere programs.  I've installed the programs, redeemed my code and entered the serial numbers, and created the adobe log-in.  I am able to open up the organizer without problems,

    Good Morning.  I'm having a problem using both my Photoshop elements and premiere programs.  I've installed the programs, redeemed my code and entered the serial numbers, and created the adobe log-in.  I am able to open up the organizer without problems, but when I try to open up the photo editor (either by trying to open up the program from the main menu, or right-clicking on a photo in the organizer to edit in elements), the program asks me to sign in to adobe (which I can do and it doesn't give an an "incorrect password" or log-in ID error) then accept the terms and conditions.  When I click to accept the terms and conditions, nothing happens and the editor fails to open.  Everytime I click on the program, I get this same "loop" of signing in and accepting T&C's, but the program fails to open.  Any advice?

      Premiere Elements 10 is now 64 bit, but not PSE10.
    Take a look at your scratch disk set-up and if you have a spare volume, allocate that first before the C drive. Elements use scratch disks when it gets low on RAM.
    Click image to enlarge
    Turn off face recognition and the auto-analyzer to improve performance.
    When editing photos or videos check the task manager to see what background processes may be running and end them temporarily if not needed.

  • I buy an OSX upgrade; I get a redemption code; and, in the Mac Store App, 'It's not available in the U.S. store-.What the frick? Is this a joke, Apple?

    I buy an OSX upgrade; I get a redemption code; and, in the Mac Store App, 'It's not available in the U.S. store….What the frick? Is this a joke, Apple?

    Hello MTRivers,
    You can contact Apple Support about this problem (United States): 1-800-275-2273.
    They will help you, and provide a solution.
    Cedric

  • I receive an error message whenever I text recently entered contacts. It says the number is invalid. I have tried entering the number with the area code and without the area code.

    I receive an error message whenever I try to send text messages to new contacts. It says the number is invalid and to enter a 10 digit number. I have tried entering the phone number with the area code and without the area code. Any ideas?

    Same problem here. I've deleted the contact and had them text me, but when I try to text them back I get the same invalid number message! So frustrating! Please help!

  • I have a prpblem in enabling webserver i get message labview webserver not running error 54 , i checked IIS Manager and www the services r running ok ..can anybody tell what might be error ,,,iam on labview 6.1 and win 2003 server.,

    i have a problem in enabling webserver i get message labview webserver not running error 54 , i checked IIS Manager and www the services r running ok ..can anybody tell what might be error ,,,iam on labview 6.1 and win 2003 server.,

    If you already have IIS web server running, you need to run the LabVIEW web server on a different port to avoid conflicts. It probably won't start because the port 80 is already in use.
    Check options.."Web Server: Configuration" within LabVIEW.
    LabVIEW Champion . Do more with less code and in less time .

  • I have purchased Adobe Lightroom 5 and put in the redemption code and downloaded the programme but the serial is not accepted. I previously had trail version

    I have purchased Adobe Lightroom 5 and put in the redemption code and downloaded the programme but the serial is not accepted. I previously had trail version

    Jennymatthews please see Redemption Code Help for information on how to redeem your redemption code.

  • Since I installed ios 6.1 in my iPhone 4, I can't sync it with iTunes. Can annyone help me? I have already reinstalled iTunes and reseted the iPhone, but it still doesn't sync. Thank you.

    Since I installed ios 6.1 in my iPhone 4, I can't sync it with iTunes. Can annyone help me? I have already reinstalled iTunes and reseted the iPhone, but it still doesn't sync. Thank you.

    Hello Sean,
    It sounds like you are constantly needing to restore your phone because it keeps going into recovery mode. Usually putting a device into recovery mode and restoring it can help isolate an issue to your iPhone hardware if an issue persists afterwards. I would try manually putting it into recovery mode and restoring it 1 more time:
    If you can't update or restore your iOS device
    http://support.apple.com/kb/HT1808
    If that does not resolve it the symptoms indicate to me that it is a hardware issue causing this to happen and would seek service for it:
    iPhone Repair - Other Repairs
    https://www.apple.com/support/iphone/repair/other/
    Thank you for using Apple Support Communities.
    All the best,
    Sterling

  • TS3899 I can  no longer send photos in an email from my iphone 5. It uploads the photo to the "new message" page - and then it freezes. I can use safari and check my emails, and when the email part is frozen the rest of the phone works fine ! any advice?!

    I can no longer send photos in an email from my iphone 5. It uploads the photo the the "mew message" page and then it freezes! I can use safari and check my emails, and when the email part is frozen I can still use the rest of my phone. Any advice ?!?

    Hi, ireland a. 
    I would recommend closing any open applications in multitasking and restarting the device.  If unfamiliar with multitasking, I have included a screenshot on how to process an application close. 
    iOS: Force an app to close
    Once these steps are processed, attempt to send the photo again. 
    iPhoto for iOS (iPhone): Send photos by email
    http://support.apple.com/kb/PH3271
    Regards,
    Jason H. 

  • When I download an excel spread sheet from a Ford web site I seem to be getting code and not the work sheet. Example- MIME-Version: 1.0 X-Document-Type: Workbook Content-Type: multipart/related; boundary="====Boundary===="

    I have a Macbook Air. I have MS office installed and work in Excel often with no issues. But When I download an excel spread sheet from a Ford web site I seem to be getting code and not the work sheet.
    Example-
    MIME-Version: 1.0
    X-Document-Type: Workbook
    Content-Type: multipart/related; boundary="====Boundary===="
    --====Boundary====
    Content-Location: file:///C:/HOLD.XHT
    Content-Transfer-Encoding: 8bit
    Content-Type: text/html; charset="utf-8"
    <html xmlns:v="urn:schemas-microsoft-com:vml"
    xmlns:o="urn:schemas-microsoft-com:office:office"
    xmlns:x="urn:schemas-microsoft-com:office:excel"
    xmlns="http://www.w3.org/TR/REC-html40">
    <HEAD>
    <meta name="Excel Workbook Frameset">
    <xml>
    <x:ExcelWorkbook>
      <x:ExcelWorksheets>
       <x:ExcelWorksheet>
        <x:Name>BTB</x:Name>
        <x:WorksheetSource HRef="./IBIT0001.xht"/>
       </x:ExcelWorksheet>
       <x:ExcelWorksheet>
        <x:Name>GSM</x:Name>
        <x:WorksheetSource HRef="./IBIT0002.xht"/>
       </x:ExcelWorksheet>
       <x:ExcelWorksheet>
        <x:Name>RODetail</x:Name>
        <x:WorksheetSource HRef="./IBIT0003.xht"/>
       </x:ExcelWorksheet>
      </x:ExcelWorksheets>
    </x:ExcelWorkbook>
    </xml>
    </HEAD>
    </HTML>
    --====Boundary====
    Content-Location: file:///C:/IBIT0001.xht
    Content-Transfer-Encoding: 8bit
    Content-Type: text/html; charset="utf-8"
    <html xmlns:v="urn:schemas-microsoft-com:vml"
    xmlns:o="urn:schemas-microsoft-com:office:office"
    xmlns:x="urn:schemas-microsoft-com:office:excel"
    xmlns="http://www.w3.org/TR/REC-html40">
    <HEAD>
    <meta http-equiv=Content-Type content="text/html; charset=utf-8">
    <style>
    <!--table
            {mso-displayed-decimal-separator:"\.";
            mso-displayed-thousand-separator:"\,";}
    @page
            {margin:1.0in .75in 1.0in .75in;
            mso-header-margin:.5in;
            mso-footer-margin:.5in;
            mso-page-orientation:landscape;}
    tr
            {mso-height-source:auto;}
    col
            {mso-width-source:auto;}
    br
            {mso-data-placement:same-cell;}
    .style21
            {color:blue;
            font-size:10.0pt;
            font-weight:400;
            font-style:normal;
            text-decoration:underline;
            text-underline-style:single;
            font-family:Arial;

    Try search/ask in the forum devoted entirely to Excel issues:
    http://answers.microsoft.com/en-us/mac/forum/macexcel

  • I started to learn HTML, and I'm using text edit and everything is going fine, when I save the file with a .html extension and open it with safari I only view the code and not the webpage that was supposed to be created.

    I started to learn HTML, and I'm using text edit and everything is going fine, when I save the file with a .html extension and open it with safari I only view the code and not the webpage that was supposed to be created.

    That is because you don't have a web server configured and running to serve the html page. In order to see the page in a browser you need to access it using a url similar to http://localhost/~yourUserName if you are serving the page from your user account.
    Prior to Mountain Lion you could go into web sharing and turn on the web server. With Mountain Lion there is no option, other than using terminal, to turn on the web server. The web sharing menu item has been removed in Mountain Lion. Apache is still on your computer but it will take a little searching these forums or the Internet to find how to turn it on.
    If you want a graphic user interface to turn on/off the Apache server you could download and install a server application like xampp, http://www.apachefriends.org/en/xampp.html. I use this and it works well.

  • Why won't my iMac print consistantly to my compatible HP 6500A? I've checked for updates and downloaded the lasted software...still can't print. All my other Mac devices find the printer but the iMac is hit and miss. I'm operating the Mac OS X Lion 10.7.

    Why won't my iMac print consistantly to my compatible HP 6500A? I've checked for updates and downloaded the lasted software...still can't print. All my other Mac devices find the printer but the iMac is hit and miss. I'm operating the Mac OS X Lion 10.7.

    When you say hit and miss do you mean sometimes you print a whole document with no problems, or do you mean each document has problems? This is from HP's website for your printer:
    Your sig says 10.6.7 but your message says 10.7. So if it's really Lion, this printer isn't officially supported. Elsewhere on HP's site it says updated drivers will be available on your Mac via Software Update. Have you run that recently?

  • HT5628 i was installing windows 8 on mac by boot camp and after i put the windows code and choose the partition i formatted the boot camp sector it said windows can not install on this sector because it is gpt

    i was installing windows 8 on mac by boot camp and after i put the windows code and choose the partition i formatted the boot camp sector it said windows can not install on this sector because it is gpt

    Reinstalling Mavericks depends on several factors:
    if you erased your recovery partition
    what OS originally came on your Mac.
    I'll assume you don't have a backup available that you made before your mishap,  because you didn't mention it.
    That's really the take home message here: have a backup!
    If you still have your recovery partition:
    boot into the recovery partition (command R at restart)
    use the recovery partition to reinstall Mavericks. see: OS X: About OS X Recovery
    if you do not still have your recovery partition, then it depends on whether your Mac originally came with installer disks or not.
    If it originally came with installer disks, you would boot from the installer disks, erase your HD, and then reinstall the OS that is on the installer disks, and then upgrade as necessary until you get to Mavericks.
    If your mac did not originally come with installer disks, but you managed to erase your recovery partition, then you can try to boot into internet recovery (option-command-R at restart), and use internet recovery to erase your HD and reinstall the OS that originally came with your computer, and then upgrade to Mavericks if you need to. See: Hands on with Mountain Lion's OS X Recovery and Internet Recovery | Macworld
             (the reference refers to ML but it applies just as well to Mavericks).

  • TS3297 I tried to download with a redemption code and got the message: "your computer isn't authorized"

    I tried to download with a redemption code and got the message: "your computer isn't authorized" -- how do I do that?

    Quit Safari, launch it directly from HD/Applications/ instead; trash the old version 5.1 on your Desktop... it isn't working with the Safari 5.1.1 system frameworks, and wasn't updated due to not being in HD/Applications/

Maybe you are looking for

  • Alphanumeric Document number for Sales order

    Dear Experts, I got a requirement, The sales order number after saving the document the SO document number should be SO ( Alphabetic) 00012074 (Numeric) ie. SO00012074, The numeric portion will come from the number range assigned for that document an

  • IIS Manager 6.0 Wait Operation Time Out on connecting to remote server

    I'm looking to configure SMTP on Server 2012 Core, I've installed the feature and remote management/administration tools and web management console and web management compatability. When I attempt to connect via IIS 6.0 Manager I immediately receive

  • Multiline Error

    Hi All, The following Error Iam getting while Iam Run the Scenario, do some help to run the secnario successfully . Sender Adapter v1014 for Party '', Service 'National_Bank_of_Canada': Configured at 17:52:24 2008-10-14 Last message processing starte

  • PowerPoint 2013 linking to a youtube video

    I am linking to a youtube video from PowerPoint. During the slideshow, I get a warning that the destination of the link may not be safe. I do not want this message to display. How do I turn it off? There was similar thread earlier, but it is for runn

  • Unable to connect to Toad

    Database- oracle 10g Operating System : Win XP Prof Trying to connect to Toad and getting below error... **ORA-12170: TNS Connection timeout** Please help...