Rotating an ImageIcon in Graphics2D

I am still a beginner where Java programming is concerned. In order to improve my skills I decided to re-invent the wheel and write a pack (deck) of cards Class based around Swing. This in itself is not difficult however I have come across a problem. When displaying the suit 'icons' on a card the lower ones need to be inverted (rotated through 180 degrees). The simple and obvious solution would be to have a separate set of images which show the inverted suit 'icon'. However I believe it would be better to do this in code and therefore turned to trying to rotate the image using the Graphics2D Class but cannot get this to work. Here is the method from my Card Class that does (or rather doesn't) do this.
     /** Paint the card acording to its suit and face value. */
     public void paint(Graphics g)
          Graphics2D g2 = (Graphics2D)g;
          g2.drawImage(suitGraphic.getImage(),5,5,null);
          g2.drawImage(suitGraphic.getImage(),65,5,null);
          g2.drawImage(suitGraphic.getImage(),30,55,null);
          g2.rotate(Math.toRadians(180));
          g2.drawImage(suitGraphic.getImage(),5,105,null);
          g2.drawImage(suitGraphic.getImage(),65,105,null);
The above generates the card 5 and suitGraphic is defined elsewhere as (for example):-
suitGraphic = new ImageIcon("spade.gif");
N.B. The above code compiles fine but when I run the test program the bottom two inverted (rotated) spade images do not appear. This is just a test at this stage ultimately there will be different code for each card face value.
I would be grateful if some one could point me towards a solution.

When you do a rotation you have to remember that you are rotating the coordinate system around a particular point. The coordinates you are drawing to are for the rotated coordinate system not the previous non-rotated one. So drawing an image to coordinates (100,100) before rotation is not the same as (100, 100) after making a rotation. You can use the createInverse() function to get back to your original coordinate system. But for rotation you may want to use the other rotate that allows you to specify the coordinates of the point you want to rotate around. ie: rotate(theta, image.getCenterX(), image.getCenterY()).
Hth
Paul

Similar Messages

  • How to resize / render ImageIcon

    Want to resize / render an ImageIcon to ImageIcon like that:
    public static ImageIcon resizeImageIcon(ImageIcon imageIcon){
         Image image=imageIcon.getImage();
         Graphics2D imageGraphics=(Graphics2D)image.getGraphics();
         imageGraphics.setRenderingHint(
              RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
         imageIcon.setImage(image.getScaledInstance(100,100,Image.SCALE_SMOOTH));
         return imageIcon;
    } Exception at
    Graphics2D imageGraphics=(Graphics2D)image.getGraphics();
    How can I solve this problem?

    meiners wrote:
    Want to resize / render an ImageIcon to ImageIcon like that:Snip code snippets.
    Exception at
    Graphics2D imageGraphics=(Graphics2D)image.getGraphics();A TooManyKittensException? ..
    How can I solve this problem?.. Spay the tom.
    If it is not a TMKE, you might help us to help you by:
    1) Posting an SSCCE.
    2) Copy pasting the [exact exception|http://pscode.org/javafaq.html#exact].

  • Can anyone help me to add method to rotate the image using mouse?

    Hi everyone, i am currently creating a game which require the user to be able to drag and rotate the image
    on the screen..but sadly...i'm only able to do the dragging part..
    Can anyone be able to help me add the method to rotate the image using the mouse?
    Thanks :-)
    the code
    import javax.swing.*;
    import javax.swing.border.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.awt.geom.*;
    class Game extends JFrame {
         DisplayCanvas canvas;
         public Game() {
              super("My Game");
              Container container = getContentPane();
              canvas = new DisplayCanvas();
              TitledBorder border = new TitledBorder("Game Window");
              border.setTitlePosition(TitledBorder.BOTTOM);
              canvas.setBorder(border);
              container.add(canvas);
              addWindowListener(new WindowEventHandler());
              setSize(450,400);
              show();
              class WindowEventHandler extends WindowAdapter {
                   public void windowClosing(WindowEvent e) {
                        System.exit(0);
              public static void main(String arg[]) {
                   new Example();
         class DisplayCanvas extends JPanel {
              int x, y;
              BufferedImage bi;
              DisplayCanvas() {
                   setBackground(Color.white);
                   setSize(450,400);
                   addMouseMotionListener(new MouseMotionHandler());
                   Image image = getToolkit().getImage("duke.gif");
                   MediaTracker mt = new MediaTracker(this);
                   mt.addImage(image, 1);
                   try {
                        mt.waitForAll();
                   catch (Exception e) {
                        System.out.println("Exception while loading image.");
                   if (image.getWidth(this) == -1) {
                        System.out.println("***Make sure you have the image "
                        + "(duke.gif) file in the same directory.*****");
                        System.exit(0);
                   bi = new BufferedImage(image.getWidth(this),
                   image.getHeight(this),
                   BufferedImage.TYPE_INT_ARGB);
                   Graphics2D big =bi.createGraphics();
                   big.drawImage(image, 0, 0, this);
              public void paintComponent(Graphics g) {
                   super.paintComponent(g);
                   Graphics2D g2D = (Graphics2D) g;
                   g2D.drawImage(bi, x, y, this);
              class MouseMotionHandler extends MouseMotionAdapter {
                   public void mouseDragged(MouseEvent e) {
                        x = e.getX(); y = e.getY();
                        repaint();

    research a bit on AffineTransforms. you can set the rotated instance of the Graphics2D class and it will do the rotations for you :-D

  • Rotation is killing me...

    I can't figure out how to rotate an ImageIcon (easily cast to an Icon).
    The closest thing I found for any type of rotation was AffineTransform, which apparently only works for Shapes.
    Example source code would be appreciated.
    NOTE: I need to be able to rotate in degree increments of 10 or less.

    nevermind, figured it out.

  • Rotate a *.gif file

    Could anyone show me an example of how to rotate a gif image by a certain amount of degrees/radians.
    Thanks.

    Rotate is built into Graphics2D in a simple way that hides the ugly AffineTransform underware.
    First, the Graphics in the paintComponent() (or paint()) methods is really a Graphics2D,
    so a simple cast works:
    public void paintComponent( Graphics g ) {
    Graphics2D g2d = (Graphics2D) g;Last, look at BufferedImage. You'll want to draw your track in one buffer, then copy that buffer to the finished BufferedImage. In the finished image, you draw the cars and other moving bits. I did this a couple years back and have forgot the details, but the end result was very slick - really looked like a nice animation.
    Next, you just rotate the Grpahics2D:
    g2d.rotate( nRadians );From there on, you paint as per usual and it comes out rotated. Two special concerns:
    1) rotation around what?
    2) Graphics destruction
    1) The default rotation is around point 0,0 (top-left) which is probably not what you want. Let's say your racetrack is centered at xCenter, yCenter. Translate the Graphics2D to that point:
    g2d.translate( xCenter, yCenter );2) It's generally a bad practice to change a Graphics, since you've only got a reference and you don't know who else will be using the Graphics that reference points to. Fortunately, there's a create() method that copies the underlying object. You get a copy and then you can destroy it utterly, without bothering anyone else:
    // g is a Graphics reference
    Graphics g2 = g.create();
    // g2 is now a copy of the original - translate, rotate, whatever

  • Rotate a Class "car"

    Hello,
    I'm currently writing a basic GUI racing game.
    In the main GUI there is a constructor for a new class which I made called 'car'. the Car class has a draw(g2d) method that can be called. This draw method then draws the car to the screen.
    The draw method in the Car class is like this:
         public void draw(Graphics2D g2d)
              g2d.setColor(Color.BLACK);
              Rectangle2D.Double frontWheels = getFrontWheels();
              g2d.fill(frontWheels);
              Rectangle2D.Double reerWheels = getReerWheels();
              g2d.fill(reerWheels);
              .... etc
         }The main GUI has a remote method call in its paint method to this Car class like this
    public void paint(Graphics g)
    car.draw(g2d);
    }          How can i rotate the whole car ? I need to be able to rotate the whole class when it paints. I've been searching for two days now and I havent come up with anything. I see there is a rotate() method for the Graphics2D but that only seems to rotate single 'bits' inside the code.
    Please Help!! :)

    import java.awt.*;
    import java.awt.geom.*;
    import javax.swing.*;
    public class CarRotation implements Runnable {
        TrackPanel trackPanel;
        private JPanel getContent() {
            Car[] cars = {
                new Car(Color.magenta, 5.0),
                new Car(Color.cyan,    4.0),
                new Car(Color.yellow,  7.0)
            trackPanel = new TrackPanel(cars);
            return trackPanel;
        public void run() {
            while(true) {
                try {
                    Thread.sleep(100);
                } catch(InterruptedException e) {
                    System.out.println("interrupted");
                    break;
                trackPanel.advance();
        private void start() {
            Thread thread = new Thread(this);
            thread.setPriority(Thread.NORM_PRIORITY);
            thread.start();
        public static void main(String[] args) {
            CarRotation test = new CarRotation();
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(test.getContent());
            f.setSize(600,400);
            f.setLocation(200,200);
            f.setVisible(true);
            test.start();
    class TrackPanel extends JPanel {
        Car[] cars;
        double[] radials;
        Point2D.Double[] locations;
        Ellipse2D.Double track;
        boolean showMarkers = false;
        public TrackPanel(Car[] cars) {
            this.cars = cars;
            // Default values of zero okay.
            radials = new double[cars.length];
            locations = new Point2D.Double[cars.length];
            for(int j = 0; j < locations.length; j++) {
                locations[j] = new Point2D.Double();
        public void advance() {
            for(int j = 0; j < cars.length; j++) {
                locations[j] = getNextPosition(j);
            repaint();
        protected void paintComponent(Graphics g) {
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            if(track == null)
                initTrack();
            g2.setPaint(Color.blue);
            g2.draw(track);
            g2.setPaint(Color.red);
            for(int j = 0; j < cars.length; j++) {
                Point2D.Double p = locations[j];
                double theta = getTangent(j);
                Car car = cars[j];
                g2.setPaint(car.color);
                Point2D.Double cp = car.getCenter();
                AffineTransform at = AffineTransform.getTranslateInstance(p.x, p.y);
                at.rotate(theta + Math.PI/2, cp.x, cp.y);
                g2.setTransform(at);
                if(!showMarkers)
                    car.draw(g2);
                if(showMarkers) {
                    // Reset the transform for future rendering.
                    at.setToIdentity();
                    g2.setTransform(at);
                    // To show the Point2D p on the track.
                    g2.setPaint(Color.red);
                    g2.fill(new Ellipse2D.Double(p.x-2, p.y-2, 4, 4));
                    // To show the line tangent to the track at p.
                    g2.setPaint(Color.magenta);
                    double x1 = p.x + 20*Math.cos(theta);
                    double y1 = p.y + 20*Math.sin(theta);
                    double x2 = p.x + 20*Math.cos(theta+Math.PI);
                    double y2 = p.y + 20*Math.sin(theta+Math.PI);
                    g2.draw(new Line2D.Double(x1, y1, x2, y2));
        private Point2D.Double getNextPosition(int index) {
            Point2D.Double p = new Point2D.Double();
            double speed = cars[index].speed;
            double theta = radials[index];
            double cx = track.getCenterX();
            double cy = track.getCenterY();
            double lastX = cx + (track.width/2)*Math.cos(theta);
            double lastY = cy + (track.height/2)*Math.sin(theta);
            double distance = 0;
            while(distance < speed) {
                theta += Math.toRadians(1);
                p.x = cx + (track.width/2)*Math.cos(theta);
                p.y = cy + (track.height/2)*Math.sin(theta);
                distance += p.distance(lastX, lastY);
                lastX = p.x;
                lastY = p.y;
            radials[index] = theta;
            return p;
        private double getTangent(int index) {
            double theta = radials[index];
            double inc = Math.toRadians(1);
            double cx = track.getCenterX();
            double cy = track.getCenterY();
            double x1 = cx + (track.width/2)*Math.cos(theta-inc);
            double y1 = cy + (track.height/2)*Math.sin(theta-inc);
            double x2 = cx + (track.width/2)*Math.cos(theta+inc);
            double y2 = cy + (track.height/2)*Math.sin(theta+inc);
            double dy = y2 - y1;
            double dx = x2 - x1;
            return Math.atan2(dy, dx);
        private void initTrack() {
            int w = getWidth();
            int h = getHeight();
            track = new Ellipse2D.Double(w/16, h/8, w*7/8, h*3/4);
    class Car {
        Rectangle body;
        Rectangle frontBumper;
        Rectangle rearBumper;
        Ellipse2D.Double driver;
        Color color;
        double speed;
        public Car(Color color, double speed) {
            this.color = color;
            this.speed = speed;
            body = new Rectangle(-15, -40, 30, 80);
            frontBumper = new Rectangle(-15, -40, 30, 16);
            rearBumper = new Rectangle(-15, 65-40, 30, 16);
            driver = new Ellipse2D.Double(2-15, 25-40, 16, 10);
        public void draw(Graphics2D g2) {
            g2.setPaint(color);
            g2.fill(body);
            g2.setPaint(Color.red);
            g2.fill(frontBumper);
            g2.setPaint(Color.black);
            g2.fill(rearBumper);
            g2.setPaint(Color.gray);
            g2.fill(driver);
        public Point2D.Double getCenter() {
            return new Point2D.Double(body.getCenterX(), body.getCenterY());
    }

  • CircleScroller problem

    Hi,
    Im trying to copy this circleScroller program:
    [http://mac-systems.de/circlescroller/launch.jnlp]
    But Im stuck!
    How can I make a complete circle? Not a semi-circle.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.awt.Graphics2D.*;
    import java.awt.Graphics.*;
    import javax.swing.*;
    import java.awt.image.BufferedImage;
    import java.awt.Image;
    public class Quit extends JComponent{
         String sp = new String("Splashportal.net    ");
         int x, y, w, h;
    public  Quit(){
    public void paint(Graphics g){
         setBackground(Color.white);
         w =100;
         h =100;
         x=getSize().width/8;
         y=getSize().height/8;
         Double rotation = Math.toRadians(18);
         Graphics2D g2 = (Graphics2D)g;
         //BufferedImage image=new BufferedImage(1000,1000,BufferedImage.TYPE_INT_ARGB);
         //Graphics2D big = image.createGraphics();
         //Create a small image
         BufferedImage smallimg = new BufferedImage(600,600,BufferedImage.TYPE_INT_ARGB);
         Graphics2D small = smallimg.createGraphics();
              //Create an array of Graphics objects.
              Graphics2D[] smalls;
              smalls = new Graphics2D[20];
              //fill the array
                   for (int j =0; j<sp.length(); j++){
                        smalls[j] = small;
         for (int i = 0; i< sp.length(); i++){
              String character = String.valueOf(sp.charAt(i));
              smalls.setFont(new Font("Serif", Font.BOLD, 24));
              smalls[i].setColor(Color.black);
              smalls[i].fillRect(x, y, w, h);
              smalls[i].setColor(Color.white);
              smalls[i].drawRect(x, y, w, h);
              smalls[i].drawString(character, x, y);
              smalls[i].rotate(rotation);
              smalls[i].translate(60.0, 0.0);
    g2.drawImage(smallimg, x, y, this);
    public static void main(String[] args){
    JFrame f = new JFrame("I want to quit smoking");
         Container c = f.getContentPane();
         c.setLayout(new BorderLayout());
         c.add(new Quit(), BorderLayout.CENTER);
         f.setSize(600, 600);
         f.addWindowListener(new WindowAdapter(){
              public void windowClosing(WindowEvent e){System.exit(0);}
         f.setVisible(true);

    I don't know what's going on with this thing, but it sort-of does what I'd hoped, and it's a rather hypnotic effect...
    What I can't workout how to do is make the "ring" stay put in the same place, and the same size... what I guess is required is to "reset" the rotation and/or the "current translation" and/or the rotation variable to there original values after it's done one complete rotatation.
    package forums;
    import java.awt.Color;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.Font;
    import java.awt.image.BufferedImage;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import javax.swing.Timer;
    import javax.swing.JPanel;
    import javax.swing.JFrame;
    import javax.swing.SwingUtilities;
    import java.awt.image.BufferedImage;
    public class SplashPortalPanel extends JPanel implements ActionListener
      private static final long serialVersionUID = 1L;
      private static final String MESSAGE = new String("  SplashPortal.net");
      private final BufferedImage image = new BufferedImage(600,600,BufferedImage.TYPE_INT_ARGB);
      private final Graphics2D imageG2D = image.createGraphics();
      private final double R = Math.toRadians(1.0/360.0);
      private double rotation = Math.toRadians(360.0/MESSAGE.length());
      private final Timer timer;
      public SplashPortalPanel(){
        // set the background colour of this panel.
        super.setBackground(Color.WHITE);
        // create the image
        imageG2D.setFont(new Font("Serif", Font.BOLD, 40));
        // move the image to the center of the screen;
        imageG2D.translate(300, 100);
        // pause half-a-second then repaint 10 times a second.
        timer = new Timer(1000/76, this);
        timer.setInitialDelay(1000);
        timer.start();
        System.out.println("rotation="+rotation);
      public void actionPerformed(ActionEvent e) {
        rotation+=R;
        repaint();
      public void paintComponent(Graphics g) {
        int x = 0;
        int y = 0;
        int w = 100;
        int h = 100;
        // create each rectangle with a painted s value
        for ( char c :  MESSAGE.toCharArray() ) {
          // clear the rectangle
          imageG2D.setColor(Color.BLUE);
          imageG2D.fillRect(x, y, w, h);
          // draw the boarder
          imageG2D.setColor(Color.WHITE);
          imageG2D.drawRect(x, y, w, h);
          // draw the character
          imageG2D.drawString(String.valueOf(c), x+30, y+50);
          // move the "tile" into the circle
          //rotation=+R;
          imageG2D.rotate(rotation);
          imageG2D.translate(60.0, 0.0);
        Graphics2D g2 = ((Graphics2D)g);
        g2.setColor(Color.WHITE);
        //g2.fillRect(50, 50, 440, 440);
        g2.drawImage(image, x, y, 600, 600, this);
      public static void main(String[] args) {
        SwingUtilities.invokeLater(
          new Runnable() {
            public void run() {
              JFrame frame = new JFrame("So quit allready!");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.getContentPane().add(new SplashPortalPanel());
              frame.pack();
              frame.setSize(600, 600);
              frame.setLocationRelativeTo(null);
              frame.setVisible(true);
    }Cheers. Keith.

  • Stop ........ i need Help

    Please some one can tell me how can i rotate a picture that i ve loaded and zoom it.
    i tried the rotate method in th Graphics2D class but i ven't get a result.
    Thanks.

    The rotate method in Graphics2D rotates all subsequent rendering operations.
    So, if you've got an Image then you can create a new offscreen Image (eg, a BufferedImage), call rotate on its Graphics2D and then paint your original Image into it using drawImage.
    The more correct way of doing this would probably be something like this:
    BufferedImage myImage = ...; // however you load your Image
    AffineTransform affineTransform = AffineTransform.getRotateInstance(angle, ox, oy); // your rotation centre and amount
    AffineTransformOp op = new AffineTransformOp(affineTransform, AffineTransformOp.TYPE_BILINEAR);
    BufferedImage newImage = op.filter(myImage, null);You can add zoom to the affine transformation too if you wish.
    I've never tried any of this so I can't comment on the performance for certain. I doubt it will be blisteringly fast, though. Probably good enough for paint programs but not good enough for real-time effects.
    Hope this helps.

  • ImageIcon rotate

    Is there a java native way of rotate an Image ?
    I�m developing a battleship game (a simple demo just for test some UML design features.. the game is not really important)...
    The issue is the ship image drawing. I�m reading the water and the ship hull images from a set *.gif images... but the ship may be placed in vertical or horizontal way...
    I don�t want to store two images for the same ship (because it should work both as applet or as application.. and applet forces image loading minimization).. I want to read just one gif image and then rotate 90' depending on the image orientation... (or -90' if the ship is inverted placed)
    How can I do that ? which class ? ImageIcon ? Image? other ?
    thanks for any tip...

    I�m reading some sample codes here and I�m still mess...
    then I drop some duke dollars in this question...
    The bellow code had failed:
                        BufferedImage bimg = (BufferedImage) this.createImage(d.width, d.height);
                        if(bimg==null)System.out.println("ttttttttttt");
                        Graphics2D g2 = bimg.createGraphics();
                        g2.rotate(90.0);
                        paint(g2);
    [/cpde]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Graphics2D setTransform (Rotation?)

    I am having problems trying to get strings to rotate usin code taken from the Java Developers Almanac 2000. I am using the following code and the strange thing is no errors occur, but the text does not appear on screen.
          AffineTransform at = new AffineTransform();
          at.setToRotation(-Math.PI/2.0);
          g2d.setTransform(at);
          g2d.drawString(this.getText(), 0, g2d.getFontMetrics().getHeight());
    Thankyou in advance...
    Regards, Richard Lannan

    Hi, Richard.
    Your program works, at least on my machine.
    import java.awt.*;
    import javax.swing.*;
    import java.awt.geom.*;
    public class RotateText extends JFrame {
      public RotateText()     {
              JPanel p = new JPanel() {
                   public void paintComponent(Graphics g) {
                        Graphics2D g2d = (Graphics2D)g;
                        System.out.println("inside paintComponent()");
                        g2d.setColor(Color.black);
                        AffineTransform at = new AffineTransform();
                        at.setToRotation(-Math.PI/2.0);
                        g2d.setTransform(at);
                        g2d.drawString("Hello World", 0, g2d.getFontMetrics().getHeight());
                        // g2d.drawString("Hello World", 100, 100);
              getContentPane().add(p);
              p.repaint();
         public static void main(String args[])
              RotateText f = new RotateText();
              f.setSize(300,300);
              f.setVisible(true);
    }BTW: You'd better use
    g2d.transform(at);
    instead of
    g2d.setTransform(at);
    because the 'setTransform()' can cause undesired effects.
    Cheers, Tom

  • Graphics2D: Rotate, Shear, Translate.

    Hi,
    Is it possible to "stretch" 2 points of an image in Java. As I understand the AffineTransform methods, it
    applies the rotate, shear and translate to the whole image. An example:
    I've got an image of dimension (10000 x 9500). In java the bounds are (0,0,10000,9500).
    This means:
    topleft=(0,0)
    bottomleft=(0,9500)
    bottomright=(10000,9500)
    topright=(10000,0)
    Now, I want to change bottomleft to (-80,9430) and topright to (10060, 70).
    The catch is that topleft must stay (0,0) and bottomright (10000,9500).
    Thanks
    Cobus Mitchell

    Within the existing structures in Java2D this is not possible.
    You can only have transformations which keep parrallel line parrallel.
    I guess this should be possible by implementing a new affine transformation which
    works with a general 3x3 matrix and allows to set the bottom line to something different then 0 0 1.
    kind regards,

  • How can i rotate a PNG photo and keep the transparent background?

    current i use this method to rotate a photo, but the transparent background is lost.
    what can I do ?
    public CreateRotationPhoto(String photofile,String filetype,int rotation_value,String desfile){
                 File fileIn = new File(photofile);
               if (!fileIn.exists()) {
                   System.out.println(" file not exists!");
                   return;
               try {
                       InputStream input = new FileInputStream(fileIn);
                       JPEGImageDecoder decoder = JPEGCodec.createJPEGDecoder(input);
                       BufferedImage imageSrc = decoder.decodeAsBufferedImage();
                       int width = imageSrc.getWidth();
                       int height = imageSrc.getHeight();
                       BufferedImage src = ImageIO.read(input);
                       int width = src.getWidth(); //????? 
                            int height = src.getHeight(); //????? 
                       Image img = src.getScaledInstance(width, height,
                               Image.SCALE_FAST);
                       BufferedImage bi;
                       int fill_width=0;
                       int fill_height=0;
                       if (rotation_value==1||rotation_value==3){
                            bi = new BufferedImage(height, width,BufferedImage.TYPE_INT_RGB);
                            fill_width=height;
                            fill_height=width;
                       else{
                            bi = new BufferedImage(width,height,BufferedImage.TYPE_INT_RGB);
                            fill_height=height;
                            fill_width=width;
                            //BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
                       input.close();
                       System.out.println(photofile);
                       File fileOut = new File(desfile);
                       //File fileOut = new File("c:/Host1.PNG");
                       OutputStream output = new FileOutputStream(fileOut);
                       JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(output);
                       JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(bi);
                       param.setQuality(0.90f, false);
                       encoder.setJPEGEncodeParam(param);
                       Graphics2D biContext =bi.createGraphics();
                      biContext.setColor(Color.white);
                       biContext.fillRect(0,0,fill_width,fill_height);
                       int frame_width,frame_height;
                     if (rotation_value==1||rotation_value==3){
                            frame_width=height;
                            frame_height=width;
                       }else{
                            frame_width=width;
                            frame_height=height;
                       int x=0,y=0;
                       if (rotation_value==2){
                            x=frame_width;
                            y=frame_height;
                       if (rotation_value==0){
                             x=frame_width;
                             y=frame_height;
                       if (rotation_value==1){
                                x=frame_height;
                                 y=frame_height;
                       if (rotation_value==3){
                                    x=frame_width;
                                 y=frame_width;
                       double rotate=0;
                       if (rotation_value==0){
                             rotate=Math.PI *2;
                       if (rotation_value==1){
                            rotate=Math.PI / 2;
                       if (rotation_value==2){
                            rotate=Math.PI;
                       if (rotation_value==3){
                            rotate=Math.PI*1.5;
                       int x=0,y=0;
                       if (rotation_value==2){
                            x=width;
                            y=height;
                       if (rotation_value==1){
                                x=height;
                                 y=height;
                       if (rotation_value==3){
                                    x=width;
                                 y=width;
                       double rotate=0;
                       if (rotation_value==1){
                            rotate=Math.PI / 2;
                       if (rotation_value==2){
                            rotate=Math.PI;
                       if (rotation_value==3){
                            rotate=Math.PI*1.5;
                       System.out.println(Integer.toString(x)+"|x|"+Integer.toString(y)+"|y|"+Double.toString(rotate));
                       biContext.rotate(rotate, x / 2, y / 2);
                       biContext.drawImage(src, 0, 0, null);
                       biContext.dispose();
                       System.out.println("123123123123");
                       try{
                               ImageIO.write(bi, filetype, output);
                               //ImageIO.write(bi, filetype, "c:/Host.PNG");
                               output.close();
                          }catch (IOException e) {
                              System.err.println(e);
                      // encoder.encode(bi);
                       //output.close();
                } catch (Exception e) {
                         e.printStackTrace();
          }

    Using this BufferedImage.TYPE_INT_RGB for the type will eliminate any transparency in
    your image. Try BufferedImage.TYPE_INT_ARGB.
    Image file: Bird.gif
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.AffineTransform;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    import javax.swing.event.*;
    public class Rotate implements ChangeListener
        BufferedImage image;
        JLabel label;
        JSlider slider;
        public Rotate(BufferedImage orig)
            // make transparent background
            Color toErase = new Color(248, 248, 248, 255);
            image = eraseColor(convertImage(orig), toErase);
        public void stateChanged(ChangeEvent e)
            int value = slider.getValue();
            double theta = Math.toRadians(value);
            BufferedImage rotated = getImage(theta);
            label.setIcon(new ImageIcon(rotated));
        private BufferedImage getImage(double theta)
            double cos = Math.cos(theta);
            double sin = Math.sin(theta);
            int w = image.getWidth();
            int h = image.getHeight();
            int width  = (int)(Math.abs(w * cos) + Math.abs(h * sin));
            int height = (int)(Math.abs(w * sin) + Math.abs(h * cos));
            BufferedImage bi = new BufferedImage(width, height, image.getType());
            Graphics2D g2 = bi.createGraphics();
            g2.setPaint(new Color(0,0,0,0));
            g2.fillRect(0,0,width,height);
            AffineTransform at = AffineTransform.getRotateInstance(theta, width/2, height/2);
            double x = (width - w)/2;
            double y = (height - h)/2;
            at.translate(x, y);
            g2.drawRenderedImage(image, at);
            g2.dispose();
            return bi;
        private BufferedImage convertImage(BufferedImage in)
            GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
            GraphicsDevice gd = ge.getDefaultScreenDevice();
            GraphicsConfiguration gc = gd.getDefaultConfiguration();
            BufferedImage out = gc.createCompatibleImage(in.getWidth(), in.getHeight(),
                                                         Transparency.TRANSLUCENT);
            Graphics2D g2 = out.createGraphics();
            g2.drawImage(in, 0, 0, null);
            g2.dispose();
            return out;
        private BufferedImage eraseColor(BufferedImage source, Color color)
            int w = source.getWidth();
            int h = source.getHeight();
            int type = BufferedImage.TYPE_INT_ARGB;
            BufferedImage out = new BufferedImage(w, h, type);
            Graphics2D g2 = out.createGraphics();
            g2.setPaint(new Color(0,0,0,0));
            g2.fillRect(0,0,w,h);
            int target = color.getRGB();
            for(int j = 0; j < w*h; j++)
                int x = j % w;
                int y = j / w;
                if(source.getRGB(x, y) == target)
                    source.setRGB(x, y, 0);
            g2.drawImage(source, 0, 0, null);
            g2.dispose();
            return out;
        private JLabel getLabel()
            label = new JLabel(new ImageIcon(image));
            return label;
        private JSlider getSlider()
            slider = new JSlider(JSlider.HORIZONTAL, 0, 360, 0);
            slider.addChangeListener(this);
            return slider;
        public static void main(String[] args) throws IOException
            String path = "images/Bird.gif";
            ClassLoader cl = Rotate.class.getClassLoader();
            InputStream is = cl.getResourceAsStream(path);
            Rotate rotate = new Rotate(ImageIO.read(is));
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().setBackground(Color.pink);
            f.getContentPane().add(rotate.getLabel());
            f.getContentPane().add(rotate.getSlider(), "South");
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
    }

  • Which is better for drawing JPGs on JLabel: ImageIcon or directly?

    I'm currently using this everywhere.
    BufferedImage bi;
    Jlabel jLabel;
    ImageIcon img = new ImageIcon( bi );
    jLabel.setIcon(imgIcon);but now I've discovered I can write images directly to the component from paintComponent( Graphics g )
    (from a subclass of JLabel)
    public void paintComponent( Graphics g ) {
      super.paintComponent( g );
      Graphics2D g2 = (Graphics2D)g;
      BufferedImage bi=getBufImg();
      g2.drawImage(bi, 0, 0, this.getWidth(), this.getHeight(), null );Is this more efficient or better form? Should I update my code everywhere?
    Also, the latter method seems to work the first time I call it, but I can't seem to change the image on an event like mouseEnter using code like this:
    public void mouseEntered(MouseEvent e) {
      Graphics g = this.getGraphics();
      Graphics2D g2 = (Graphics2D)g;
      BufferedImage bi=getBufImg();
      g2.drawImage(bi, 0, 0, this.getWidth(), this.getHeight(), null );
    }what's wrong?

    Is this more efficient or better form?
    No.
    Should I update my code everywhere?
    It depends on what you want to do. If you want to show an image then ImageIcon is an easy way. Override paintComponent when you want to do something other than simply display the image, eg, write text on top of the image or alter the image with things like rotation and scaling.
    Also, the latter method seems to work the first time I call it, but I can't seem to change the image on an event like mouseEnter using code like this
    Don't put painting code inside event code. Painting/drawing code belongs in an appropriate painting method. Use member variables in the enclosing class for state, manipulate these from your event code and set up your painting method to be able to accurately render this state at any time.
    stephensk8s is correct about the mouseEntered method. It works for components. So using a simple JLabel with ImageIcon is a carefree way to achieve rollover affects.
    Creating this kind of thing for custom graphics and images takes a little more effort. It all depends on what you are trying to do.
    Is there a good place to go to get a better understanding of this, or just ask on this forum?
    Ask when you need help.
    Resources that may be helpful to get started:
    Lesson: Writing Event Listeners
    Lesson: Performing Custom Painting
    How to Use Icons
    Lesson: Working with Images
    Core Java Technologies Tech Tips.

  • Problem in rotating and moving image at the same time

    the problem is that im making a car game(2D) in which u have upper view of car.
    i have make the car rotate bt problem is that i canot move it forward or backward correctly
    .wen i move it forward or backward i goes wrong...
    nd another problem is that i cannot both rotate and move the car at same time
    example if i press both up nd right arrow keys i doesnt move nd rotate..
    nd also plz tell me the accelerate nd reverse method so i can speedup my car like other car games
    here is the code
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.geom.*;
    import java.applet.*;
    import java.net.URL;
    public class RaceGame extends JComponent
    static int x=560;
    static int y=410;
    static int currentAngle=0;
    static double hspeed,vspeed;
    static int carspeed=1;
    Image car;
    //int angle=car.getAngle();
    Image getImage(String filename)
    URL url = getClass().getResource(filename);
    ImageIcon icon = new ImageIcon(url);
    return icon.getImage();
    //Rectangle2D.Float rect=new Rectangle2D.Float(x,y,30,30);
    //Rectangle rect=new Rectangle(x,y,30,30);
    public RaceGame()
    car=getImage("car1.jpeg");
    public void CreateBase()
    JFrame frame=new JFrame("Dare2Race");
    frame.setBounds(70,30,650,500);
    frame.setVisible(true);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Container c=frame.getContentPane();
    c.add(new RaceGame());
    frame.addKeyListener(new adapter());
    c.setBackground(Color.BLACK);
    //JLabel finish=new JLabel("FINISH");
    //c.add(finish);
    public void rotate()
    currentAngle+=1;
    if(currentAngle>=360)
    currentAngle=0;
    repaint();
    public void paint(Graphics g)
    super.paint(g);
    Graphics2D g2d=(Graphics2D)g;
    AffineTransform origXform=g2d.getTransform();
    AffineTransform newXform=(AffineTransform)(origXform.clone());
    newXform.rotate(Math.toRadians(currentAngle),x,y);
    g2d.setTransform(newXform);
    g2d.drawImage(car,x,y,this);
    g2d.setTransform(origXform);
    g.setColor(Color.WHITE);
    g.drawLine(640,380,420,380);
    g.drawLine(640,460,320,460);
    g.drawLine(420,380,420,300);
    g.drawLine(320,460,320,380);
    g.drawLine(420,300,125,300);
    g.drawLine(320,380,230,380);
    g.drawLine(230,380,230,460);
    g.drawLine(230,460,2,460);
    g.drawLine(125,300,125,370);
    g.drawLine(125,370,105,370);
    g.drawLine(2,460,2,180);
    g.drawLine(105,370,105,300);
    g.drawLine(2,180,450,180);
    g.drawLine(105,300,105,250);
    g.drawLine(105,250,550,250);
    g.drawLine(550,250,550,20);
    g.drawLine(550,20,275,20);
    g.drawLine(450,180,450,100);
    g.drawLine(450,100,360,100);
    g.drawLine(360,100,360,160);
    g.drawLine(360,160,10,160);
    g.drawLine(10,160,10,30);
    g.drawLine(275,20,275,90);
    g.drawLine(275,90,110,90);
    g.drawLine(110,90,110,30);
    repaint();
    class adapter extends KeyAdapter
    public void keyPressed(KeyEvent e)
    switch(e.getKeyCode())
    case KeyEvent.VK_LEFT:
    currentAngle--;
    repaint();
    break;
    case KeyEvent.VK_RIGHT:
    currentAngle++;
    repaint();
    break;
    case KeyEvent.VK_UP:
    carspeed++;
    hspeed=((double)carspeed)*Math.cos(currentAngle);
    vspeed=((double)carspeed)*Math.sin(currentAngle);
    x = x - (int) hspeed;
    y = y - (int) vspeed;
    repaint();
    break;
    case KeyEvent.VK_DOWN:
    carspeed--;
    hspeed=((double)carspeed)*Math.cos(currentAngle);
    vspeed=((double)carspeed)*Math.sin(currentAngle);
    x = x + (int)hspeed;
    y = y + (int)vspeed;
    repaint();
    break;
    public static void main(String[]args)
    RaceGame race=new RaceGame();
    race.CreateBase();
    //race.setDoubleBuffered(true);
    }

    the problem is that im making a car game(2D) in which u have upper view of car.
    i have make the car rotate bt problem is that i canot move it forward or backward correctly
    .wen i move it forward or backward i goes wrong...
    nd another problem is that i cannot both rotate and move the car at same time
    example if i press both up nd right arrow keys i doesnt move nd rotate..
    nd also plz tell me the accelerate nd reverse method so i can speedup my car like other car games
    plz help me
    here is the code
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.geom.*;
    import java.applet.*;
    import java.net.URL;
    public class RaceGame extends JComponent
    static int x=560;
    static int  y=410;
    static int currentAngle=0;
    static double hspeed,vspeed;
    static  int carspeed=1;
    Image car;
    //int angle=car.getAngle();
    Image getImage(String filename)
    URL url = getClass().getResource(filename);
    ImageIcon  icon = new ImageIcon(url);   
    return icon.getImage();
    //Rectangle2D.Float rect=new Rectangle2D.Float(x,y,30,30);
    //Rectangle rect=new Rectangle(x,y,30,30);
    public RaceGame()
    car=getImage("car1.jpeg");
    public void CreateBase()
    JFrame frame=new JFrame("Dare2Race");
    frame.setBounds(70,30,650,500);
    frame.setVisible(true);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Container c=frame.getContentPane();
    c.add(new RaceGame());
    frame.addKeyListener(new adapter());
    c.setBackground(Color.BLACK);
    //JLabel finish=new JLabel("FINISH");
    //c.add(finish);
    public void rotate()
    currentAngle+=1;
    if(currentAngle>=360)
    currentAngle=0;
    repaint();
    public void paint(Graphics g)
    super.paint(g);
    Graphics2D g2d=(Graphics2D)g;
    AffineTransform origXform=g2d.getTransform();
    AffineTransform newXform=(AffineTransform)(origXform.clone());
    newXform.rotate(Math.toRadians(currentAngle),x,y);
    g2d.setTransform(newXform);
    g2d.drawImage(car,x,y,this);
    g2d.setTransform(origXform);
    g.setColor(Color.WHITE);
    g.drawLine(640,380,420,380);
    g.drawLine(640,460,320,460);
    g.drawLine(420,380,420,300);
    g.drawLine(320,460,320,380);
    g.drawLine(420,300,125,300);
    g.drawLine(320,380,230,380);
    g.drawLine(230,380,230,460);
    g.drawLine(230,460,2,460);
    g.drawLine(125,300,125,370);
    g.drawLine(125,370,105,370);
    g.drawLine(2,460,2,180);
    g.drawLine(105,370,105,300);
    g.drawLine(2,180,450,180);
    g.drawLine(105,300,105,250);
    g.drawLine(105,250,550,250);
    g.drawLine(550,250,550,20);
    g.drawLine(550,20,275,20);
    g.drawLine(450,180,450,100);
    g.drawLine(450,100,360,100);
    g.drawLine(360,100,360,160);
    g.drawLine(360,160,10,160);
    g.drawLine(10,160,10,30);
    g.drawLine(275,20,275,90);
    g.drawLine(275,90,110,90);
    g.drawLine(110,90,110,30);
    repaint();
    class adapter extends KeyAdapter
    public void keyPressed(KeyEvent e)
      switch(e.getKeyCode())
        case KeyEvent.VK_LEFT:
        currentAngle--;
        repaint();
        break;
        case KeyEvent.VK_RIGHT:
        currentAngle++;
        repaint();
        break;
        case KeyEvent.VK_UP:
        carspeed++;
        hspeed=((double)carspeed)*Math.cos(currentAngle);
        vspeed=((double)carspeed)*Math.sin(currentAngle);
        x = x - (int) hspeed;
        y = y - (int) vspeed;
        repaint();
        break;
        case KeyEvent.VK_DOWN:
        carspeed--;
        hspeed=((double)carspeed)*Math.cos(currentAngle);
        vspeed=((double)carspeed)*Math.sin(currentAngle);
        x = x + (int)hspeed;
        y = y + (int)vspeed;
        repaint();
        break;
    public static void main(String[]args)
    RaceGame race=new RaceGame();
    race.CreateBase();
    //race.setDoubleBuffered(true);
    }and there is no compile time error in this code
    the only error that occurs when u write java RaceGame is because of the car image which compiler doesnt found and throughs exception if u place any image in ur bin folder adn name it car.jpg it wont generate error

  • Rotate Operator leaves black color around destination image

    Hi Everyone,
    I am creating a JPeg image which has two layers. First one is the background image layer. Second one is the photo which i want to put on the center on the back ground image. I am using overlay operator for this purpose.I have already done this thing.. BUT when i try to rotate the photo then a black color appears (in the area where part of un-rotated image was). I want the background image to be there instead of that black colour..
    I have searched a lot but did not find the solution.. Please help.
    Thanks & Best Regards,
    Masood Ahmad

    Hi,
    It works perfect.. i am doing the same thing using rotate operator in JAI... why that is not working... I am pasting both Rotate programs here.. One is in Java2D and 2nd in JAI.. Java2D is working but JAI rotate is leaving black area after rotation.
    Please tell where i am wrong in JAI or is it bug in JAI?
    Program in JAI
    import java.io.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.border.*;
    import java.net.URL;
    import java.net.MalformedURLException;
    import java.awt.*;
    import java.awt.color.*;
    import java.awt.geom.*;
    import java.awt.image.*;
    import java.awt.image.renderable.*;
    import java.util.*;
    import javax.media.jai.*;
    import javax.media.jai.operator.*;
    import javax.media.jai.widget.*;
    import com.sun.media.jai.codec.*;
    public class RotateTestJAI extends JPanel
    PlanarImage src1 = null;
    PlanarImage src2 = null;
    ImageDisplay ic1 = null;
    public static void main(String any[]) throws Exception{
    JFrame frame = new JFrame();
    frame.add(new RotateTestJAI(any[0],any[1]));
    frame.setSize(800,600);     
    frame.setVisible(true);     
    public RotateTestJAI(String im1, String im2) throws Exception{
    super(true);
    setLayout(new BorderLayout());
         try
                   //scale first image
                   FileSeekableStream stream = new FileSeekableStream(im1);
                   RenderedOp imscaled = JAI.create("stream",stream);
                   Interpolation interp = Interpolation.getInstance(Interpolation.INTERP_BILINEAR);
                   System.out.println("height : "+imscaled.getHeight()+" Width : "+imscaled.getWidth());
                   ParameterBlock params = new ParameterBlock();
                   params.addSource(imscaled);
                   params.add((float)1388/imscaled.getWidth());
                   params.add((float)1641/imscaled.getHeight());
                   params.add(0.00F);
                   params.add(0.00F);
                   params.add(interp);
                   src1 = JAI.create("scale", params );
                   //scale second image
                   stream = new FileSeekableStream(im2);
                   imscaled = JAI.create("stream",stream);
                   interp = Interpolation.getInstance(Interpolation.INTERP_BILINEAR);
                   params = new ParameterBlock();
                   params.addSource(imscaled);
                   params.add((float)400/imscaled.getWidth());
                   params.add((float)300/imscaled.getHeight());
                   params.add(0.00F);
                   params.add(0.00F);
                   params.add(interp);
                   src2 = JAI.create("scale", params );
                   float x = (float)(src1.getHeight()/2)-src2.getHeight();
                   float y = (float)(src1.getWidth()/2)-src2.getWidth();
                   int value = 10;
                   float angle = (float)(value * (Math.PI/180.0F));
                   //Rotate second image          
                   params = new ParameterBlock();
                   params.addSource(src2); // The source image
                   params.add(x); // The x origin
                   params.add(y); // The y origin
                   params.add(angle); // The rotation angle
                   params.add(Interpolation.getInstance(Interpolation.INTERP_BILINEAR)); // The interpolation
                   // Create the rotate operation
                   src2 = JAI.create("Rotate", params, null);
                   //translate 2nd image to bring it in center               
                   params = new ParameterBlock();
                   params.addSource(src2); // The source image
                   params.add((float)Math.max(x, 0)); // The x translation
                   params.add((float)Math.max(y, 0)); // The y translation
                   params.add(Interpolation.getInstance(Interpolation.INTERP_BILINEAR)); // The interpolation
                   // Create the translate operation
                   src2 = JAI.create("translate", params, null);
                   //overlay second image on first image
                   params = new ParameterBlock();     
                   params.addSource(src1);
                   params.addSource(src2);     
              RenderedOp tmp = JAI.create("overlay", params);
                   //put the image on display     
                   ic1=new ImageDisplay(tmp);
              this.add(ic1,BorderLayout.CENTER);
         catch ( MalformedURLException e)
              return;
    Program in Java2D:
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.AffineTransform;
    import java.awt.image.BufferedImage;
    import java.io.IOException;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    public class RotationTest implements ActionListener
    BufferedImage bg;
    BufferedImage fg;
    JLabel label;
    double theta;
    double thetaInc;
    public RotationTest(BufferedImage bg, BufferedImage fg)
    this.bg = bg;
    this.fg = fg;
    theta = 0.0;
    thetaInc = Math.PI/6;
    public void actionPerformed(ActionEvent e)
    theta += thetaInc;
    label.setIcon(new ImageIcon(getImage()));
    private BufferedImage getImage()
    int w = bg.getWidth();
    int h = bg.getHeight();
    BufferedImage out = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
    Graphics2D g2 = out.createGraphics();
    g2.drawRenderedImage(bg, null);
    double width = fg.getWidth();
    double height = fg.getHeight();
    double x = (w - width)/2;
    double y = (h - height)/2;
    AffineTransform at = AffineTransform.getTranslateInstance(x, y);
    at.rotate(theta, width/2, height/2);
    g2.drawRenderedImage(fg, at);
    g2.dispose();
    return out;
    private JLabel getLabel()
    ImageIcon icon = new ImageIcon(getImage());
    label = new JLabel(icon);
    label.setHorizontalAlignment(JLabel.CENTER);
    return label;
    private JPanel getUIPanel()
    JButton rotate = new JButton("rotate");
    rotate.addActionListener(this);
    JPanel panel = new JPanel();
    panel.add(rotate);
    return panel;
    public static void main(String[] args) throws IOException
    ClassLoader cl = RotationTest.class.getClassLoader();
    String path = "images/cougar.jpg";
    BufferedImage one = ImageIO.read(cl.getResourceAsStream(path));
    path = "images/Bird.gif";
    BufferedImage two = ImageIO.read(cl.getResourceAsStream(path));
    RotationTest test = new RotationTest(one, two);
    JFrame f = new JFrame();
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.getContentPane().add(test.getLabel());
    f.getContentPane().add(test.getUIPanel(), "South");
    f.setSize(400,400);
    f.setLocation(200,200);
    f.setVisible(true);
    }

Maybe you are looking for

  • BW Report Performance, Accuracy of Data

    Hi, Can someone help give explanations to following questions : 1.) Does BW Report show how current is my data? 2.) What are the reason why the performance of my BW Report is slow? 3.) What are the reason why my BW Report is have missing data? 4.) Wh

  • Establishing Airport network on top of existing router

    I'm trying to add my AEBS and Time Capsule in an extended network on top of an existing network consisting of a Linksys router connecting to the modem. I can connect the AEBS to an ethernet port of the Linksys and it works fine in "bridge" mode. Howe

  • ABAP Tree / Node

    hi, my requirement is related to HR ABAP, theres a feature called PINCH, which has following tree/node present... PINCH |___TCLAS |____A Master Date and time |___________Position now currently the client doesnt have the Position which i have shown in

  • Can not create 3rd disc of recovery set.

    Hello, I am using HP Pavilion G6-2103TU Laptop. I am getting an error when trying to create 3rd DVD-R.when it verify 97% that say this message"Disc verify failed . Please use another disc and try again." Then i tray to create in safe mode it say ' pl

  • Can't open the color picker

    Since Lion upgrade, I have the same bug with Photoshop CS5 Mac : http://forums.adobe.com/message/3930635 (read only) When I double-click on color stops in the gradient editor, sometime it opens the color picker, sometime not. Is there a solution for