Zoom Issues with JScrollPane

Hello all,
I have ran into an issue with zoom functionality on a JScrollPane.
Here is the situation (code to follow):
I have a JFrame with a JDesktopPane as the contentpane. Then I have a JScrollPane with a JPanel inside. On this JPanel are three rectangles. When they are clicked on, they will open up a JInternalFrame with their name (rect1, rect2, or rect3) as the title bar. Rect3 is positioned (2000,2000).
I have attached a mousewheel listener to the JPanel so I can zoom in and out.
I have also attached a mouse listener so I can detect the mouse clicks for the rectangles. I also do a transformation on the point so I can be use it during clicks while the panel is zoomed.
All of this works fantastic. The only issue I am having is that when the JScrollPane scroll bars change, I cannot select any of the rectangles.
I will give a step by step reproduction to be used with the code:
1.) Upon loading you will see two rectangles. Click the far right one. You'll see a window appear. Good. Move it to the far right side.
2.) Zoom in with your mouse wheel (push it towards you) until you cannot zoom anymore (May have to get focus back on the panel). You should see three rectangles. Click on the newly shown rectangle. Another window, titled rect3 should appear. Close both windows.
3.) This is where things get alittle tricky. Sometimes it works as intended, other times it doesn't. But do something to this affect: Scroll to the right so that only the third rectangle is showing. Try to click on it. If a window does not appear - that is the problem. But if a window does appear, close it out and try to click on the 3rd rect again. Most times, it will not display another window for me. I have to zoom out one step and back in. Then the window will appear.
After playing around with it for awhile, I first thought it may be a focus issue...I've put some code in the internal window listeners so the JPanel/JScrollPane can grab the focus upon window closing, but it still does not work. So, either the AffineTransform and/or point conversion could be the problem with the scroll bars? It only happens when the scroll bar has been moved. What affect would this have on the AffineTransform and/or point conversion?
Any help would be great.
Here is the code, it consists of two files:
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.BorderFactory;
import javax.swing.JDesktopPane;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
public class InternalFrameAffineTransformIssue
     public static void main ( String[] args )
          JFrame frame = new JFrame("AffineTransform Scroll Issue");
          frame.setLayout(null);
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          JDesktopPane desktop = new JDesktopPane();
          frame.setContentPane(desktop);
          MyJPanel panel = new MyJPanel(frame);
          JScrollPane myScrollPane = new JScrollPane(panel);
          panel.setScrollPane(myScrollPane);
          myScrollPane.setLocation(0, 0);
          myScrollPane.setSize(new Dimension(800, 800));
          myScrollPane.getVerticalScrollBar().setUnitIncrement(50);
          myScrollPane.getHorizontalScrollBar().setUnitIncrement(50);
          myScrollPane.setViewportBorder(BorderFactory.createLineBorder(Color.black));
          frame.getContentPane().add(myScrollPane);
          frame.setBounds(0, 100, 900, 900);
          frame.setVisible(true);
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener;
import java.awt.geom.AffineTransform;
import java.awt.geom.NoninvertibleTransformException;
import java.awt.geom.Point2D;
import javax.swing.JFrame;
import javax.swing.JInternalFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.event.InternalFrameAdapter;
import javax.swing.event.InternalFrameEvent;
import javax.swing.event.InternalFrameListener;
public class MyJPanel extends JPanel implements MouseWheelListener
          double zoom = 1;
          Rectangle rect1 = new Rectangle(50, 50, 20, 20);
          Rectangle rect2 = new Rectangle(100, 50, 20, 20);
          Rectangle rect3 = new Rectangle(2000, 2000, 20, 20);
          AffineTransform zoomedAffineTransform;
          JFrame frame;
          JPanel myPanel = this;
          JScrollPane myScrollPane;
          public MyJPanel(JFrame inputFrame)
               setAutoscrolls(true);
               addMouseListener(new MouseAdapter(){
                    public void mousePressed ( MouseEvent e )
                         System.out.println("Clicked: " + e.getPoint());
                         AffineTransform affineTransform = zoomedAffineTransform;
                         Point2D transformedPoint = e.getPoint();
                         //Do the transform if it is not null
                         if(affineTransform != null)
                              try
                                   transformedPoint = affineTransform.inverseTransform(transformedPoint, null);
                              catch (NoninvertibleTransformException ex)
                                   ex.printStackTrace();
                         System.out.println("Tranformed Point: " + transformedPoint);
                         if(rect1.contains(transformedPoint))
                              System.out.println("You clicked on rect1.");
                              createInternalFrame("Rect1");
                         if(rect2.contains(transformedPoint))
                              System.out.println("You clicked on rect2.");
                              createInternalFrame("Rect2");
                         if(rect3.contains(transformedPoint))
                              System.out.println("You clicked on rect3.");
                              createInternalFrame("Rect3");
               addMouseWheelListener(this);
               frame = inputFrame;
               setPreferredSize(new Dimension(4000, 4000));
               setLocation(0, 0);
          public void paintComponent ( Graphics g )
               super.paintComponent(g);
               Graphics2D g2d = (Graphics2D) g;
               g2d.scale(zoom, zoom);
               zoomedAffineTransform = g2d.getTransform();
               g2d.draw(rect1);
               g2d.draw(rect2);
               g2d.draw(rect3);
          public void mouseWheelMoved ( MouseWheelEvent e )
               System.out.println("Mouse wheel is moving.");
               if(e.getWheelRotation() == 1)
                    zoom -= 0.05;
                    if(zoom <= 0.20)
                         zoom = 0.20;
               else if(e.getWheelRotation() == -1)
                    zoom += 0.05;
                    if(zoom >= 1)
                         zoom = 1;
               repaint();
          public void createInternalFrame ( String name )
               JInternalFrame internalFrame = new JInternalFrame(name, true, true, true, true);
               internalFrame.setBounds(10, 10, 300, 300);
               internalFrame.setVisible(true);
               internalFrame.addInternalFrameListener(new InternalFrameAdapter(){
                    public void internalFrameClosed ( InternalFrameEvent arg0 )
                         //myPanel.grabFocus();
                         myScrollPane.grabFocus();
                    public void internalFrameClosing ( InternalFrameEvent arg0 )
                         //myPanel.grabFocus();
                         myScrollPane.grabFocus();
               frame.getContentPane().add(internalFrame, 0);
          public void setScrollPane ( JScrollPane myScrollPane )
               this.myScrollPane = myScrollPane;
     }

What I'm noticing is your zoomedAffineTransform is changing when you click to close the internal frame. This ends up being passed down the line, thus mucking up your clicks until you do something to reset it (like zoom in and out).
Clicking on the JInternalFrame appears to add a translate to the g2d transform. This translation is what's throwing everything off. So in the paintComponent where you set the zoomedAffineTransform, you can verify if the transform has a translation before storing the reference:
         if (g2d.getTransform().getTranslateX() == 0.0) {
            zoomedAffineTransform = g2d.getTransform();
         }Edited by: jboeing on Oct 2, 2009 8:23 AM

Similar Messages

  • Mx.controls.Text zoom issue with wrapped text. Is this a bug?

    We have created a diagram drawing tool in Flex, but we are having a serious issue with zooming. Everything zoom fine expect the Text control if it contains wrapped text. At certain zoom levels, some of the text seems to disappear (usually text at the end). I have tried everything, embedding fonts, turning anti-aliasing on and off, setting anti-aliasing to normal or advanced, but it doesn't seem to fix the problem. Is this is a known bug?
    If you check out the pictures (see attachments), you will see that the part of the text ('34') disappears at a certain zoom level.
    There is another blog who suggest to embed the font and set the antiAliasType to ‘animation’ (http://www.mehtanirav.com/2008/08/20/zooming-text-area-in-flex-messes-up-word-wrap-bug%20), but this doesn't seem to work for me either. I don't know if I am doing this correctly though, but I embedded a font and called text.setStyle("fontAntiAliasType","animation"). However, 'animation' is not one of the  AntiAliasType contants. According to the official documentation, the AntiAliasType constants are 'advanced' or 'normal'.
    Any help will be appreciated.

    Try this:
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    import javax.swing.text.*;
    class textpaneColor extends JFrame {
       JTextPane tp = new JTextPane();
       JButton button = new JButton("color");
       public static void main(String args[]) {
          textpaneColor obj = new textpaneColor();
          obj.showMe();
       void showMe() {
          button.addActionListener(new buttonListener());
          setSize(200,200);
          getContentPane().setLayout(new BorderLayout());
          getContentPane().add(tp, BorderLayout.CENTER);
          getContentPane().add(button, BorderLayout.SOUTH);
          setVisible(true);
       class buttonListener implements ActionListener {
          public void actionPerformed(ActionEvent e) {
             SimpleAttributeSet set=new SimpleAttributeSet();
             StyleConstants.setForeground(set,Color.BLUE);
             StyledDocument doc=tp.getStyledDocument();
             doc.setParagraphAttributes(0,999999,set,true);
    };o)
    V.V.

  • Issues with JScrollPane

    Hi everybody
    I created a class to display help dialogs dynamically created, because I'll need lots of help windows.
    I decided to created it based on 2-dimensional arrays of data. Up till here, everything is fine.
    But I'm facing some problems with the GUI, basically my scroll pane. my problems:
    - first, the vertical scrollbar was not being displayed, which I fixed setting the panel size with the viewport width, but that leaves me the problem of the height... it will change because of the width, and I don't know what value to use...
    - changing between pages, my scroll bar goes to different values, and setting its value to 0 doesn't help...
    - if there the window is made very small, sometimes some of the components placed inside the helpPanel overlaps each other... is there a way to fully avoid that?
    my class code:
    import java.awt.Component;
    import java.awt.Dialog;
    import java.awt.Dimension;
    import java.awt.GridBagConstraints;
    import java.awt.GridBagLayout;
    import java.awt.Image;
    import java.awt.Insets;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.ComponentEvent;
    import java.awt.event.ComponentListener;
    import javax.swing.ImageIcon;
    import javax.swing.JButton;
    import javax.swing.JCheckBox;
    import javax.swing.JDialog;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTextArea;
    import javax.swing.text.Document;
    public class HelpWindow extends JDialog implements ActionListener {
        private Object[][] helpData;
        private JPanel helpPanel;
        private JButton /*closeButton,*/ nextButton, prevButton;
        JScrollPane helpScrollPane;
        private int currentHelpDataIndex;
        public HelpWindow(Dialog owner, Object[][] helpData) {
            super(owner,"Help",true);
            if (helpData.length < 1) {
                throw new IllegalArgumentException("the help data cannot be empty");
            for (Object[] oa : helpData) {
                if (oa.length < 1)
                    throw new IllegalArgumentException("no help data page can be empty");
                for (Object o : oa) {
                    if (o == null)
                        throw new NullPointerException();
            this.helpData = helpData;
            setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
            initGUI();
            currentHelpDataIndex = 0;
            updateGUI();
        private void initGUI() {
            setLayout(new GridBagLayout());
            GridBagConstraints gbc = new GridBagConstraints();
            gbc.insets = new Insets(2,2,2,2);
            //help panel
            gbc.fill = GridBagConstraints.BOTH;
            gbc.weightx = 1;
            gbc.weighty = 1;
            helpPanel = new JPanel();
            helpScrollPane = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
            helpScrollPane.getViewport().setView(helpPanel);
            add(helpScrollPane,gbc);
            //buttons panel
            gbc.fill = GridBagConstraints.HORIZONTAL;
            gbc.weightx = 0;
            gbc.weighty = 0;
            gbc.gridy = 1;
            JPanel buttonsPanel = new JPanel();
            buttonsPanel.setLayout(new GridBagLayout());
                GridBagConstraints gbcBp = new GridBagConstraints();
                //next/previous buttons
                gbcBp.fill = GridBagConstraints.HORIZONTAL;
                gbcBp.weightx = 1;
                prevButton = new JButton("<<");
                prevButton.setEnabled(false);
                prevButton.addActionListener(this);
                buttonsPanel.add(prevButton,gbcBp);
                nextButton = new JButton(">>");
                nextButton.setEnabled(false);
                nextButton.addActionListener(this);
                gbcBp.gridx = 1;
                buttonsPanel.add(nextButton,gbcBp);
                /*//close button
                gbcBp.fill = GridBagConstraints.NONE;
                closeButton = new JButton("Close");
                closeButton.addActionListener(this);
                gbcBp.gridx = 0;
                gbcBp.gridy = 1;
                gbcBp.gridwidth = 2;
                buttonsPanel.add(closeButton,gbcBp);*/
            add(buttonsPanel,gbc);
            addComponentListener(new ComponentListener(){
                public void componentResized(ComponentEvent e) {
                    helpPanel.setPreferredSize(
                            new Dimension(
                                    (int)helpScrollPane.getViewport().getPreferredSize().getWidth(),
                                    (int)helpPanel.getPreferredSize().getHeight())
                    helpPanel.revalidate();
                public void componentMoved(ComponentEvent e) {}
                public void componentShown(ComponentEvent e) {}
                public void componentHidden(ComponentEvent e) {}
        private void updateGUI() {
            updateHelpData();
            updateNavigationButtons();
        private void updateHelpData() {
            helpPanel.removeAll();
            helpPanel.repaint();
            //insert data again
            Object[] data = helpData[currentHelpDataIndex];
            helpPanel.setLayout(new GridBagLayout());
            GridBagConstraints gbc = new GridBagConstraints();
            gbc.insets = new Insets(2,2,2,2);
            gbc.weightx = 1;
            //gbc.weighty = 1;
            for (int i = 0; i < data.length; i++) {
                Object currentData = data;
    gbc.gridy = i;
    //images - turned into labels
    if (currentData instanceof Image) {
    JLabel label = new JLabel();
    label.setIcon(new ImageIcon((Image)currentData));
    currentData = label;
    if (currentData instanceof Component) {
    //components - added as-is
    gbc.fill = GridBagConstraints.NONE;
    gbc.anchor = GridBagConstraints.CENTER;
    //gbc.weightx = 1;
    helpPanel.add((Component)currentData,gbc);
    } else {
    //everyting else - as text
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.anchor = GridBagConstraints.WEST;
    //gbc.weightx = 0;
    JTextArea textArea;
    if (currentData instanceof Document) {
    textArea = new JTextArea((Document)currentData);
    } else {
    textArea = new JTextArea(currentData.toString());
    textArea.setOpaque(false);
    textArea.setFocusable(false);
    textArea.setLineWrap(true);
    textArea.setWrapStyleWord(true);
    helpPanel.add(textArea,gbc);
    helpScrollPane.getVerticalScrollBar().setValue(0);
    validate();
    private void updateNavigationButtons() {
    prevButton.setEnabled(currentHelpDataIndex != 0);
    nextButton.setEnabled(currentHelpDataIndex < helpData.length-1);
    public void actionPerformed(ActionEvent e) {
    JButton source = (JButton)e.getSource();
    /*if (source == closeButton) {
    dispose();
    } else*/ if (source == nextButton) {
    currentHelpDataIndex++;
    updateGUI();
    } else if (source == prevButton) {
    currentHelpDataIndex--;
    updateGUI();
    public static void main(String[] args) {
    HelpWindow window = new HelpWindow(
    new JDialog(),
    new Object[][]
    {"Java Technology\nSun's home for Java. Offers Windows, Solaris, and Linux Java Development Kits (JDKs), extensions, news, tutorials, and product information.\njava.sun.com/ - 26k - 17 Oct 2006 - Cached - Similar pages",
    "The Java� Tutorials\nFrom the download page, you can download the Java Tutorials for browsing ... The Java Tutorials are practical guides for programmers who want to use the ...\njava.sun.com/docs/books/tutorial/index.html - 13k - Cached - Similar pages\n[ More results from java.sun.com ]",
    new JButton("some button"),
    "Sun Microsystems\nSun Java Enterprise System Every time you log on to My Sun Connection (MSC), you're using Sun Java Enterprise System (JES) products. ...\nwww.sun.com/ - 15k - Cached - Similar pages"},
    {"another page...",
    new JCheckBox("something")}
    window.pack();
    window.setVisible(true);
    System.exit(0);
    many thanks in advance!

    Why are you doing it this way? It is just a help
    displayer right? It would be simplier to just keep
    it as text. Or create an object that can add itself.
    I veiw the instanceof Operator as a bad smell.I did this mainly because these help windows will surely contain images along with the text... so to avoid creating tons of windows, I choose to create this class.
    Did you try using a borderlayout instead of the
    gridbag?
    Put the ScrollPane in the center with the button
    panel at PAGE_END.No use. The problem is the layout management inside helpPanel.
    Messing around, the only (dirty) working solution was recreating the help panel at each resize, and using grid bag for the panel, instead of box layout. And the problem about the scroll bar value is still there...
    It's a workaround... if someone know a better way, tell me please...
    current code:
    import java.awt.Component;
    import java.awt.Dialog;
    import java.awt.Dimension;
    import java.awt.GridBagConstraints;
    import java.awt.GridBagLayout;
    import java.awt.Image;
    import java.awt.Insets;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.ComponentEvent;
    import java.awt.event.ComponentListener;
    import javax.swing.Box;
    import javax.swing.BoxLayout;
    import javax.swing.ImageIcon;
    import javax.swing.JButton;
    import javax.swing.JCheckBox;
    import javax.swing.JComponent;
    import javax.swing.JDialog;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTextArea;
    import javax.swing.text.Document;
    public class HelpWindow extends JDialog implements ActionListener {
        private Object[][] helpData;
        private JPanel helpPanel;
        private JButton /*closeButton,*/ nextButton, prevButton;
        JScrollPane helpScrollPane;
        private int currentHelpDataIndex;
        public HelpWindow(Dialog owner, Object[][] helpData) {
            super(owner,"Help",true);
            if (helpData.length < 1) {
                throw new IllegalArgumentException("the help data cannot be empty");
            for (Object[] oa : helpData) {
                if (oa.length < 1)
                    throw new IllegalArgumentException("no help data page can be empty");
                for (Object o : oa) {
                    if (o == null)
                        throw new NullPointerException();
            this.helpData = helpData;
            setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
            initGUI();
            currentHelpDataIndex = 0;
            updateGUI();
        private void initGUI() {
            setLayout(new GridBagLayout());
            GridBagConstraints gbc = new GridBagConstraints();
            gbc.insets = new Insets(2,2,2,2);
            //help panel
            gbc.fill = GridBagConstraints.BOTH;
            gbc.weightx = 1;
            gbc.weighty = 1;
            helpPanel = new JPanel();
            helpScrollPane = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
            helpScrollPane.getViewport().setView(helpPanel);
            //helpScrollPane.setPreferredSize( new Dimension(300, 300) );
            add(helpScrollPane,gbc);
            //buttons panel
            gbc.fill = GridBagConstraints.HORIZONTAL;
            gbc.weightx = 0;
            gbc.weighty = 0;
            gbc.gridy = 1;
            JPanel buttonsPanel = new JPanel();
            buttonsPanel.setLayout(new GridBagLayout());
                GridBagConstraints gbcBp = new GridBagConstraints();
                //next/previous buttons
                gbcBp.fill = GridBagConstraints.HORIZONTAL;
                gbcBp.weightx = 1;
                prevButton = new JButton("<<");
                prevButton.setEnabled(false);
                prevButton.addActionListener(this);
                buttonsPanel.add(prevButton,gbcBp);
                nextButton = new JButton(">>");
                nextButton.setEnabled(false);
                nextButton.addActionListener(this);
                gbcBp.gridx = 1;
                buttonsPanel.add(nextButton,gbcBp);
                /*//close button
                gbcBp.fill = GridBagConstraints.NONE;
                closeButton = new JButton("Close");
                closeButton.addActionListener(this);
                gbcBp.gridx = 0;
                gbcBp.gridy = 1;
                gbcBp.gridwidth = 2;
                buttonsPanel.add(closeButton,gbcBp);*/
            add(buttonsPanel,gbc);
            addComponentListener(new ComponentListener(){
                public void componentResized(ComponentEvent e) {
                    /*helpPanel.setPreferredSize(
                            new Dimension(
                                    (int)helpScrollPane.getViewport().getPreferredSize().getWidth(),
                                    (int)helpPanel.getPreferredSize().getHeight())
                    helpPanel.revalidate();
                    helpScrollPane.validate();*/
                    //helpPanel.revalidate();
                    //helpPanel.repaint();
                    updateHelpData();
                public void componentMoved(ComponentEvent e) {}
                public void componentShown(ComponentEvent e) {}
                public void componentHidden(ComponentEvent e) {}
        private void updateGUI() {
            updateHelpData();
            updateNavigationButtons();
        private void updateHelpData() {
            helpPanel.removeAll();
            helpPanel.repaint();
            //helpPanel = new JPanel();
            //insert data again
            Object[] data = helpData[currentHelpDataIndex];
            //helpPanel.setLayout(new BoxLayout(helpPanel,BoxLayout.Y_AXIS));
            helpPanel.setLayout(new GridBagLayout());
            //helpPanel.add(Box.createVerticalBox());
            //helpPanel.add(Box.createHorizontalGlue());
            GridBagConstraints gbc = new GridBagConstraints();
            gbc.insets = new Insets(2,2,2,2);
            gbc.weightx = 1;
            //gbc.weighty = 1;
            for (int i = 0; i < data.length; i++) {
                Object currentData = data;
    gbc.gridy = i;
    //images - turned into labels
    if (currentData instanceof Image) {
    JLabel label = new JLabel();
    label.setIcon(new ImageIcon((Image)currentData));
    currentData = label;
    if (currentData instanceof JComponent) {
    //components - added as-is
    gbc.fill = GridBagConstraints.NONE;
    gbc.anchor = GridBagConstraints.CENTER;
    //gbc.weightx = 1;
    JComponent c = (JComponent)currentData;
    c.setAlignmentX(Component.CENTER_ALIGNMENT);
    helpPanel.add(c,gbc);
    } else {
    //everyting else - as text
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.anchor = GridBagConstraints.WEST;
    //gbc.weightx = 0;
    JTextArea textArea;
    if (currentData instanceof Document) {
    textArea = new JTextArea((Document)currentData);
    } else {
    textArea = new JTextArea(currentData.toString());
    textArea.setOpaque(false);
    textArea.setFocusable(false);
    textArea.setLineWrap(true);
    textArea.setWrapStyleWord(true);
    textArea.setAlignmentX(Component.CENTER_ALIGNMENT);
    helpPanel.add(textArea,gbc);
    //helpScrollPane.getViewport().setView(helpPanel);
    helpScrollPane.validate();
    helpScrollPane.getVerticalScrollBar().setValue(helpScrollPane.getVerticalScrollBar().getMinimum());
    private void updateNavigationButtons() {
    prevButton.setEnabled(currentHelpDataIndex != 0);
    nextButton.setEnabled(currentHelpDataIndex < helpData.length-1);
    public void actionPerformed(ActionEvent e) {
    JButton source = (JButton)e.getSource();
    /*if (source == closeButton) {
    dispose();
    } else*/ if (source == nextButton) {
    currentHelpDataIndex++;
    updateGUI();
    } else if (source == prevButton) {
    currentHelpDataIndex--;
    updateGUI();
    public static void main(String[] args) {
    HelpWindow window = new HelpWindow(
    new JDialog(),
    new Object[][]
    {"Java Technology\nSun's home for Java. Offers Windows, Solaris, and Linux Java Development Kits (JDKs), extensions, news, tutorials, and product information.\njava.sun.com/ - 26k - 17 Oct 2006 - Cached - Similar pages",
    "The Java� Tutorials\nFrom the download page, you can download the Java Tutorials for browsing ... The Java Tutorials are practical guides for programmers who want to use the ...\njava.sun.com/docs/books/tutorial/index.html - 13k - Cached - Similar pages\n[ More results from java.sun.com ]",
    new JButton("some button"),
    "Sun Microsystems\nSun Java Enterprise System Every time you log on to My Sun Connection (MSC), you're using Sun Java Enterprise System (JES) products. ...\nwww.sun.com/ - 15k - Cached - Similar pages"},
    {"another page...",
    new JCheckBox("something")}
    window.setPreferredSize(new Dimension(300,300));
    window.pack();
    window.setVisible(true);
    System.exit(0);

  • Photoshop Elements 7 Slideshow Pan & Zoom issues with imported pictures

    I am using PSE7 on a Windows XP machine. When I create a slideshow, I have the default set to pan and zoom the pictures. If I add pictures that are already in my catalog, it works great and will apply a random pan and zoom to each of the pictures. If, however, I add a picture from a folder and choose pictures that are not already in my catalog, it will add the picture to the slideshow but will not apply a pan and zoom to it (even though I said that it should). I can then manually add it, but it is not random, it always uses the same pan and zoom for each picture. In my most recent project, I had over 100 pictures I added to a slideshow that were not in my catalog. They all imported into the slideshow, but had no pan and zoom even though I had the option selected. I then selected all the slides, applied pan and zoom, and they all ended up with the exact same pan and zoom - nothing random. I really wasn't in the mood to manually change all 100+ pictures pan/zoom features. So, I created a new catalog, imported the pictures into the catalog, then created the slideshow, and it worked fine. Then, since I don't want those photos in a catalog, I delete the catalog. A lot of extra steps for something that I think should work no matter if you are importing files from the catalog or files from a folder. Or am I just doing something wrong?

    Paul,
    Since I do catalog photos which I will be using a slide show, I guess that I may never experience this bug. I am curious about whether there is any difference in the behavior depending on whether these photos are from a digital camera or scanned photos?
    Howeer, I do agree with your conclusion that since the slide show does support adding photo files (that are not in the Catalog) directly from their folder location into the slide show, it should apply random pan and zoom consistently.
    Here is a link to the process to report that bug to Adobe -
    http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform

  • Is anyone else having zoom issues with iPhone 5 camera

    iPhone 5s camera is not capturing the pictures I zoom in on.  It cuts them off or takes only a part of them.  Also I keep getting a little green dot on my pictures, and am no longer effectively able to manage the light differentiation via touching the screen.  In my opinion, there are a lot of problems with the camera on this phone

    I, too, am having this problem and wonder if it is a defect.  A co-worker with the I-phone 5 does not seem to have the same problem.

  • Is apple going to fix the magic trackpad issue with Autocad zoom/pan soon? It only started happening when I updated to Yosemite

    is apple going to fix the magic trackpad issue with Autocad zoom/pan soon?
    It only started happening when I updated to Yosemite
    I am using macbook pro 15" Retina

    Although it not only bothers me but alot of other photo booth users aswell

  • Lion / Safari 5.1 has issues with the pinch/zoom (embedded links don't zoom correctly)

    Ever since upgrading to Lion Safari 5.1 has issues with the pinch/zoom.  Any embedded link does not zoom in proportion to the surrounding page and it makes it unusable. (the embedded link zooms much more).  Any ideas?  This makes safari almost unusable for many webpages.
    Is there a fix to this?  Or can I consider uninstalling 5.1 and rolling Safari back to 5.05?  Not sure if this is a Lion issue or a Safari issue.  Everything worked great prior to Lion. 
    (I have to say, Lion has been more annoying than beneficial to this point!)

    Here are 2 screenshots of the issue (before and after a zoom)  see how the add in the first one that shows 25% off in the first picture zoomed too large after the zoom to see the whole thing?

  • Issues with converting to PDF and zoom size

    I've created a Captivate file and converted this to Adobe PDF - when we have tested the output we notice a white edge on the left and bottom side of the document and encounter issues with 'zoom' on pdf - when its 100% its fine (apart from the white edge), but when we reduce the zoom it covers the project and exposes only a small amount of it.
    Any ideas?

    I've created a Captivate file and converted this to Adobe PDF - when we have tested the output we notice a white edge on the left and bottom side of the document and encounter issues with 'zoom' on pdf - when its 100% its fine (apart from the white edge), but when we reduce the zoom it covers the project and exposes only a small amount of it.
    Any ideas?

  • Issue with JButton clicking

    Hi guys,
    I'm having an issue with a JTable, I hope you can help me.
    Last cells of each row is a JButton and my issue is with click on that button.
    In fact, it's required clicking two times to run code linked to listener for the same button.
    What I need is clicking just one time to run code, not two times.
    This is code to build Table:
    private JTable getJTable() {
              if (jTable == null) {
                   jTable = new JTable();
                   jTable.setModel(new MyTableModel());
                   final MyTableModel tabella = (MyTableModel) jTable.getModel();
                   Vector<String> nameColumn = new Vector<String>();
                   nameColumn.addElement("Cliente");
                   nameColumn.addElement("Data");
                   nameColumn.addElement("Esito");
                   nameColumn.addElement("Immagine");
                   nameColumn.addElement("Dettagli");
                   tabella.setColumnIdentifiers(nameColumn);
                   tabella.setElencoDiagnosi(true);
                   final Vector<Diagnosi> elencoDiagnosi = gestioneDiagnosi.selectAllDiagnosi();
                   jTable.getColumn("Dettagli").setCellRenderer(new PanelRender());
                 jTable.getColumn("Dettagli").setCellEditor(new PanelEditor());
                 jTable.getColumn("Immagine").setCellRenderer(new PanelRender());
                 jTable.getColumn("Immagine").setCellEditor(new PanelEditor());
                 jTable.setRowHeight(36); //Metto un altezza che mi consenta di vedere tutto il bottone
                 JButton[] arrayButtonDettagli = new JButton[elencoDiagnosi.size()];
                 JButton[] arrayButtonImmagini = new JButton[elencoDiagnosi.size()];
                 for (int i=0;i<elencoDiagnosi.size(); i++)
                      final int contatore=i;
                      arrayButtonDettagli[i] = new JButton("Elenco Dettagli");
                      arrayButtonDettagli.addActionListener(new ActionListener() {
                             public void actionPerformed(ActionEvent e)
                                  Diagnosi diagnosi=elencoDiagnosi.get(contatore);
                                  GUIElencoDiagnosi.this.dispose();
                                  GUIModificaDiagnosi modificaDiagnosi =
                                       new GUIModificaDiagnosi(OrthoLabMain.listaUtenti,
                                            risultati,diagnosi);
                                  modificaDiagnosi.setVisible(true);
              final Diagnosi diagnosi=elencoDiagnosi.get(i);
              arrayButtonImmagini[i] = new JButton(new javax.swing.ImageIcon(getClass().getResource("/image/jpg-icon.gif"))) ;
              arrayButtonImmagini[i].setSize(36, 36);
              arrayButtonImmagini[i].setBackground(Color.WHITE);
              arrayButtonImmagini[i].addActionListener(new ActionListener() {
                             public void actionPerformed(ActionEvent e)
                                  JOptionPane.showMessageDialog(null,"","Zoom Immagine",
                                            JOptionPane.INFORMATION_MESSAGE,new ImageIcon(diagnosi.getImmagine()));
              Object[] row = new String[4];
              row[0]=diagnosi.getCognomeCliente()+" "+diagnosi.getNomeCliente();
              String dataviewanno=diagnosi.getData().substring(0, 4);
              String dataviewmese=diagnosi.getData().substring(4,6);
              String dataviewgiorno=diagnosi.getData().substring(6, 8);
              row[1]=dataviewgiorno+"/"+dataviewmese+"/"+dataviewanno;
              row[2]=diagnosi.getEsito();
              tabella.addRow(row);
              tabella.setValueAt(arrayButtonImmagini[i],i, 3);
                        tabella.setValueAt(arrayButtonDettagli[i], i, 4);
              return jTable;
    This is code for CellRender and CellEditor (written ad hoc)Cell renderer (PanelRenderer)
    public class PanelRender extends DefaultTableCellRenderer {
         private static final long serialVersionUID = 1L;
         public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
    if(value instanceof JComponent) {
    return (JComponent)value;
    } else {
    return super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
    Cell Editor (PanelEditor)
    public class PanelEditor extends AbstractCellEditor implements TableCellEditor {
         private static final long serialVersionUID = 1L;
         private JComponent panel = null;     
         public Object getCellEditorValue() {
              return panel;
         public Component getTableCellEditorComponent(JTable table, Object value,
                   boolean isSelected, int row, int column) {
              panel = (JComponent)value;
              return panel;
    Could you help me?
    Thanks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Thanks Ryan,
    I solved my issue with your help. Now I've a bit issue, that is I can't see icon on my button, it seems like toString method is displayed instead icon.
    For table renderer I use a new class that implements TableCellRenderer, while for model I use a new class that extends DefaultTableModel.. In the following some code...please help me, icon on button aren't shown! Thanks
    private JScrollPane getJScrollPane(Vector<Diagnosi> ris) {
              if (jScrollPane == null) {
                   TableCellRenderer defaultRenderer;
    final MyTableModel tabella = (MyTableModel) jTable.getModel();
                   defaultRenderer = jTable.getDefaultRenderer(JButton.class);
                   jTable.setDefaultRenderer(JButton.class,
                               new PanelRender(defaultRenderer));
                   jTable.getColumn("Immagine").setCellRenderer(defaultRenderer);
                   jTable.getColumn("Immagine").setCellEditor(new PanelEditor());
                   jTable.getColumn("Regolo").setCellRenderer(defaultRenderer);
                   jTable.getColumn("Regolo").setCellEditor(new PanelEditor());
                   jTable.getColumn("PDF").setCellRenderer(defaultRenderer);
                   jTable.getColumn("PDF").setCellEditor(new PanelEditor());
                   jScrollPane.setViewportView(jTable);
              return jScrollPane;My Table Model
    public class MyTableModel extends DefaultTableModel {
              public MyTableModel(Object[][] data, Object[] columnNames) {
                 super(data, columnNames);
              public MyTableModel(){
                   super();
              public boolean isCellEditable(int row, int column) {
                   if(elencoClienti){
                        if(column!=5)
                             return false;  
                        else return true;
                   else if(elencoDiagnosi){
                        if(column<3)
                             return false;
                        else return true;
                   else if(clientiLista)
                        return false;
                   else if(diagnosiLista){
                        if(column<3)
                             return false;  
                        else return true;
                   else if(clientiPerDiagnosi){
                        if(column!=3)
                             return false;
                        else return true;
                   else return false;
         }Panel Editor
    public class PanelEditor extends AbstractCellEditor implements TableCellEditor {
         private static final long serialVersionUID = 1L;
         private JComponent panel = null;     
         public Object getCellEditorValue() {
              return panel;
         public Component getTableCellEditorComponent(JTable table, Object value,
                   boolean isSelected, int row, int column) {
              panel = (JComponent)value;
              return panel;
    }

  • Connectivity Issues with USB 3 ports on macbook pro

    Hi,  I have a zoom r24 which is no longer working as an audio interface with my new macbook pro.  I have read a lot about issues with USB 2 devices not being compatible with USB 3 ports on the macs. This seems to be midi as well as audio devices.  Can anyone recommend or point me to a list of supported devices for both audio and midi which are guaranteed to work with a late 2013 macbook pro retina display.  I cant afford a thunderbolt device.  Thanks steve

    Just a wild thought here, but have you tried inserting a powered USB 2.0 hub between the MacBook and the interface?

  • Issues with lines across the screen, as well as freezing

    Issues with lines across the screen, as well as freezing
    Hello all
    Got an iMac since January 2008 and I do like it a lot, even though it has some issues:
    -- It displays (quite often) lines partially across the screen
    -- Lines appear as well when opening applications or when menus come up
    -- The system freezes more than I like to admit (more than my Windows/Ubuntu box)
    I don't know if the freezing has to do with the lines that are shown on my screen. But I assume that both issues relate to some video card problem. I can't be sure - but that's what I assume from living with this issue day to day.
    The line on the desktop (most of the time it is there before login) I can always get rid of by changing the display resolution to something else and then changing it back. Normally the line is gone, or, reappears on a different spot on the desktop. But repeating the procedure removes the line.
    However, this does not mean that the lines are not showing up again when launching apps or displaying menus!
    And since those lines appear to happen randomly, I think it's safe to assume that we're not talking dead pixels here, either...
    About the freezing:
    My iMac freezes sometimes when I move the mouse around, when switching desktops using "spaces" or when the zoom function of the Dock kicks in. Sometimes the screen goes completely black, sometimes completely white. The mouse, however, always works. But the system requires a reboot.
    Again, this happens too often to feel comfy about it.
    With my little knowledge of Mac troubleshooting I assume that there's something wrong with the ATI card that's built into my Mac. On the other hand, some people say that they started getting similar issues after updating their OS to Leopard. Again other people say that such issues stem from an ATI revision that is too old and the Mac should get a new ATI card. And how would that work? Isn't that an "all-in-one" machine with everything soldered onto the mainboard?
    So, any help in this matter is greatly appreciated...
    Cheers,
    Rainer

    Here are a few screen photos I've taken (not screenshots, as the lines are not visible when taking screenshots. I used my digicam to snap those...).
    Here's the link to those screen photos displaying some of the many lines I keep having:
    http://picasaweb.google.com/rainer.rohde/NewAlbum62508115AM
    Needless to say, as I typed this message here, I had a nice line going across my Safari window..
    Cheers,
    Rainer

  • [Applet]Printing issue with pdf files on Xerox 4595

    Greetings !!
    I'm trying to print to a Xerox 4595 printer from a Windows XP station (limited account) using a Java Web Applet.
    This applet generates pdf files which have to be printed.
    The Xerox 4595 uses a printing queue that is detected by the Applet.
    The problem is the following: usually when printing a simple local file from this computer there is a box that asks you your login to let you create a job and then print.
    When using the Java Applet, there is no way to have this print box displayed. We have the Java Print Dialog but once clicked on "Print" there is no box displayed to pass the login to the printer and let us print.
    Is anyone already worked with Xerox 4595 and experienced such issue ?
    How can I, using the Java language and modify the Applet, ask the printer to send me the dialog box asking for the login ? Without this login no jobs are accepted and we can't print the generated pdf files.
    I looked on the printer queue settings and it seems that the Xerox uses the IPP to communicate with the local computers in the office.
    The server from which the Applet is used is a openSuSE Linux Web server (apache2)
    How come using Linux workstations any pdf files are printed (on shared printers such HP laserjet) and under windows there is jammed characters and sheet feed instead ?

    A lot can depend upon which app your are using on your tablet device, the same applies to computer programs but apps are much worse.
    Which app are you using?
    I would try the free Adobe Mobile Reader. This product seems to support more features than other apps.
    There could even be issues with the type of tablet you are using. The Apple line may work better then Android devices since there is QA check and approval by Apple.
    Another factor is the how the PDF was created.
    How well are the maps displayed on your laptop or desktop? Try different values of zoom.

  • Mac Pro 6,1 STILL having issues with Open CL (4K scaling and SpeedGrade direct link grades)

    I've seen the staff responses to the issues of the new Mac Pro GPU saying that 10.9.4 fixes everything. For me, it has fixed my export issues, so I'm glad. I'm no longer getting lines and artifacts on my renders.
    That's great.
    However, I'm still having several issues, and they seem to be linked to Adobe and Open CL.
    Here's a video that shows what's going on:
    mac pro issues july 7 - YouTube
    Issue #1
    Like most of you probably, I'm doing 1080p exports of most things I'm working on. The first project shows a 1080p timeline with a mix of 4k, 5k, and 720p footage. Because zooming in so much on a 720p file in a 4k timeline looks so crappy, I'm doing 1080p timelines and scaling everything to the size it needs to be. I started in a 4k timeline then switched to 1080p because the 720p footage looked so terrible. However, in the 4k timeline, I didn't have any of the issues I'm showing in this first part of the video.
    When I switched to the 1080p timeline, I discovered a weird quirk: When I resize the 4k (or 5k) footage to the size it needs to be (which varies based on the frame I want), it goes back to the 100% view when I'm scrubbing through it. When I pause, the size of the video goes back to the way I set it. I show this in the video. Then I show what was my working solution for the time being: "scale to frame size", which brings all the videos to the size of the sequence frame size and works fine. Later, I turn off OpenCL in premiere and when I scrub through the video, it doesn't zoom back in or only stay at the size I set when stopped. For some reason all of these issues only happen at 50% scale or smaller. It doesn't happen at, say, 60%.
    I've tested this with raw R3D files and other 4K (or 5K) clips (even clips exported from After Effects) and the same thing happens. It doesn't seem to happen with 2.5k footage or 1080p footage.
    Issue #2
    This is the second project you'll see in the video.
    After grading in speedgrade (through direct link) I open my project back up in premiere and start playing it back. The video plays back with delays and frame drops. Now normally, this would be expected. But this is 1080p pro res footage, and this is just an effect added, and the yellow bar appears indicating that open CL should be accelerating the playback and it should do so smoothly.
    Maybe I was just wrong in assuming that a simple grade from speedgrade would be able to playback smoothly. I turn off the grade, and it plays normally.
    But then, when I turn off open cl and leave the grade on, the video plays back without ANY issues.
    So to me, it seems I'm still having issues with Open CL and adobe. I've found fixes that make it work temporarily, I don't need that kind of answer. However, I would like this to work. Is there something I'm doing wrong? Something I need to do to get this to work?
    Here are my specs:
    Mac Pro 6,1 (Late 2013)
    3 GHz 8-Core Intel Xeon E5
    64 GB 1867 MHz DDR3 ECC
    AMD FirePro D700 6144 MB (x2)
    OSX 10.9.4
    Firmware: 2.20f18
    What you're seeing is latest version of Premiere (CC 2014, v8.0.0 [169] Build)
    Everything here is ProRes 422, running from a Promise Pegasus2 R4 RAID (drives: 4x Seagate Desktop HDD 4 TB SATA 6Gb/s NCQ 64MB Cache 3.5-Inch Internal Bare Drive ST4000DM000) (that's thunderbolt 2).
    I've done everything: I've restarted my computer hundreds of times, I've reset NVRAM and PRAM and done power cycles.
    This isn't just some issue that started with 10.9.3 of OSX, the 4k issues happened when I first switched to a 1080p sequence back in February (2014) or so, which means it was an issue even with 10.9.2 and the previous firmware release.
    I've reported this issue to adobe.

    That crash appears to be casued by the Facebook plug-in.
    Create a new account (systempreferences -> accounts or Users & Groups on 10.7 and 10.8), make a new Library in that account, import some shots  and see if the problem is repeated there. If it is, then a re-install of the app might be indicated. If it's not, then it's likely the app is okay and the problem is something in the main account.

  • Zoom issues in IOS 8

    I am having the same issue with the zoom, once I triple tap to activate zoom works fine for a bit then the whole OS seems to lock up, at which point I have to restart the iPad and then triple to to turn zoom off, by the way this happens on both the iPad and iPhone, this issues really needs to be fixed.
    Now with the other issues of the zoom going from full screen back into windows mode, I think I found a work around.  I Noticed this issue several months back I would go into settings and change it to full screen mode and at some point it would go back into window mode, when I checked in setting it was still set to full screen so I would uncheck it then recheck it want back into full screen mode for a bit and would go the same.  Then I noticed it only happened when the keyboard was called it would window the screen and keep the keyboard at normal size when I finished with the keyboard zoom stayed in window mode, this in my opinion is a bug so this is how I fixed this issue for anyone who is having the problem.
    1 Go to settings-General
    2 Go to accessibility
    3 Go to Zoom
    4 turn on Follow Focus
    5 Turn on Zoom Keyboard
    This should take care of that issue, I do not like the keyboard being on zoom but that is the only way for now to keep zoom in full screen.  Once I did this it has never gone into Window Mode again.  What I do is zoom when I want to see something and triple tap out of zoom to use the keyboard.
    This is my issue with Apple again IOS 8 seems half baked, I expect bugs in any OS that is the nature of the beast, but issues like lockups and things going in and out of modes seem to be nothing more than laziness on Apple's part. 

    Use iTunes to restore your iOS device to factory settings

  • Possible GPU Issues With Camera Raw 6.6

    Over the past day on my Windows 7 x64 workstation I've done some updates.  Specifically:
    The Adobe updater brought in Camera Raw 6.6, replacing 6.5.
    I updated the to the ATI Catalyst 11.12 display driver version from previous version 11.11.
    I allowed Windows Update to apply the dozen or so changes that were pending.
    I was just doing some OpenGL testing with Photoshop CS5 12.0.4 x64 and I noticed that under some conditions I saw Photoshop drop out of OpenGL acceleration.  Specifically, when I opened a Canon 5D Mark II image through Camera Raw I saw subsequent operations stop using OpenGL acceleration even though the checkmark remained in the [  ] Enable OpenGL Drawing box in Edit - Preferences - Performance.
    What I did to determine whether OpenGL acceleration was enabled was this:  Select the Zoom Tool, then click and hold the left mouse button on the image.  When OpenGL is enabled, I see a smooth increase in zoom.  When it goes disabled, I see only a jump in zoom level after letting up the mouse button.  Also, the [  ] Scrubby Zoom box gets grayed out.  As I mentioned, even in this condition, a check of Edit - Preferences - Performance still shows OpenGL enabled.
    Just as a control, I saved the converted file as a PSD, and every time I opened THAT file (with a fresh copy of PS CS5 running) and did the same operations I could not reproduce the failure.  The difference being I did not run Camera Raw.
    Since I wasn't specifically looking for issues with Camera Raw, I am not sure that the problem occurred every time I did run Camera Raw.  I do know that when I open images from my own camera (40D; I do not own a 5D Mark II) that the problem doesn't seem to occur.  Notably I always open my image from Camera Raw to the largest possible pixel size - 6144 x 4096, as I did with the 5D Mark II image, so it's not an obvious size difference that's leading to the issue.  Given other comments of late, I'm wondering if it could be a specific issue with conversions of files from 5D Mark II.
    Nor am I sure whether any of the above updates caused it - it might done this before; I don't regularly convert 5D Mark II images.  I DO think I would have noticed Photoshop reverting to GDI operation before, since I just noticed it pretty easily, but I'm not completely sure of that either.  I do use OpenGL-specific features (such as right-click brush sizing) pretty often.
    I'm trying now to find a set of steps with which to reliably reproduce the problem now, and will advise.
    -Noel

    Figures.  Now I can't reproduce the problem at all, even after an hour of testing.  It probably had nothing to do with Camera Raw.
    I wonder if there are latent GPU status indicators and config values stored by Photoshop based on its specific environment that might not be right for the first run (or first few runs) after a display driver update.  Hm....
    -Noel

Maybe you are looking for