I have trouble running this paint program successfully!

The frame with a white panel area shows and then I get this error:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
        at MyGoodPaint.annotateImage(MyGoodPaint.java:38)
        at MyGoodPaint.paintComponent(MyGoodPaint.java:92)
        at javax.swing.JComponent.paint(JComponent.java:1029)
        at javax.swing.JComponent.paintChildren(JComponent.java:862)
        at javax.swing.JComponent.paint(JComponent.java:1038)
        at javax.swing.JComponent.paintChildren(JComponent.java:862)
        at javax.swing.JComponent.paint(JComponent.java:1038)
        at javax.swing.JLayeredPane.paint(JLayeredPane.java:567)
        at javax.swing.JComponent.paintChildren(JComponent.java:862)
        at javax.swing.JComponent.paintToOffscreen(JComponent.java:5131)
        at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1479)
        at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1410)
        at javax.swing.RepaintManager.paint(RepaintManager.java:1224)
        at javax.swing.JComponent.paint(JComponent.java:1015)
        at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:21)
        at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:60)
        at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:97)
        at java.awt.Container.paint(Container.java:1780)
        at java.awt.Window.paint(Window.java:3375)
        at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:796)
        at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:713)
        at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:693)
        at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:125)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
        at MyGoodPaint.annotateImage(MyGoodPaint.java:38)
        at MyGoodPaint.paintComponent(MyGoodPaint.java:92)
        at javax.swing.JComponent.paint(JComponent.java:1029)
        at javax.swing.JComponent.paintChildren(JComponent.java:862)
        at javax.swing.JComponent.paint(JComponent.java:1038)
        at javax.swing.JComponent.paintChildren(JComponent.java:862)
        at javax.swing.JComponent.paint(JComponent.java:1038)
        at javax.swing.JLayeredPane.paint(JLayeredPane.java:567)
        at javax.swing.JComponent.paintChildren(JComponent.java:862)
        at javax.swing.JComponent.paintToOffscreen(JComponent.java:5131)
        at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1479)
        at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1410)
        at javax.swing.RepaintManager.paint(RepaintManager.java:1224)
        at javax.swing.JComponent.paint(JComponent.java:1015)
        at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:21)
        at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:60)
        at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:97)
        at java.awt.Container.paint(Container.java:1780)
        at java.awt.Window.paint(Window.java:3375)
        at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:796)
        at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:713)
        at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:693)
        at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:125)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)Here is the code:
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.image.BufferedImage;
import java.io.File;
import javax.imageio.ImageIO;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class MyGoodPaint extends JPanel
    int width = 400;
    int height = 400;
    BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
    Graphics2D g2;
    int previousX;
    int previousY;
    int currentX;
    int currentY;
    public MyGoodPaint()
        JFrame frame = new JFrame();
        frame.add(this);
        frame.setSize(width,height);
        frame.setLocationRelativeTo(null);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setVisible(true);
    public void annotateImage()
        g2.drawLine(previousX, previousY, currentX, currentY);
    private class MyMouseMotionListener implements MouseListener, MouseMotionListener
        public void mouseClicked(MouseEvent e)
        public void mousePressed(MouseEvent e)
        public void mouseReleased(MouseEvent event)
            try
                ImageIO.write(image, "png", new File("C:\\Users\\Deniz\\Desktop\\newberry.png"));
            catch(Exception exception)
                System.out.println("The exception caught is: " + exception);
        public void mouseEntered(MouseEvent e)
        public void mouseExited(MouseEvent e)
        public void mouseDragged(MouseEvent e)
            currentX = e.getX();
            currentY = e.getY();
            repaint();
        public void mouseMoved(MouseEvent e)
    protected void paintComponent(Graphics g)
        super.paintComponent(g);
        g.drawLine(previousX, previousY, currentX, currentY);
        annotateImage();
        previousX = currentX;
        previousY = currentY;
    public static void main(String[] args)
        new MyGoodPaint();
}I am more interested in just getting it to work but please do also tell me of any bad practices I am doing and what the better way is at least briefly.
Any help in solving this problem would be greatly appreciated!
Thanks in advance!

Ok, I got it under control now.
Here is the latest code (I know I have things to fix but the stuff I needed help with have been dealt with):
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.image.BufferedImage;
import java.io.File;
import javax.imageio.ImageIO;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class MyGoodPaint extends JPanel
    int width = 400;
    int height = 400;
    BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
    Graphics2D g2 = image.createGraphics();
    int previousX;
    int previousY;
    int currentX;
    int currentY;
    public MyGoodPaint()
        JFrame frame = new JFrame();
        frame.add(this);
        frame.setSize(width,height);
        frame.setLocationRelativeTo(null);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setVisible(true);
        MyMouseListener myMouseListener = new MyMouseListener();
        this.addMouseListener(myMouseListener);
        this.addMouseMotionListener(myMouseListener);
    public void annotateImage()
        g2.drawLine(previousX, previousY, currentX, currentY);
    private class MyMouseListener implements MouseListener, MouseMotionListener
        public void mouseClicked(MouseEvent e)
        public void mousePressed(MouseEvent e)
        public void mouseReleased(MouseEvent event)
            try
                ImageIO.write(image, "png", new File("C:\\Users\\Deniz\\Desktop\\newberry.png"));
            catch(Exception exception)
                System.out.println("The exception caught is: " + exception);
        public void mouseEntered(MouseEvent e)
        public void mouseExited(MouseEvent e)
        public void mouseDragged(MouseEvent e)
            currentX = e.getX();
            currentY = e.getY();
            repaint();
        public void mouseMoved(MouseEvent e)
    protected void paintComponent(Graphics g)
        super.paintComponent(g);
        g.drawLine(previousX, previousY, currentX, currentY);
        annotateImage();
        previousX = currentX;
        previousY = currentY;
    public static void main(String[] args)
        new MyGoodPaint();
}Edit:
Darryl Burke: I forgot to say thank you :).
Edited by: s3a on May 29, 2011 1:10 PM

Similar Messages

  • Installing Firefox (latest) deletes Thunderbird (latest) on my Win7 64 system. Have been running this combination for years without problems, until now.

    When Firefox bombs Thunderbird, I re-install Thunderbird and it bombs Firefox. When I say "bombs" I mean that the Thunderbird quicklaunch icon turns into a generic icon and Thunderbird will not run. The same thing happens when I have Firefox running and I install Thunderbird. I ran a malware scan using Malwarebytes and Norton and my system is clean. I am able to run both Chrome and IE 10 without issue. I'm stumped and would be grateful for your suggestions. I'm running a dual boot Win 7 and 8 system without issue except for this. I have not tried this on the Windows 8 partition, as i use Windows 7 almost exclusively. The only other thing I can think of is that this is a relatively new computer build and I used MozBackup to transfer my e-mail files and contacts from my old computer to Thunderbird and Firefox to the new build. Not sure if that could be the cause of the problem I'm experiencing.
    Thanks,
    Rich

    Thanks for your reply edmeister. I am not installing both to the default location (C drive), which is the relatively small SSD drive on which I've installed Windows 7 and 8. I'm custom installing to E drive, which holds all my programs and music. I've not done anything special with the dual boot; the windows boot loader detected both operating systems and created a boot menu at startup. I'm not sure if I'm sharing the Firefox and Thunderbird profiles with both partitions. All I know is to get a single program to work on both partitions (operating systems) I have to install it twice, once in each operating system, on my E drive. I guess this registers the program with each operating system, but it installs only one copy of Firefox, for example, as best I can tell. So maybe I am sharing something between both partitions. Don't know how else to do it. Even though installing the portable version of Firefox per cyborg's suggestion works, I'm interested in getting the regular version of Firefox working.

  • Strange prob... to get correct o/p we have to run this prog twice ?????????

    hi,
    my problem is that i have created one bat file and i want to run that file in java but it is not running properly. the problem is .......
    i have created one bat file named "file1.bat" & content of this file is as follows :-
    [ ag > b.txt]
    (and content of file "ag" is "aaaaaaa" )
    now i am trying to run this bat file in java and want to read this b.txt in which i have redirected the content of file "ag".
    for that i have written the code like this:-file name is "runbf.java"
    import java.awt.*;
    import java.lang.Runtime;
    import java.io.*;
    public class DriveVol
    public static void main(String args[]) throws IOException
    int volumn;
    Runtime r = Runtime.getRuntime();
    r.exec("ss.bat");
    FileInputStream fp;
    fp = new FileInputStream("b.txt");
    flush();
    do
    volumn = fp.read();
    System.out.print((char)volumn);
    }while(volumn != -1);
    fp.close();
    when i am running this programme first it is not displaying the content of b.txt. but when u run this prog twice then only it 'll give the correct ans. what i mean is, i'll explain that stepwise.
    1. as per my prog. -- r.exec("aa.bat") -- this line 'll execute first. so content of ag 'll redirect to file "b.txt"
    2. now i am trying to read the file "b.txt" using FIleInputStream...
    3. but first time it is giving some garbbage value.when i give --c:jdk1.3\bin>java runbf
    4. but the very next moment when again i run that file - c:jdk1.3\bin>java runbf
    it 'll give the correct value.
    5. again when i change the content of file ag(suppose "bbbbbbb"). & try to run "runbf.java" like this-
    -- c:jdk1.3\bin>java runbf --
    6. then it 'll display the value "aaaaaa". now when again i run that file
    it 'll give the correct value "bbbbbb"
    7. so every time i have to run that "runbf.java" twice for printing the correct
    value of file "b.txt"
    so what i think is that, it is not refreshing the data of file "b.txt". after executing this line
    r.exec("aa.bat");
    so is there any method to refresh the data of file "b.txt"??????
    i think u 'll try to understand my problem...
    so please help me to get the ans.......
    thx.........

    Cuz r.exec is asynchronous, dummy. Read the friggin API. It starts a background process. If you wanna wait for it to finish, then call
    Process p = r.exec(...);
    p.waitFor(whatever).

  • Plugin-container.exe is EATING cpu clock cycles and slowing down my computer big-time. Is there a fix to prevent this, or do I just have to disable this subsidiary program and take the consequences?

    Whenever I have an audiovisual display running in a Firefox (5.0) tab, the program "plugin-container.exe" swamps my CPU, jumping up to 95% of processing clock cycles. This makes all online video displays hang and jump, and it's a pain in the neck. Is there any way to mitigate this?

    That's supposed to indicate it's your plug-ins like Flash that is the problem.
    You might try changing hardware acceleration, a setting within Flash either turn if off or on.

  • How can I run this java program? Please help.

    I have jmf installed, sunone running , the file may be in the wrong directory.
    It is in some directory nowhere near the java lang dir.
    When I try to compile or build i cant. I'm off on a basic thing.
    here is the code.
    import     javax.sound.midi.InvalidMidiDataException;
    import     javax.sound.midi.MidiDevice;
    import     javax.sound.midi.MidiSystem;
    import     javax.sound.midi.MidiUnavailableException;
    import     javax.sound.midi.Receiver;
    import     javax.sound.midi.MidiMessage;
    import     javax.sound.midi.ShortMessage;
    import     javax.sound.midi.SysexMessage;
    public class MidiNote
         /**     Flag for debugging messages.
              If true, some messages are dumped to the console
              during operation.
         private static boolean          DEBUG = false;
         public static void main(String[] args)
              try {
                   // TODO: make settable via command line
                   int     nChannel = 0;
                   int     nKey = 0;     // MIDI key number
                   int     nVelocity = 0;
                   *     Time between note on and note off event in
                   *     milliseconds. Note that on most systems, the
                   *     best resolution you can expect are 10 ms.
                   int     nDuration = 0;
                   int     nArgumentIndexOffset = 0;
                   String     strDeviceName = null;
                   if (args.length == 4)
                        strDeviceName = args[0];
                        nArgumentIndexOffset = 1;
                   else if (args.length == 3)
                        nArgumentIndexOffset = 0;
                   else
                        printUsageAndExit();
                   nKey = Integer.parseInt(args[0 + nArgumentIndexOffset]);
                   nKey = Math.min(127, Math.max(0, nKey));
                   nVelocity = Integer.parseInt(args[1 + nArgumentIndexOffset]);
                   nVelocity = Math.min(127, Math.max(0, nVelocity));
                   nDuration = Integer.parseInt(args[2 + nArgumentIndexOffset]);
                   nDuration = Math.max(0, nDuration);
                   MidiDevice     outputDevice = null;
                   Receiver     receiver = null;
                   if (strDeviceName != null)
                        MidiDevice.Info     info = getMidiDeviceInfo(strDeviceName, true);
                        if (info == null)
                             out("no device info found for name " + strDeviceName);
                             System.exit(1);
                        try
                             outputDevice = MidiSystem.getMidiDevice(info);
                             outputDevice.open();
                        catch (MidiUnavailableException e)
                             if (DEBUG) { out(e); }
                        if (outputDevice == null)
                             out("wasn't able to retrieve MidiDevice");
                             System.exit(1);
                        try
                             receiver = outputDevice.getReceiver();
                        catch (MidiUnavailableException e)
                             if (DEBUG) { out(e); }
                   else
                        /*     We retrieve a Receiver for the default
                             MidiDevice.
                        try
                             receiver = MidiSystem.getReceiver();
                        catch (MidiUnavailableException e)
                             if (DEBUG) { out(e); }
                   if (receiver == null)
                        out("wasn't able to retrieve Receiver");
                        System.exit(1);
                   /*     Here, we prepare the MIDI messages to send.
                        Obviously, one is for turning the key on and
                        one for turning it off.
                   MidiMessage     onMessage = null;
                   MidiMessage     offMessage = null;
                   try
                        onMessage = new ShortMessage();
                        offMessage = new ShortMessage();
                        ((ShortMessage) onMessage).setMessage(ShortMessage.NOTE_ON, nChannel, nKey, nVelocity);
                        ((ShortMessage) offMessage).setMessage(ShortMessage.NOTE_OFF, nChannel, nKey);
                        /* test for SysEx messages */
                        //byte[] data = { (byte) 0xF0, (byte) 0xF7, (byte) 0x99, 0x40, 0x7F, 0x40, 0x00 };
                        //onMessage = new SysexMessage();
                        //offMessage = new SysexMessage();
                        //onMessage.setMessage(data, data.length);
                        //offMessage = (SysexMessage) onMessage.clone();
                   catch (InvalidMidiDataException e)
                        if (DEBUG) { out(e); }
                   *     Turn the note on
                   receiver.send(onMessage, -1);
                   *     Wait for the specified amount of time
                   *     (the duration of the note).
                   try
                        Thread.sleep(nDuration);
                   catch (InterruptedException e)
                        if (DEBUG) { out(e); }
                   *     Turn the note off.
                   receiver.send(offMessage, -1);
                   *     Clean up.
                   receiver.close();
                   if (outputDevice != null)
                        outputDevice.close();
              } catch (Throwable t) {
                   out(t);
              System.exit(0);
         private static void printUsageAndExit()
              out("MidiNote: usage:");
              out(" java MidiNote [<device name>] <note number> <velocity> <duration>");
              out(" <device name>\toutput to named device");
              out(" -D\tenables debugging output");
              System.exit(1);
         private static void listDevicesAndExit(boolean forInput, boolean forOutput) {
              if (forInput && !forOutput) {
                   out("Available MIDI IN Devices:");
              else if (!forInput && forOutput) {
                   out("Available MIDI OUT Devices:");
              } else {
                   out("Available MIDI Devices:");
              MidiDevice.Info[]     aInfos = MidiSystem.getMidiDeviceInfo();
              for (int i = 0; i < aInfos.length; i++) {
                   try {
                        MidiDevice     device = MidiSystem.getMidiDevice(aInfos);
                        boolean          bAllowsInput = (device.getMaxTransmitters() != 0);
                        boolean          bAllowsOutput = (device.getMaxReceivers() != 0);
                        if ((bAllowsInput && forInput) || (bAllowsOutput && forOutput)) {
                             out(""+i+" "
                                  +(bAllowsInput?"IN ":" ")
                                  +(bAllowsOutput?"OUT ":" ")
                                  +aInfos[i].getName()+", "
                                  +aInfos[i].getVendor()+", "
                                  +aInfos[i].getVersion()+", "
                                  +aInfos[i].getDescription());
                   catch (MidiUnavailableException e) {
                        // device is obviously not available...
              if (aInfos.length == 0) {
                   out("[No devices available]");
              System.exit(0);
    e
         *     This method tries to return a MidiDevice.Info whose name
         *     matches the passed name. If no matching MidiDevice.Info is
         *     found, null is returned.
         *     If forOutput is true, then only output devices are searched,
         *     otherwise only input devices.
         private static MidiDevice.Info getMidiDeviceInfo(String strDeviceName, boolean forOutput) {
              MidiDevice.Info[]     aInfos = MidiSystem.getMidiDeviceInfo();
              for (int i = 0; i < aInfos.length; i++) {
                   if (aInfos[i].getName().equals(strDeviceName)) {
                        try {
                             MidiDevice device = MidiSystem.getMidiDevice(aInfos[i]);
                             boolean     bAllowsInput = (device.getMaxTransmitters() != 0);
                             boolean     bAllowsOutput = (device.getMaxReceivers() != 0);
                             if ((bAllowsOutput && forOutput) || (bAllowsInput && !forOutput)) {
                                  return aInfos[i];
                        } catch (MidiUnavailableException mue) {}
              return null;
         private static void out(String strMessage)
              System.out.println(strMessage);
         private static void out(Throwable t)
              t.printStackTrace();

    Please post your code using code tags.
    When I try to compile or build i cant.What is your question? Exactly what error message do you get?

  • I have trouble running flash player on both IE and firefox

    Whenever Adobe realeses a new version of Adobe Flash Player I have difficulties. I wonder why they keep releasing new versions!
    I can have adobe flash player installed and working on either Firefox or IE. If one of them has it installed when I try downloading and installing it on the other browser I get the message that either I have a newer version already installed or that it's the old version although I uninstall before reinstalling!
    Please help me!

    I don't know why you are having these problems.  Try
    download the uninstaller from http://helpx.adobe.com/flash-player/kb/uninstall-flash-player-windows.html and save it to disk;
    download the offline installers from http://helpx.adobe.com/content/help/en/flash-player/kb/installation-problems-flash-player- windows.html#main-pars_header and save them to disk;
    close all browser windows, then run the downloaded uninstaller, followed by the installers.

  • Is version 7 available anywhere for download? I am trying to install the Selenium IDE but get an error that it is not compatible with Firefox 8. Others in my team have been running this IDE with Firefox 7.

    None.

    Many Thanks, Kurt.
    I knew I'd seen the solution you've provided somewhere - either in MacWorld or MacFormat - but couldn't remember the Gatekeeper bit!
    I shall save it somewhere VERY safe now in case this happens again …
    You have made an old man very happy and saved me from worrying that senile decay had suddenly set in. (I was 70 last week so you might understand the situation from that.)
    Best wishes
    OllyanDinah

  • Anyone have trouble seeing this month's bill?

    have my email saying the bill can be viewed and paid but the link isn't working and I can't see the July bill or know what day it is due.  Chat has been busy all day and can't even click it.  I know this is a result of my leaving verizon and having a buy out of the contract, but I would like a detail of the bill before I pay it.

    If this is your last bill after porting your number to another carrier therefore canceling your account, you will have to wait for the paper copy to be mailed to you.
    You can also try customer service over the phone to learn what your final balance is and pay it.
    Also if the billing cycle ends on the 27th, I wouldn't have expected that the bill would be ready for four days. Honestly you should know exactly when the billing cycle ends. It is the same date every month. For example my billing cycle ends on the 16th and has for over two years. The email notifying me the bill is ready comes either four or five days after the 16th.
    Message was edited by: Ann154

  • On my CC Photography pla, my Lightroom is not active and requires an activation key. Why should I have trouble with this when it is part of the plan. I have already lost 4 days of use on this package because of the inactive Lightroom  portion. I need to g

    Can anyone help with CC photography plan activation, when tBridge and photoshop are active and Lightroom requires a key . I have even applied the key to no avail.

    Have you downloaded the perpetually licensed version of Lightroom or via the Cloud?

  • Does this program have problems running under Parallels / XP ?

    I have no problem running this same program under Windows 7, but just tried running it under Parallels/Windows XP. I imported a Photoshop file and I get the "file not found" images for my layers and then when I try to run it for the heck of it, I get an error. This is what it all looks like:
    http://www.frchriskeough.com/images/error.png
    Argh!
    -Dawn

    First if you don't have Windows on your machine UnInstall the Virus Software, you don't need it.
    You really didn't need to reinstall the OS the problem is with the Software, Word, and Chrome.
    After you downloaded Mavericks the software didn't work because the developers of both Word, and Chrome have not updated there software to be compatible with the new Operating System. You will need to keep checking with both of there web sites and there support or downloads to see when they will offer a fix for there software. It is not the fault of Mavericks it is the Software.

  • How do I set page zoom? Page is to small, have trouble reading.....I never had this problem with internet explorer, there was a zoom bar at the bottom of the page.

    How do I change the zoom or text size, I have trouble reading this size.

    '''jeffmc''': First, you are using a version of Firefox that has been superceded/superseded and is no longer supported. The current version of Firefox if 6.0.2; you are using version 5.0. Consider upgrading.
    *See --> https://support.mozilla.com/en-US/kb/Updating+Firefox?bl=n&s=update%20automatically
    If you are using the Firefox button instead of the Menu Bar, you will not see "View" at the top of the browser window or on the Firefox button menu.
    *You can temporarily display the Menu Bar by pressing the ALT key or the F10 key and make the selection from the temporarily displayed Menu Bar; View > Zoom
    *You can instead, use ALT+V+Z to get to the Zoom settings
    *You can use CTRL++ to zoom in, CTRL+- to zoom out, CTRL+0 (<--that is a zero) to reset the zoom to 100%
    *See --> [http://support.mozilla.com/en-US/kb/Page+Zoom Page Zoom] '''''and''''' [http://support.mozilla.com/en-US/kb/Text+Zoom Text Zoom]
    Add-ons:
    *'''''Default FullZoom Level''''': https://addons.mozilla.org/en-US/firefox/addon/default-fullzoom-level/
    *'''''NoSquint''''': https://addons.mozilla.org/en-US/firefox/addon/nosquint/
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''
    Not related to your question, but...
    You may need to update some plug-ins. Check your plug-ins and update as necessary:
    *Plug-in check: https://www-trunk.stage.mozilla.com/en-US/plugincheck/
    *Adobe Shockwave for Director Netscape plug-in: [https://support.mozilla.com/en-US/kb/Using%20the%20Shockwave%20plugin%20with%20Firefox#w_installing-shockwave Installing ('''''or Updating''''') the Shockwave plugin with Firefox]
    *Adobe PDF Plug-In For Firefox and Netscape: [https://support.mozilla.com/en-US/kb/Using%20the%20Adobe%20Reader%20plugin%20with%20Firefox#w_installing-and-updating-adobe-reader Installing/Updating Adobe Reader in Firefox]
    *Shockwave Flash (Adobe Flash or Flash): [https://support.mozilla.com/en-US/kb/Managing%20the%20Flash%20plugin#w_updating-flash Updating Flash in Firefox]
    *Next Generation Java Plug-in for Mozilla browsers: [https://support.mozilla.com/en-US/kb/Using%20the%20Java%20plugin%20with%20Firefox#w_installing-or-updating-java Installing or Updating Java in Firefox]

  • Error while running a Servlet program in Eclipse IDE

    Hi,
    I have tried running the following program in the Eclipse Editor. It doesnt compile. I have installed the Tomcat plugin too.
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    public class HTTPGetServlet extends HttpServlet {
         public void doGet(HttpServletRequest request,
                   HttpServletResponse response)
         throws ServletException, IOException
              PrintWriter output;
              response.setContentTe("text/html");
              output=response.getWriter();
              StringBufer buf=new StringBuffer();
              buf.append("<HTML><HEAD><TITLE>\n");
              buf.append("A simple servlet example\n");
              buf.append("</TITLE></HEAD><BODY>");
              buf.append("<H1>Welcome to the world</H1>\n");
              buf.append("</BODY></HTML>");
              out.println(buf.toString());
              output.close();
    On a closer look i realized that the IDE is showing as error any import statements i type in. Can anyone help me get over this problem? Thanks a lot in advance.
    bye
    V

    You need to add the JAR containing the servlet API in the external JARs for the project.
    Regards,
    Carol.

  • How to change text in spool that have been written on report program?

    Hi all,
    I have a problem to write total page no. to spool.
    The user want to run report both in foreground and background.
    I write total page no. as below.
    DO L_TOTALPAGES TIMES.
    READ LINE 3 OF PAGE SY-INDEX.
    REPLACE '###' IN SY-LISEL WITH L_TOTALPAGES.
    MODIFY LINE 3 OF PAGE SY-INDEX.
    ENDDO.
    it work well in foreground but only final page is ok in background.
    why? how to resolve it?
    thanks first.

    Hi Tihua
    I hav faced the same problem.
    The only way to solve this is you have to run this write statement before sending to spool inside the program. for that you hav to export the internal table values to another program which is called by using submit statement. write all the write statement as if it is in your current progrm.
    After executing the whole loop you can import the no of pages to your current repot. and write leave progam at the end.
    after that you can use that value in your report.

  • Running a java program with eclipse

    Hi,
    I'm trying to run this java program(below) in eclipse..when i go to the 'run' icon inorder to choose the option 'run as' then 'java application' , i have 'none applicable' as the only option available. is it possibly because the program uses threads?
    could someone using eclipse please try to execute this program and let me know if you succeed and how exactly you do it.
    package reseaux;
    import java.io.*;
    import java.net.*;
    import java.util.*;
         public class LeServeur extends Thread{
         Socket socket;
         BufferedReader in;
         PrintWriter out;
         Vector FlowList=new Vector(10);
         public LeServeur(Socket socket)throws IOException{
              this.socket=socket;
              in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
              out= new PrintWriter(new OutputStreamWriter(socket.getOutputStream()));
         public void run(){
              String s;
              synchronized(FlowList){
                   FlowList.addElement(this);
              try{
                   while(!(s = in.readLine()).equalsIgnoreCase("/quit")){
                        for(int i=0;i<FlowList.size();i++){
                             synchronized(FlowList){
                                  LeServeur monServeur=(LeServeur)FlowList.elementAt(i);
                                  monServeur.out.println(s + "\r");
                                  monServeur.out.flush();
              catch(IOException e){
                   e.printStackTrace();
         finally {
         try {
              in.close();
              out.close();
              socket.close();
         } catch(IOException ioe) {
         } finally {
              synchronized(FlowList) {
              FlowList.removeElement(this);
    thanks

    thanks...
    Infact, i wanted to run the main program called 'Serveur' but it uses 'LeServeur'( the code i sent before') and apparently it gives me an error msg that it doesnot recognise the 'LeServeur'...that's why i was thinking that i should probably first compile the 'LeServeur' so that it can be recognised in the 'Serveur' program.
    here is the 'Serveur' code that uses an instantiation of the LeServeur...
    package reseaux;
    import java.net.*;
    import java.io.*;
    public class Serveur {
              public int port;
              public ServerSocket skt;
              public Socket socket;
         public static void main(String[] args) {
              int port=8975;
              ServerSocket skt=null;
              Socket socket=null;
              try{
                   if(args.length>0)
                        port=Integer.parseInt(args[0]);
              catch(NumberFormatException n){
                   System.out.println("This port is used uniquely for listening");
                   System.exit(0);
              try{
                   skt= new ServerSocket(port);
              while (true){
                   socket =skt.accept();
                   LeServeur flow=new LeServeur();
                   flow.start();
         catch(IOException e){
              e.printStackTrace();
         finally{
              try{
                   skt.close();
              catch(IOException e){
                   e.printStackTrace();
    do you know have any idea why it doesnt recognise the 'LeServeur'?
    ps:they're in the same package
    thanks

  • What are the mistake in this JSP program?

    Hi,all. I am a newcomer to learn JSP, and I sincerely hope somebody help me. the following is a JSP program, and I want it extract data from my database and show them on webpage as XML. But there always have some mistakes I cann't found it. Could somebody help me find out them and tell me how to correct. Thanks veeeeeeeeeeeery much!
    <%@ page contentType = "text/xml" %>
    <%@ page language="java" %>
    <%@ page import = "java.sql.* " %>
    <%@ page import = "java.io.* " %>
    <%@ page import = "javax.xml.parsers.DocumentBuilder" %>
    <%@ page import = "javax.xml.parsers.DocumentBuilderFactory" %>
    <%@ page import = "org.w3c.dom.Document" %>
    <%@ page import = "org.w3c.dom.Element" %>
    <%@ page import = "org.w3c.dom.Node" %>
    <%@ page import = "org.w3c.dom.NodeList" %>
    <%@ page extends = "Object"%>
    <html>
    <head><title>Searching Page</title></head>
    <body>
    <p><INPUT size=22 name=T1></p>
    <p><INPUT type=submit value=OK name=B3></p>
    <% Document retailerDoc = null;
    Document dataDoc = null;
    Document newDoc = null;
         try {
         DocumentBuilderFactory dbfactory = DocumentBuilderFactory.newInstance();
         DocumentBuilder docbuilder = dbfactory.newDocumentBuilder();
         retailerDoc = docbuilder.parse("RetailerXmlExtract.xml");
                   //Instantiate a new Document object
                   dataDoc = docbuilder.newDocument();
                   //Instantiate the new Document
                   newDoc = docbuilder.newDocument();
              }catch(Exception e){}
              //Retrieve the root element
              Element retailerRoot = retailerDoc.getDocumentElement();
              //Retrieve the (only) data element and cast it to Element
              Node dataNode = retailerRoot.getElementsByTagName("data").item(0);
              Element dataElement = (Element)dataNode;
              String driverName = "sun.jdbc.odbc.JdbcOdbcDriver";
              String connectURL = "jdbc:odbc:Retailer";
              Connection db = null;
              try{
                   Class.forName(driverName);
                   db = DriverManager.getConnection(connectURL);
                   catch(ClassNotFoundException e){}
                   catch(SQLException e){}
              //Create the PreparedStatement
              PreparedStatement statement = null;
              //Create the Resultset object, which ultimately holds the data retrieved
              ResultSet resultset = null;
              //Create the ResultSetMetaData object, which will holds
              //information about the ResultSet
              ResultSetMetaData resultmetadata = null;
              //Create a new element called "data"
              Element dataRoot = dataDoc.createElement("data");
              try{
                   statement = db.prepareStatement("SELECT * FROM Orders");
                   //Execute the query to populate the ResultSet
                   resultset = statement.executeQuery();
                   //Get the ResultSet information
                   resultmetadata = resultset.getMetaData();
                   //Determine the number of columns in the ResultSet
                   int numCols = resultmetadata.getColumnCount();
                   //Check for data by moving the cursor to the first record(if there is one)
                   while(resultset.next()){
                        //For each row of data, create a new element called "row"
                        Element rowEl = dataDoc.createElement("row");
                        for(int i = 1; i <= numCols; i++){
                             //For each colum index, determine the column name
                             String colName = resultmetadata.getColumnName(i);
                             //Get the column value
                             String colVal = resultset.getString(i);
                             //Determine if the last column accessed was null
                             if(resultset.wasNull()){
                                  colVal = "and up";
                             //Create a new element with the same name as the column
                             Element dataEl = dataDoc.createElement(colName);
                             //Add the data to the new element
                             dataEl.appendChild(dataDoc.createTextNode(colVal));
                             //Add the new element to the row
                             rowEl.appendChild(dataEl);
                        //Add the row to the root element
                        dataRoot.appendChild(rowEl);
              catch(SQLException e){}
              finally{
                        try{
                             db.close();
                             }catch(SQLException e){}
              //Add the root element to the document
              dataDoc.appendChild(dataRoot);
              //Retrieve the root element (also called "root")
              Element newRootInfo = (Element)retailerRoot.getElementsByTagName("root").item(0);
              //Retrieve the root and row information
              String newRootName = newRootInfo.getAttribute("name");
              String newRowName = newRootInfo.getAttribute("rowName");
              //Retrive information on element to be built in the new document
              NodeList newNodesRetailer = retailerRoot.getElementsByTagName("element");
              //Create the final root element with the name from the file
              Element newRootElement = newDoc.createElement(newRootName);
              //Retrieve all rows in the old document
              NodeList oldRows = dataRoot.getElementsByTagName("row");
              for(int i=0;i<oldRows.getLength();i++){
                   //Retrieve each row in turn
                   Element thisRow = (Element)oldRows.item(i);
                   //Create the ner row
                   Element newRow = newDoc.createElement(newRowName);
                        for(int j=0;j<newNodesRetailer.getLength();j++){
                             //For each mode in the new mapping, retrieve teh information
                             //First the new information........
                             Element thisElement = (Element)newNodesRetailer.item(j);
                             String newElementName = thisElement.getAttribute("name");
                             //Then the old information
                             Element oldElement = (Element)thisElement.getElementsByTagName("content").item(0);
                             String oldField = oldElement.getFirstChild().getNodeValue();
                             //Get the original values based on the mapping information
                             Element oldValueElement = (Element)thisRow.getElementsByTagName(oldField).item(0);
                             String oldValue = oldValueElement.getFirstChild().getNodeValue();
                             //Create the new element
                             Element newElement = newDoc.createElement(newElementName);
                             newElement.appendChild(newDoc.createTextNode(oldValue));
                             //Retrieve list of new elements
                             NodeList newAttributes = thisElement.getElementsByTagName("attribute");
                             for(int k = 0;k<newAttributes.getLength();k++){
                                  //For each new attribute, get the order information
                                  Element thisAttribute = (Element)newAttributes.item(k);
                                  String oldAttributeField = thisAttribute.getFirstChild().getNodeValue();
                                  String newAttributeName = thisAttribute.getAttribute("name");
                                  //Get the original vale
                                  oldValueElement = (Element)thisRow.getElementsByTagName(oldAttributeField).item(0);
                                  String oldAttributeValue = oldValueElement.getFirstChild().getNodeValue();
                                  //Create the new attribute
                                  newElement.setAttribute(newAttributeName, oldAttributeValue);
                             //Add the new element to the new row
                             newRow.appendChild(newElement);
                        //Add the new row to the root
                        newRootElement.appendChild(newRow);
                   //Add the new root to the document
                   newDoc.appendChild(newRootElement);
              try{
                   out.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                   out.ptintln("<!DOCTYPE orders SYSTEM \"RetailerXml.dtd\">");
                   out.println(newRootElement.toString());
              } catch(IOException e) {}
    %>
    </body>
    </html>

    it reminded that there were some mistakes when i run this JSP program,so it must have something wrong, but due to my weak programming skills, I can not found these mistakes out. That must give me very useful help if you tell me how to solve them. thank you vrey much!

Maybe you are looking for

  • Bug in Datafinder Queries?

    I worked with datafinder and multi-queries functions in LabVIEW 2009 sp1. No problem. By some reasons, I changed the data format of TDMS. Each channel (ch0... chN) of a group has the time information of acquisition marked with the same name of DateTi

  • PO without material : Account determination problem

    Hi, I have created a PO without material, when I want to receive this PO (MIGO) I have this error message : 'Account determination for entry PSCF WRX not possible' I have assigned the material group for a valuation class and in Tcode OBYC I have alre

  • Cant get inc files into design view

    Hi Group, in spite of following step by step the manual in switching dw to show inc files in design view I cannot make it happen. Use dw mx 2004 (english) and win xp sp2 (german) Something goes wrong don't know what it is? Any hint is appreaciated rg

  • How to get higher cpu voltage during load when using "auto" with P67A-GD55?

    I have a little question regarding cpu voltage: When i set vcore to "auto" i get a nice low voltage when idle but during load i only get 1.264 max and that is to low. Is there a setting to increase the voltage during load and still have the cpu vcore

  • Automating the process of changing SAP servers when one server is down

    Hi, We have observed that sometimes users are unable to run a CRM IC web application due to server being down. So we want to automate the process that if a server is down then it will change to another server so that the application can run and the d