Applet displaying text upside down

I'm writing a minesweeper game (though this is mostly irrelevant), and am at the stage where I am displaying strings in an applet. For some reason, the applet insists on displaying everything UPSIDE DOWN. I have no clue why it would do this, so I'm wondering if anyone has suggestions.
Here is the applet code (will supply more upon request):
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
public class MineFieldApplet extends Applet
    private static final int FIELD_SIZE = 10;
    private static final int NUM_MINES = 5;
    private final double XMAX = FIELD_SIZE - 1;
    private final double XMIN = 0;
    private final double YMAX = 0;
    private final double YMIN = -(FIELD_SIZE - 1);
    private MineField field;
    private Rectangle box;
    private static final int BOX_X = 0;
    private static final int BOX_Y = 0;
    private static final int BOX_WIDTH = 2;
    private static final int BOX_HEIGHT = 2;
    public MineFieldApplet()
        field = new MineField(FIELD_SIZE, NUM_MINES);
        class FieldListener implements MouseListener
         public void mousePressed(MouseEvent event)
             sweep(FIELD_SIZE - 1 - (int)event.getY(), FIELD_SIZE - 1 - (int)event.getX());
             repaint();
         public void mouseReleased(MouseEvent event) {}
         public void mouseClicked(MouseEvent event) {}
         public void mouseEntered(MouseEvent event) {}
         public void mouseExited(MouseEvent event) {}
        MouseListener listener = new FieldListener();
        addMouseListener(listener);
    public void sweep(int row, int column)
        field.sweep(row, column);
    public void paint(Graphics g)
        Graphics2D g2 = (Graphics2D)g;
        double xscale = (getWidth() - 1.0) / (XMAX -XMIN);
        double yscale = (getHeight() - 1.0) / (YMIN -YMAX);
        g2.scale(xscale, yscale);
        g2.translate(-XMIN, -YMAX);
        g2.setStroke(new BasicStroke(0));
        g2.clearRect(0, 0, (int)XMAX, (int)YMAX);
        g2.setFont(new Font("Monospaced", Font.PLAIN, 1));
        g2.drawString(field.getString(0, 0), 1, 0);
}

If the y scale param is -ive every thing goes upside
down
if your x scale parm is -ive you get a mirror immage
so thats
it.I think I know why your y scale is -ive double
yscale =
(getHeight() - 1.0) / (YMIN -YMAX);
The numerator is obviously -ive since min - max <0Then why didn't it help when I suggested negating xScale and yScale?
� {�                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • IPod display is upside down and mirror image - fixable?

    The display on my mom's iPod display is upside down and mirror image. I can read the menus if I hold the iPod horizontal, and look into a mirror about six inches in front of my nose, but it's inconvenient.
    I have tried the 5 R's (except for upgrading the Mac OS 10.3.9 - she has an 800 MHz G3 iBook and won't support Leopard). Apparently the songs all reloaded and play OK, but the display is hard to read without (and with!) the mirror.
    I found a similar help request from last June, but no solution.

    I have the same problem, have you found a solution.
    Janet1960

  • PP CS6 Media Browser displays thumbnails upside down

    Hi,
    I'm using a 2010 MacBook Pro 17" 3.06 GHz, 4GB RAM,
    NVIDIA GeForce 9400M GT, OS 10.6.8 and PP CS6.02.
    When I'm viewing stills in media browser, it's displaying many of the thumnails upside down and side ways.
    Not sure what else to say about it or do.
    Any ideas?
    Thanks in advance,
    Simon.

    PP won't reorient stills that were taken with the camera turned on it's side for portrait shots, so I wonder if that's what you're seeing here.  The shooter had the camera turned or even upside down at the time.

  • Screen image display is upside down

    I have a user with a Portege S100 who says that the image appears upside down - is this a facility or a problem? If a facility how does she return it to normal?
    Thanks

    As in the previous posting suggested the graphic card supports a NV rotate option.
    I assume the user has changed the screen to inverted landscape (180 degree rotation)
    As far as I know there is a key combination to change this option:
    Ctrl + Shift + R

  • The hebrew textis upside down

    hebrew text
    sometime part of the text is upsidedown and genarally the hebrew text is upsidedown

    Try to disable hardware acceleration.
    *Firefox > Preferences > Advanced > General > Browsing: "Use hardware acceleration when available"

  • The 'graphic' shown in the Preferences Display is upside down.

    Any thoughs on how it happened and how to correct it?
    Cheers,

    Yeah, i've been posting this error other places and no luck! hmmm....it's a head scratcher for sure.  if I find the solution i'll post it here.  i don't think it was like that after i first installed ML.  if it was, it just didn't see it...just noticed it today after checking some settings.
    cheers,

  • Sideways/Upside Down Text

    I am looking for a way to display text upside down, and sideways. I am thinking there must be a way to flip an entire component - forinstance could you turn a JPanel 90 degrees?

    http://forum.java.sun.com/thread.jsp?forum=54&thread=187167

  • Text Drawing Upside-Down

    Hi,
    I am developing an iPhone application. When I draw text using CGContextShowTextAtPoint it draws the text upside down. I am not calling any of the functions to do transformations on the graphics context. Has anyone else seen this and know how to fix it?
    Thanks,
    Stephen

    I think you want to do simething like this
    transform = CGAffineTransformMake(
    1.0,0.0, 0.0, -1.0, 0.0, 0.0
    CGContextSetTextMatrix(context, transform);
    there is nothing wrong with this .. I do not know why its displayed upside down, but it its . so you have to flip it .. I dont know if this is the right solution or if the font should appear up side down . but I have the same problem and i flip it ..

  • DSC-HX90V LCD panel shows images upside down

    I bought the DSC-HX90V for my wife in late June, and we promptly took it on a three-week cruise and visit to Italy. The camera performed well, even in low light, and the telephoto worked phenomenally: Thanks to the 5-axis OIS, we were able to take 30X zoom images with exceptional clarity and no blurring (even when shooting distant ferries, containerships, etc. from the deck of a cruise ship). The viewfinder was a great convenience, and it was easier to use than we might have guessed (popping it up and flicking the back element of the finder out quickly became an instinctive process). But--and this is really weird--the camera developed a fluke after several days of use: the LCD began displaying images upside down, in both shooting and review modes. At first this happened sporadically, then it happened all the time, and finally--in the past few days--it reverted to displaying images correctly. Fortunately, there were two workarounds when the LCD was acting goofy: We could use use the viewfinder (which was immune from "upside down syndrome") or pull the bottom of the LCD panel out an eighth of an inch or so, which resulted in upside down giving way to right side up. I haven't yet called Sony's warranty service about this, but I'm guessing the problem is in the LCD's "selfie" position sensor. It would be great if it could be solved with a firmware update or system reset, but that's probably too much to hope for. In summary: Great camera, but with an annoying flaw that will need to be fixed.

    Hello Imboden, 
    Sorry to know that you are experiencing this issue with your camera. Please try to reset the settings in the camera by pressing MENU then Setup then Setting Reset. You can also do a Power Reset by turning the camera off, removing the battery. Press and Hold the On/Off button for a minute and then release it and reinsert battery. Turn on the camera and test the LCD screen.
    If the LCD panel still does not work properly, I would recommend sending the camera in to http://repair-camera.com/SonyRepairHome.aspx for evaluation and repairs.
    If my post answers your question, please mark it as "Accept as Solution".
    Thanks,
    Zander

  • Is there a fix to upside down text from EMF images

    The text from an EMF image is being flipped upside down during the conversion from word to PDF when using the acrobat add-in.  I hope you can see from the images.  However, when using the acrobat print drivers, the text from the EMF converts just fine.  Unfortunately, you can't use the auto create bookmarks feature this way.  What is causing the text from EMF files to be flipped upside down?  Is this a bug?  Has this been reported yet?

    That is really strange. It appears you are using OFFICE 2007 or 2010. There are some issues with MS, but this one is weird. Check that you are using the same job settings for both cases. You are using high-quality-print for PDF Maker. It might be worth checking the print with the same job settings. I am not proposing a solution, but some trouble shooting to be done. Also, please indicate the versions of WORD and Acrobat that you are using.
    If you have a way to try a different vector format other than EMF, that might give you some idea of where the problem lies.

  • Using Macbook without lid/display (and mounted upside down)

    I have a MBP with a damaged LCD that I want to connect to a kitchen HDTV and mount upside down. Since the display is useless, don't need a camera, and I want easy access to the power button, I want to remove the lid and mount the MBP upside down to the underside of a above-counter kitchen cabinet (not enclosed). Is there any problem with removing the lid and mounting/operating upside down? Makes for a sweet kitchen internet station, and will be very cool to have the MBP and cables mounted out of sight (wireless keyboard/mouse of course!).

    BSteely, thanks for the response. Unfortunately I started dissasembly before I checked back on the forum. I removed the damaged LCD and got crazy and removed the lid frame. I continuously checked the MBP operation after each step to make sure it was still working (using external display). The only thing I did not check along the way was internet access (wireless router). I ended up cutting the connection to what I believe is the antenna/receiver? Because when I mounted the MBP under the cabinet and turned it on, everything worked fine except no internet access. I am in the process of trying to reconnect the wires on what I think is the antenna (was mounted in the bottom of the lid/hinge area. Do you think this is my problem? Other than that everything working OK so far.

  • Vertical text in charts appears upside-down in Acrobat pdf

    When I copy a chart with vertical text from Tableau into Word and then Save as Adobe PDF, the vertical text appears upside-down.
    When I copy a chart with vertical text from Tableau into Word and then Save as PDF using Word's built in PDF creator, the vertical text appears correctly.
    This bug occurs in both Adobe Acrobat 11 and Acrobat Pro DC. Can Adobe fix this bug?

    Never mind. I solved the problem myself. It turns out I needed to embed the font I used in the text boxes. Once I did that, everything shows up fine.

  • 2nd gen iPod nano has blurry, upside down and backwards text suddenly

    I have a second gen iPod nano and after a couple of weeks the screen is blurry upside down and the text is backwards. I have tried resetting it and restoring to factory defaults. Nothing helps. It is fully charged. I followed the troubleshooting instructions from Apple and I didn't find this listed on the forum.  Thanks for the help.

    I would have to disagree with you. I like the shake and shuffle feature. I would assume people also use ipods for travelling/commuting. Bus rides, trains, flights and so on.
    But, to each their own opinions I guess.
    Peace!

  • Acrobat 9 displays "fi" as upside down "?"

    I have several pdf documents where "fi" appears as an upside down "?"  It prints the same way.   If I open the same files in PDFLite (a free opensource program) everything displays and prints correctly.  Does anyone have any idea how to fix this?

    PDF lite may be using the fonts embedded in the file, your local Acrobat preference could be to use local fonts (or vice-versa) in Preferences.
    Or, the font may not be embedded in the file, fi is a ligature substitute glyph for, hold on to your hats here, fi, and the upside down ? is a glyph used in Spanish (pardon my ignorance; Espanol?, Latin Americn?)

  • Scanned pdf - touch up text tool - upside down text

    Have a few pdfs created with Acrobat, scanned with a Canon 7080.
    When opening the pdfs and using the Touch Up text tool to add text, the text is upside down.
    The pdf is oriented correctly.
    It does the same on a few other machines so it seems to be something specific the documents.
    Most other pdf files are fine.
    I have printed to pdf and it fixes the problem (added text is right side up) but I'd like to know how it got messed up to begin with.
    Any ideas?
    TIA

    Sounds like you used the searchable text form of OCR. Thus the text is hidden and that is what is happening. To see the text, you would want to use the ClearScan form of OCR. At this point I don't have any good suggestions. A lot depends on what you are trying to do. In any case, trying to do major editing to a PDF with the text touchup tool is not recommended. Not the name of the tool is touchup, not retype. The method you are using will not make any change to the appearance, only to the hidden text.

Maybe you are looking for

  • DVD burn not working

    My PowerPC 65 running 10.4.6 and iLife 06 all of a sudden won't burn a DVD. Have burned several in the last 2 weeks with no issues. Today, in iDVD during the multiplexing and burning process, the computer would spit the DVD out with a general message

  • Elements 12 wont update

    I get a notification Elements & Premiere 12 that updates are available. After downloading the files i get an update errer when trying to install them.

  • Best way to super-impose multiple people in 1 shot?

    Hi all. I filmed a scene with myself running in 4 different places, and now I want to merge them all together into a final shot (so that it looks like there are multiple of me, all in the same shot), but I'm having trouble with the Garbage Matte and

  • Error "500 Connection timed out" when starting a Web Interface

    Hello, when starting a Web Interface (either from preview in Web Interface Builder or directly via transaction BPS_WIF0), after around 2 minutes I get the following Error Message: "500 Connection timed out" (in Detail, it says "Connection to partner

  • Parallel portal implementation in a non-unicode landscape

    Hi All, We have existing 3 system landscape with 3 systems in it. DEVQASPRD.All of these systems are non-unicode. The java add-in cannot be installed on them because the unicode java stack cannot talk to nonunicode abap stack.The customer does not wa