Can I resize undecorated JDialog with mouse?

Hi all,
I use a undecorated JDialog as a message panel in my application, but I can't resize it with my mouse. Can this be achieved?

It's not like Photoshop resizing at all - Flash is a vector
engine, not a
bitmap engine. Depending on the image and how much you are
scaling it, it
can look OK scaled, but it'll never be as good as in Pshop.
Dave -
www.offroadfire.com
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/

Similar Messages

  • Why can't I minimise itunes with mouse double click?

    why can't I minimise itunes with mouse double click?

    I do not know if you can ..
    Try -
    Command + M .

  • Can i zoom in timeline with mouse scroll up

    can i zoom in timeline with mouse scroll up&down roller?
    i need it so much. but keyboard only edits with keys. not mouse

    No. Use '-' or '=' keys.
    Please don't tell me you did not know: but keyboard only edits with keys. not mouse

  • InDesign CC 2014 can no longer drag objects with mouse

    I have been using InDesign for months with no problems but suddenly I am having mouse issues. I can use my mouse to resize objects and make selections but dragging objects in the document or in panels (for example, reordering spreads) no longer works. I am using a mac on the latest 2014 CC release of InDesign, and have tried all the usual tricks (Ctrl + Alt + Shift + Cmd on startup to remove preferences, manually deleting preferences (both files), reloading software, rebooting machine, reinstalling InDesign) but the only thing that works is rebooting the machine.
    However, within 20-30 minutes after a reboot, the problem returns out of nowhere. I don't use plugins with InDesign and haven't changed hardware or software recently so I have no idea what's causing this.
    Does anyone have any info that might help me out? From googling around, it seems most people have solved their problems after a preferences dump, but mine keeps on coming back!

    I've actually been discussing this problem in another thread but this one is dedicated to it.
    This cropped up for me prior to the New Year and I've found no solution. I actually did what Steve Werner suggested this week and created a new OS X account. But the problem cropped up in the new account today.
    I don't know if this is a common or not. I'm part of a large creative team and as far as I know, I'm the only user experiencing this. I've trashed preferences, uninstalled and reinstalled InDesign, restarted the computer, etc. Nothing works.

  • Why can I now highlight text with mouse pointer in Adobe Reader 9

    I just downloaded Adobe Reader X. I think I prefer Reader 9. I don't like being able to click in the document and have a flashing place mark (right terminology?) there. This is now happening in the Reader 9 version too, and I can copy text this way, but I don't want this. I didn't change any preferences. Can anyone help?

    Like I said, I didn't change any of the preferences, so I don't know why this happened. I think it only happened after I opened Adobe Reader X. I see no options in preferences for turning on or off the ability to highlight text with your mouse pointer, and I thought you were not supposed to be able to do this in Adobe Reader 9.

  • Pages '09: Can't select multiple objects with mouse?

    Hello! I want to select some shapes. I know that I can hold down shift and click on them individually one by one, but they're very many and grouped together, so I just want to draw a 'selection-rectangle' with the mouse, just as it works in all other programs I've ever used. But this doesn't seem to work. What am I doing wrong?

    Hello Stef,
    You can simply click and drag over an area to select multiple objects if you are in a Page Layout document, but since this is your fourth post you may be new to Pages and you may not yet even be aware of the Page Layout mode. At the top of your Pages window is the document title and next to the title in parentheses are the words "Word Processing" or "Page Layout".
    So, in a Word Processing document, it's just a little bit more involved. In the upper left corner of the window, click on the View icon and select "Show Layout". You will see gray around the edges - your desktop, a white sheet - your paper, and three rectangular outlines - the header field, the text frame and the footer field. This assumes that you have the Header and Footer turned on.
    As you move your mouse, the text insertion bar, a vertical line with curved features top and bottom, will move about the document. Move the insertion bar to the margin, outside of the boxes, and press and hold the COMMAND key. Your cursor will change to an arrowhead. Now you can select multiple objects by click-dragging, just as you are accustomed to doing in other applications.
    Regards,
    Jerry

  • I can't resize new rectangles with the new Illustrator 2014

    I know from reading other boards that there are related issues with snapping to grid but I'm having an issue only with resizing rectangles when I create them new. We have others in our company using Creative Cloud that have updated and they are not having the same issue I am having.
    Basically when I create any new rectangle, or rounded corner rectangle it is a fixed size and I am not given the handles to resize it. I have to select the object then go to Object > Shape > Expand Rectangle in order to get the corners to grab and reshape or resize. I have checked and unchecked all of the settings that I can see or read about and nothing changes this. It's a real pain to have to go through this with every object I create.
    I have also tried rebooting the software and my computer several times but it's still the same.
    Am I just missing some small setting somewhere?

  • Can't select desktop items with mouse...

    Good day,
    I am having an issue with a G4 Quicksilver workstation at my office that is running OS 10.4.10. it seems that i can not use my mouse to select any items on my desktop. i can tab through all of the items, and my mouse is able to work the menus fine, but i cannot open or even select anything that is on the desktop, including my dock. has anyone else ever heard of such a problem, and if so, is there a simple fix for it?
    thanks in advance,
    cr

    Hi Chris,
    Try reinstalling the drivers that came with the mouse.
    Carolyn

  • How can i resize a image with changing good quality?

    i do not know how to resize a image and display to let the user view immediately.
    I hope somebody can teach me and show the completed coding

    Look at BufferedImage getScaledInstance

  • Can't scroll between photos with mouse anymore?

    I am just beginning to use iPhoto 08, and have noticed that now when I am viewing one of my photos, there are no arrows to move on to the next (or previous) photo as there was in iPhoto 06. Also, I remember there used to be a bar of images across the top of the screen so that if I was viewing one photo and wanted to move on to the next one without exiting back to the menu, I could just click that photo.
    Has this functionality been removed with iPhoto 08? Is the only way to scroll between photos (when they're being viewed in the window) to use the keyboard arrow keys? Or to exit out of the picture view and back to the main menu of pictures?

    hiddenmuse
    Here's the difference:
    When you double clicked on a pick in v6 it brought you to edit view: A strip of pics across the top and the right/left arrows lower right, all in the main window.
    To do this in v7 click on the edit button.
    Or: iPhoto -> Preferences -> General -> Double click photo: and select 'Edits Photo'
    Regards
    TD

  • Flashing undecorated JDialog on resize+setLocation

    Hi everyone
    I have a undecorated JDialog with custome resize code. Here is a part of my code
              frame.setUndecorated(true);
              frame.addMouseListener(new MouseListener()
                        public void mousePressed(MouseEvent e)
                             sp = e.getPoint();
                             compStartHeight = frame.getSize().height;
                             compStartWidth = frame.getSize().width;
                             frameLoc = frame.getLocation();
                        public void mouseEntered(MouseEvent e)
                        public void mouseExited(MouseEvent e)
                             if (sp == null)
                                  frame.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
                        public void mouseClicked(MouseEvent e)
                        public void mouseReleased(MouseEvent e)
                             sp = null;
              frame.addMouseMotionListener(new MouseMotionListener()
                        public void mouseMoved(MouseEvent e)
                             Point p = e.getPoint();
                             if (p.y > e.getComponent().getSize().height - 5)
                                  if (p.x < 5)
                                       frame.setCursor(Cursor.getPredefinedCursor(Cursor.SW_RESIZE_CURSOR));
                                  else if (p.x > e.getComponent().getSize().width - 5)
                                       frame.setCursor(Cursor.getPredefinedCursor(Cursor.SE_RESIZE_CURSOR));
                                  else
                                       frame.setCursor(Cursor.getPredefinedCursor(Cursor.S_RESIZE_CURSOR));
                             else if (p.y < 5)
                                  if (p.x < 5)
                                       frame.setCursor(Cursor.getPredefinedCursor(Cursor.NW_RESIZE_CURSOR));
                                  else if (p.x > e.getComponent().getSize().width - 5)
                                       frame.setCursor(Cursor.getPredefinedCursor(Cursor.NE_RESIZE_CURSOR));
                                  else
                                       frame.setCursor(Cursor.getPredefinedCursor(Cursor.N_RESIZE_CURSOR));
                             else
                                  if (p.x < 5)
                                       frame.setCursor(Cursor.getPredefinedCursor(Cursor.W_RESIZE_CURSOR));
                                  else if (p.x > e.getComponent().getSize().width - 5)
                                       frame.setCursor(Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR));
                        public void mouseDragged(MouseEvent e)
                             Point p = e.getPoint();
                             int compWidth = frame.getSize().width;
                             int compHeight = frame.getSize().height;
                             if (frame.getCursor().getType() == Cursor.S_RESIZE_CURSOR)
                                  int nextHeight = compStartHeight+p.y-sp.y;
                                  if (nextHeight > Share.MINIMIZED_HEIGHT)
                                       frame.setSize(compWidth,nextHeight);
                                       frame.validate();
                             else if (frame.getCursor().getType() == Cursor.N_RESIZE_CURSOR)
                                  int nextHeight = compStartHeight+sp.y-p.y;
                                  if (nextHeight > Share.MINIMIZED_HEIGHT)
                                       frame.setLocation(frameLoc.x, frameLoc.y-(sp.y-p.y));
                                       frame.setSize(compWidth,nextHeight);
                                       frame.validate();
                                       //frame.repaint();
                             else if (frame.getCursor().getType() == Cursor.E_RESIZE_CURSOR)
                                  int nextWidth = compStartWidth+p.x-sp.x;
                                  if (nextWidth > Share.MINIMIZED_HEIGHT)
                                       frame.setSize(nextWidth,compHeight);
                                       frame.validate();
                                       //frame.repaint();
                             else if (frame.getCursor().getType() == Cursor.W_RESIZE_CURSOR)
                                  int nextWidth = compStartWidth+(sp.x-p.x);
                                  if (nextWidth > Share.MINIMIZED_HEIGHT)
                                       frame.setLocation(frameLoc.x-(sp.x-p.x), frameLoc.y);
                                       frame.setSize(nextWidth,compHeight);
                                       frame.validate();
                                       //frame.repaint();
                             else if (frame.getCursor().getType() == Cursor.SE_RESIZE_CURSOR)
                                  int nextWidth = compStartWidth+(p.x-sp.x);
                                  int nextHeight = compStartHeight+(p.y-sp.y);
                                  if (nextWidth > Share.MINIMIZED_HEIGHT)
                                       frame.setSize(nextWidth,nextHeight);
                                       frame.validate();
                                       //frame.repaint();
                             else if (frame.getCursor().getType() == Cursor.SW_RESIZE_CURSOR)
                                  int nextWidth = compStartWidth+(sp.x-p.x);
                                  int nextHeight = compStartHeight+(p.y-sp.y);
                                  if (nextWidth > Share.MINIMIZED_HEIGHT)
                                       frame.setLocation(frameLoc.x-(sp.x-p.x), frameLoc.y);                              
                                       frame.setSize(nextWidth,nextHeight);
                                       frame.validate();
                                       //frame.repaint();
                             else if (frame.getCursor().getType() == Cursor.NW_RESIZE_CURSOR)
                                  int nextWidth = compStartWidth+(sp.x-p.x);
                                  int nextHeight = compStartHeight+(sp.y-p.y);
                                  if (nextWidth > Share.MINIMIZED_HEIGHT)
                                       frame.setLocation(frameLoc.x-(sp.x-p.x), frameLoc.y-(sp.y-p.y));                              
                                       frame.setSize(nextWidth,nextHeight);
                                       frame.validate();
                                       //frame.repaint();
                             else if (frame.getCursor().getType() == Cursor.NE_RESIZE_CURSOR)
                                  int nextWidth = compStartWidth+p.x-sp.x;
                                  int nextHeight = compStartHeight+(sp.y-p.y);
                                  if (nextWidth > Share.MINIMIZED_HEIGHT)
                                       frame.setLocation(frameLoc.x, frameLoc.y-(sp.y-p.y));                              
                                       frame.setSize(nextWidth,nextHeight);
                                       frame.validate();
                                       //frame.repaint();
                             else
                                  int x = frame.getX()+p.x-sp.x;     
                                  int y = frame.getY()+p.y-sp.y;     
                                  setLocation(x,y);
                   });Here is the code that can be compile if you want to try ou
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.table.*;
    import java.awt.event.*;
    import java.util.*;
    import javax.swing.event.*;
    import java.text.SimpleDateFormat;
    import java.text.DateFormat;
    import java.net.URL;
    public class TrdHistForm
        private static final int MAX_LINE = Share.MAX_HIST_LINE;
        private static final int ROW_HEIGHT = 20;
        private JDialog frame = new JDialog();
         private JPanel mainPane = new JPanel(new BorderLayout());
         private JPanel titleBar = new JPanel();
         private JLabel title = new JLabel("", JLabel.LEFT);
        private JTable table;
        private TableView view;
        private Vector t;
         private boolean minimized = false; // starts up as normal size window, not minimized
         private Point loc = new Point(0,0);
         private Dimension size = new Dimension(0,0);
         private Point sp;
         private Point frameLoc = new Point(0,0);
         //private Dimension frameSize = new Dimension(0,0);
         private int     compStartHeight;
         private int compStartWidth;
        private static SimpleDateFormat sdf = new SimpleDateFormat("d/MM/yyyy h:mm:ss a");
        private static SimpleDateFormat sdf1 = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
        private static DateFormat format = new SimpleDateFormat("HH:mm:ss");
        private static int PRICE_C = 0;
        private static int VOL_C = 1;
        private static int TIME_C = 2;
        private static int PRICE_W = 70;
        private static int VOL_W = 55;
        private static int TIME_W = 60;
        private static int[] colWidth =
            PRICE_W, VOL_W, TIME_W
        private static String[] colOrgName =
            "price","vol","time"
        private String PRICE_N = "Price";
        private String VOL_N = "Volume";
        private String TIME_N = "Time";
        private String[] colName =
            PRICE_N, VOL_N, TIME_N
         private Color rowColor = new Color(0x00, 0x80, 0x00); //VERY DARK GREEN
        public TrdHistForm()
              minimized = false;
              loc = new Point(0,0);
              size = new Dimension(0,0);
              Dimension butDim = new Dimension(15,15);
              //mainPane.setLayout(new BoxLayout(mainPane, BoxLayout.Y_AXIS));
              //mainPane.setLayout(new BorderLayout());
              //mainPane.setOpaque(false);
              //JPanel upPane = new JPanel();
              setupTitleBar();
              URL url = TrdHistForm.class.getResource("tvbg.JPG");
            ImageIcon icon = new ImageIcon(url);
              mainPane.add(Share.wrapInBackgroundImage(titleBar, icon), BorderLayout.NORTH);
              JPanel butPane = new JPanel(new FlowLayout(FlowLayout.RIGHT));
              JButton but = new JButton("_");
              but.setActionCommand("Minimized");
              but.setToolTipText("Minimized this window");
              but.setMargin(new Insets(0,0,0,0));
              but.setMaximumSize(butDim);
            but.setMinimumSize(butDim);
            but.setPreferredSize(butDim);
              but.addActionListener(this);
              but.setFocusPainted(false);
              butPane.add(but);
              but = new JButton("\u25FB");
              but.setActionCommand("Restore");
              but.setToolTipText("Restore this window to previous location and size");
              but.setMaximumSize(butDim);
            but.setMinimumSize(butDim);
            but.setPreferredSize(butDim);
              but.setMargin(new Insets(0,0,0,0));
              but.addActionListener(this);
              but.setFocusPainted(false);
              butPane.add(but);
              mainPane.add(butPane);
              mainPane.add(Box.createRigidArea(new Dimension(0,1)));
            t = new Vector();
            view = new TableView();
            int colNum = colName.length;
            table = new JTable(view.model);
            // Call custom rendering
            TableColumn column = null;
            for(int i = 0; i < colNum; i++)
                column = table.getColumnModel().getColumn(i);
                column.setCellRenderer(new CustomRenderer());
            // Set up columns' widths
            for (int i = 0; i < colNum; i++)
                column = table.getColumnModel().getColumn(i);
                column.setPreferredWidth(colWidth);
    int i = 0;
    for (int j = 0; j < colWidth.length; j++)
    i = i + colWidth[j];
              //table.setShowGrid(false);
    //table.setOpaque(false);
              //table.setPreferredScrollableViewportSize(new Dimension(i, 500));
              table.setRowHeight(ROW_HEIGHT);
    table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    //table.setGridColor(new Color(239, 239, 239));
    JScrollPane scrollPane = new JScrollPane(table, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
              //scrollPane.setBorder(BorderFactory.createEmptyBorder(0,0,0,0));
              //scrollPane.setOpaque(false);
              //scrollPane.getViewport().setOpaque(false);
              //scrollPane.getVerticalScrollBar().setOpaque(false);
              //scrollPane.getHorizontalScrollBar().setOpaque(false);
              mainPane.add(scrollPane, BorderLayout.CENTER);
              mainPane.setBorder(BorderFactory.createLineBorder(new Color(0x00, 0x66, 0xCC), 3));
              //URL url = AtBestForm.class.getResource("tvbg.JPG");
    //ImageIcon icon = new ImageIcon(url);
              //frame.setContentPane(Share.wrapInBackgroundImage(mainPane, icon));
              frame.setContentPane(mainPane);
    frame.setVisible(false);
    //frame.pack();
              frame.setSize(new Dimension(i, 500));
              //frame.setDoubleBuffered(true);
    //frame.setResizable(false);
    frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
    frame.setLocation(0,0);
              frame.setUndecorated(true);
              frame.addMouseListener(new MouseListener()
                        public void mousePressed(MouseEvent e)
                             sp = e.getPoint();
                             compStartHeight = frame.getSize().height;
                             compStartWidth = frame.getSize().width;
                             frameLoc = frame.getLocation();
                        public void mouseEntered(MouseEvent e)
                        public void mouseExited(MouseEvent e)
                             if (sp == null)
                                  frame.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
                        public void mouseClicked(MouseEvent e)
                        public void mouseReleased(MouseEvent e)
                             sp = null;
              frame.addMouseMotionListener(new MouseMotionListener()
                        public void mouseMoved(MouseEvent e)
                             Point p = e.getPoint();
                             if (p.y > e.getComponent().getSize().height - 5)
                                  if (p.x < 5)
                                       frame.setCursor(Cursor.getPredefinedCursor(Cursor.SW_RESIZE_CURSOR));
                                  else if (p.x > e.getComponent().getSize().width - 5)
                                       frame.setCursor(Cursor.getPredefinedCursor(Cursor.SE_RESIZE_CURSOR));
                                  else
                                       frame.setCursor(Cursor.getPredefinedCursor(Cursor.S_RESIZE_CURSOR));
                             else if (p.y < 5)
                                  if (p.x < 5)
                                       frame.setCursor(Cursor.getPredefinedCursor(Cursor.NW_RESIZE_CURSOR));
                                  else if (p.x > e.getComponent().getSize().width - 5)
                                       frame.setCursor(Cursor.getPredefinedCursor(Cursor.NE_RESIZE_CURSOR));
                                  else
                                       frame.setCursor(Cursor.getPredefinedCursor(Cursor.N_RESIZE_CURSOR));
                             else
                                  if (p.x < 5)
                                       frame.setCursor(Cursor.getPredefinedCursor(Cursor.W_RESIZE_CURSOR));
                                  else if (p.x > e.getComponent().getSize().width - 5)
                                       frame.setCursor(Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR));
                        public void mouseDragged(MouseEvent e)
                             Point p = e.getPoint();
                             int compWidth = frame.getSize().width;
                             int compHeight = frame.getSize().height;
                             if (frame.getCursor().getType() == Cursor.S_RESIZE_CURSOR)
                                  int nextHeight = compStartHeight+p.y-sp.y;
                                  if (nextHeight > Share.MINIMIZED_HEIGHT)
                                       frame.setSize(compWidth,nextHeight);
                                       frame.validate();
                             else if (frame.getCursor().getType() == Cursor.N_RESIZE_CURSOR)
                                  int nextHeight = compStartHeight+sp.y-p.y;
                                  if (nextHeight > Share.MINIMIZED_HEIGHT)
                                       frame.setLocation(frameLoc.x, frameLoc.y-(sp.y-p.y));
                                       frame.setSize(compWidth,nextHeight);
                                       frame.validate();
                                       //frame.repaint();
                             else if (frame.getCursor().getType() == Cursor.E_RESIZE_CURSOR)
                                  int nextWidth = compStartWidth+p.x-sp.x;
                                  if (nextWidth > Share.MINIMIZED_HEIGHT)
                                       frame.setSize(nextWidth,compHeight);
                                       frame.validate();
                                       //frame.repaint();
                             else if (frame.getCursor().getType() == Cursor.W_RESIZE_CURSOR)
                                  int nextWidth = compStartWidth+(sp.x-p.x);
                                  if (nextWidth > Share.MINIMIZED_HEIGHT)
                                       frame.setLocation(frameLoc.x-(sp.x-p.x), frameLoc.y);
                                       frame.setSize(nextWidth,compHeight);
                                       frame.validate();
                                       //frame.repaint();
                             else if (frame.getCursor().getType() == Cursor.SE_RESIZE_CURSOR)
                                  int nextWidth = compStartWidth+(p.x-sp.x);
                                  int nextHeight = compStartHeight+(p.y-sp.y);
                                  if (nextWidth > Share.MINIMIZED_HEIGHT)
                                       frame.setSize(nextWidth,nextHeight);
                                       frame.validate();
                                       //frame.repaint();
                             else if (frame.getCursor().getType() == Cursor.SW_RESIZE_CURSOR)
                                  int nextWidth = compStartWidth+(sp.x-p.x);
                                  int nextHeight = compStartHeight+(p.y-sp.y);
                                  if (nextWidth > Share.MINIMIZED_HEIGHT)
                                       frame.setLocation(frameLoc.x-(sp.x-p.x), frameLoc.y);                              
                                       frame.setSize(nextWidth,nextHeight);
                                       frame.validate();
                                       //frame.repaint();
                             else if (frame.getCursor().getType() == Cursor.NW_RESIZE_CURSOR)
                                  int nextWidth = compStartWidth+(sp.x-p.x);
                                  int nextHeight = compStartHeight+(sp.y-p.y);
                                  if (nextWidth > Share.MINIMIZED_HEIGHT)
                                       frame.setLocation(frameLoc.x-(sp.x-p.x), frameLoc.y-(sp.y-p.y));                              
                                       frame.setSize(nextWidth,nextHeight);
                                       frame.validate();
                                       //frame.repaint();
                             else if (frame.getCursor().getType() == Cursor.NE_RESIZE_CURSOR)
                                  int nextWidth = compStartWidth+p.x-sp.x;
                                  int nextHeight = compStartHeight+(sp.y-p.y);
                                  if (nextWidth > Share.MINIMIZED_HEIGHT)
                                       frame.setLocation(frameLoc.x, frameLoc.y-(sp.y-p.y));                              
                                       frame.setSize(nextWidth,nextHeight);
                                       frame.validate();
                                       //frame.repaint();
                             else
                                  int x = frame.getX()+p.x-sp.x;     
                                  int y = frame.getY()+p.y-sp.y;     
                                  setLocation(x,y);
         private void setupTitleBar()
              titleBar.setLayout(new BorderLayout());
              //titleBar.setToolTipText("Double click here to minimize the window");
              titleBar.setOpaque(false);
              titleBar.setBackground(Color.BLUE);
              titleBar.setBorder(BorderFactory.createLineBorder(new Color(0x00, 0x66, 0xCC), 2));
              title.setForeground(Color.WHITE);
              title.setOpaque(false);
              titleBar.add(title, BorderLayout.WEST);
              FlowLayout flow = new FlowLayout(FlowLayout.LEFT);
              flow.setVgap(0);
              flow.setHgap(0);
              JPanel conPane = new JPanel(flow);
              conPane.setOpaque(false);
              // Setup minimize label
              JLabel lab = new JLabel(" _ ");
              lab.setForeground(Color.WHITE);
              lab.setOpaque(false);
              lab.addMouseListener(new MouseListener()
                        public void mousePressed(MouseEvent e)
                        public void mouseReleased(MouseEvent e)
                             //frame.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
                        public void mouseEntered(MouseEvent e)
                             //frame.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
                        public void mouseExited(MouseEvent e)
                             //frame.setCursor(Cursor.getDefaultCursor());
                        public void mouseClicked(MouseEvent e)
                             if (minimized == false)
                                  size = frame.getSize();
                                  //titleBar.setToolTipText("Double click here to restore the window");
                                  frame.setSize(((int)size.getWidth()), Share.MINIMIZED_HEIGHT);
                                  minimized = true;
              conPane.add(lab);
              // Setup restore label
              lab = new JLabel(" " + "\u25FB" + " ", JLabel.RIGHT);
              lab.setOpaque(false);
              lab.setForeground(Color.WHITE);
              lab.addMouseListener(new MouseListener()
                        public void mousePressed(MouseEvent e)
                        public void mouseReleased(MouseEvent e)
                             //frame.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
                        public void mouseEntered(MouseEvent e)
                             //frame.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
                        public void mouseExited(MouseEvent e)
                             //frame.setCursor(Cursor.getDefaultCursor());
                        public void mouseClicked(MouseEvent e)
                             if (minimized == true)
                                  frame.setSize(size);
                                  //titleBar.setToolTipText("Double click here to minimize the window");
                                  minimized = false;
              conPane.add(lab);
              // Setup close label
              lab = new JLabel(" x ", JLabel.RIGHT);
              lab.setForeground(Color.WHITE);
              lab.setOpaque(false);
              lab.addMouseListener(new MouseListener()
                        public void mousePressed(MouseEvent e)
                        public void mouseReleased(MouseEvent e)
                             //frame.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
                        public void mouseEntered(MouseEvent e)
                             //frame.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
                        public void mouseExited(MouseEvent e)
                             //frame.setCursor(Cursor.getDefaultCursor());
                        public void mouseClicked(MouseEvent e)
                             //frame.setVisible(false);
                             System.exit(0);
              conPane.add(lab);
              titleBar.add(conPane, BorderLayout.EAST);          
              titleBar.addMouseMotionListener(new MouseMotionListener()
                        public void mouseDragged(MouseEvent e)
                             //int x = ((int)frame.getLocation().getX());
                             //int y = ((int)frame.getLocation().getY());
                             //frame.setLocation(e.getX() + (x-e.getX()), e.getY() + (y-e.getY()));
                             Point p = frame.getLocationOnScreen();
                             frame.setLocation(p.x + e.getX() - loc.x,p.y + e.getY() - loc.y);
                        public void mouseMoved(MouseEvent e)
              titleBar.addMouseListener(new MouseListener()
                        public void mousePressed(MouseEvent e)
                             loc.x = e.getPoint().x;
                             loc.y = e.getPoint().y;
                        public void mouseReleased(MouseEvent e)
                             //frame.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
                        public void mouseEntered(MouseEvent e)
                             //frame.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
                        public void mouseExited(MouseEvent e)
                             //frame.setCursor(Cursor.getDefaultCursor());
                        public void mouseClicked(MouseEvent e)
    public void setFrameTitle(String s)
    title.setText(" " + s);
    public void setVisible(boolean b)
    frame.setVisible(b);
    private class TableView
    MyTableModel model;
    private TableView()
    try
    model = new MyTableModel();
    catch (Exception exc)
    Share.d("TableView E: " + exc.toString());
    class MyTableModel extends AbstractTableModel
    public int getColumnCount()
    return colName.length;
    public int getRowCount()
    if (t == null)
    return 0;
    else
    return t.size();
    public String getColumnName(int col)
    return colName[col];
    public Object getValueAt(int row, int col)
    String[] data = t.get(row).toString().split(",");
    return data[col];
    public boolean isCellEditable(int row, int col)
    return false;
    public void setValueAt(Object value, int row, int col)
    String[] data = t.get(row).toString().split(",");
    data[col] = value.toString();
    String s = "";
    for (int i = 0; i < data.length; i++)
    s = s + data;
    if (i != data.length - 1)
    s = s + ",";
    t.set(row, s);
    fireTableCellUpdated(row, col);
    public void setData(Vector newData)
    t = newData;
    fireTableDataChanged();
    private class CustomRenderer extends JLabel implements TableCellRenderer
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int rowIndex, int vColIndex)
    try
    // 08/06/2007 18:54:44,62000,4,,
    setOpaque(true);
                        setForeground(Color.WHITE);
    if (vColIndex == PRICE_C)
    setText(" " + value.toString());
    setHorizontalAlignment(JLabel.LEFT);
    if (rowIndex == 0)
    //setForeground(new Color(0x00, 0x80, 0x00)); //VERY DARK GREEN
                                  //setForeground(Color.green);
                                  setBackground(new Color(0x00, 0x80, 0x00)); //VERY DARK GREEN
                                  rowColor = new Color(0x00, 0x80, 0x00);
    else
    Double d = getPrice(rowIndex - 1) - getPrice(rowIndex);
    if (d < 0.0)
    //setForeground(new Color(0x00, 0x80, 0x00)); //VERY DARK GREEN
                                       //setForeground(Color.green);
                                       setBackground(new Color(0x00, 0x80, 0x00)); //VERY DARK GREEN
                                       rowColor = new Color(0x00, 0x80, 0x00);
    else if (d > 0.0)
    //setForeground(new Color(0xcc, 0xcc, 0x00));
                                       setBackground(Share.sellCol); //VERY DARK GREEN
                                       rowColor = Share.sellCol;
    else if (d == 0.0)
                                       setForeground(Color.BLACK);
                                       setBackground(null);
                                       rowColor = Color.WHITE;
    //setForeground(Color.WHITE);
    else if (vColIndex == TIME_C)
    Date d;
    if (value.toString().split(" ").length == 3)
    d = sdf.parse(value.toString());
    else
    d = sdf1.parse(value.toString());
    setText(format.format(d));
    setHorizontalAlignment(JLabel.RIGHT);
                             setBackground(rowColor);
                             if (rowColor == Color.WHITE)
                                  setForeground(Color.BLACK);     
                             else
                                  setForeground(Color.WHITE);
    else if (vColIndex == VOL_C)
    setText(value.toString() + " ");
    setHorizontalAlignment(JLabel.RIGHT);
                             setBackground(rowColor);
                             if (rowColor == Color.WHITE)
                                  setForeground(Color.BLACK);     
                             else
                                  setForeground(Color.WHITE);
    else
    // For future buyer and seller info
    catch (Exception exc)
    Share.d("CustomRenderer E: " + exc.toString());
    return this;
    public void addRow(String s)
    if (t.size() == MAX_LINE)
    t.remove(MAX_LINE - 1);
    t.add(0, s);
    view.model.setData(t);
    public double getPrice(int i)
    return(Double.parseDouble((t.get(i).toString().split(","))[0]));
    public Point getLocation()
    return frame.getLocation();
    public void setLocation(int x, int y)
    frame.setLocation(x, y);
    public void setOnTop(boolean b)
    frame.setAlwaysOnTop(b);
         public void removeAll()
              t.clear();
    view.model.setData(t);
    public void actionPerformed(ActionEvent e)
    String item = e.getActionCommand();
    if (item.equals("Minimized"))
                   if (minimized == false)
                        loc = frame.getLocation();
                        size = frame.getSize();
                        if (Share.MINIMIZED_WIDTH + size.getWidth() > Share.SCREEN_WIDTH)
                             Share.MINIMIZED_ROW++;
                             Share.MINIMIZED_WIDTH = 0;
                             //frame.setLocation(Share.MINIMIZED_WIDTH, Share.MINIMIZED_START_POS);
                             frame.setSize(((int)size.getWidth()), Share.MINIMIZED_HEIGHT);
                             frame.setLocation(Share.MINIMIZED_WIDTH, Share.MINIMIZED_START_POS-(Share.MINIMIZED_ROW*Share.MINIMIZED_HEIGHT));
                             Share.MINIMIZED_WIDTH = Share.MINIMIZED_WIDTH + ((int)size.getWidth());
                        else
                             //frame.setLocation(Share.MINIMIZED_WIDTH, Share.MINIMIZED_START_POS);
                             frame.setSize(((int)size.getWidth()), Share.MINIMIZED_HEIGHT);
                             frame.setLocation(Share.MINIMIZED_WIDTH, Share.MINIMIZED_START_POS-(Share.MINIMIZED_ROW*Share.MINIMIZED_HEIGHT));
                             Share.MINIMIZED_WIDTH = Share.MINIMIZED_WIDTH + ((int)size.getWidth());
                        Share.MINIMIZED_NUM++;
                        minimized = true;
    else if (item.equals("Restore"))
                   if (minimized == true)
                        frame.setLocation(loc);
                        frame.setSize(size);
                        frame.setVisible(true);
                        if (Share.MINIMIZED_WIDTH - size.getWidth() < 0)
                             Share.MINIMIZED_WIDTH = Share.SCREEN_WIDTH;
                             Share.MINIMIZED_ROW--;
                        else
                             Share.MINIMIZED_WIDTH = Share.MINIMIZED_WIDTH - ((int)size.getWidth());
                        Share.MINIMIZED_NUM--;
                        minimized = false;
         public static void main(String[] args)
    System.getProperties().put("sun.awt.noerasebackground", "true");
              TrdHistForm form = new TrdHistForm();
              form.setFrameTitle("TEST");
              form.addRow("2,69000,2007/07/07 05:05:05");
              form.setVisible(true);
    The problem is that when a resize that needs a setLocation() to go with it, the frame flash/flicker a lot. I already tried to set "sun.awt.noerasebackground" to "true" but it didn't help me. Is there another way to solve the flickering problem?
    I notice on normal frames, there is an outline drawn as the mouse moves around, then the windows resize/setLocation at mouse release events. How can I do this (if the flash/flicker problem can't be solved)?
    Thank you very much for your time!!
    Cheers!

    Thanks for the reply! But I don't have a problem with moving the undecorated JDialog. It's the resize operations that I try to do. If the resize operations need to resize and setLocation (i.e NW, SW, NE, W, N resize) then my JDialog will flash... I doubt that you need to read it... If you are familiar with this kind of things then once you compile and run it, you will probably know the fix right away...
    Here is the compilable code
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.table.*;
    import java.awt.event.*;
    import java.util.*;
    import javax.swing.event.*;
    import java.text.SimpleDateFormat;
    import java.text.DateFormat;
    import java.net.URL;
    public class MoveWindow
        private static final int MAX_LINE = 100;
        private static final int ROW_HEIGHT = 20;
        private JDialog frame = new JDialog();
         private JPanel mainPane = new JPanel(new BorderLayout());
         private JPanel titleBar = new JPanel();
         private JLabel title = new JLabel("AA", JLabel.LEFT);
        private JTable table;
        private TableView view;
        private Vector t;
         private boolean minimized = false; // starts up as normal size window, not minimized
         private Point loc = new Point(0,0);
         private Dimension size = new Dimension(0,0);
         private Point sp;
         private Point frameLoc = new Point(0,0);
         //private Dimension frameSize = new Dimension(0,0);
         private int     compStartHeight;
         private int compStartWidth;
        private static SimpleDateFormat sdf = new SimpleDateFormat("d/MM/yyyy h:mm:ss a");
        private static SimpleDateFormat sdf1 = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
        private static DateFormat format = new SimpleDateFormat("HH:mm:ss");
        private static int PRICE_C = 0;
        private static int VOL_C = 1;
        private static int TIME_C = 2;
        private static int PRICE_W = 70;
        private static int VOL_W = 55;
        private static int TIME_W = 60;
        private static int[] colWidth =
            PRICE_W, VOL_W, TIME_W
        private static String[] colOrgName =
            "price","vol","time"
        private String PRICE_N = "Price";
        private String VOL_N = "Volume";
        private String TIME_N = "Time";
        private String[] colName =
            PRICE_N, VOL_N, TIME_N
         private Color rowColor = new Color(0x00, 0x80, 0x00); //VERY DARK GREEN
         private static final int MINIMIZED_HEIGHT = 50;
        public MoveWindow()
              minimized = false;
              loc = new Point(0,0);
              size = new Dimension(0,0);
              Dimension butDim = new Dimension(15,15);
              //mainPane.setLayout(new BoxLayout(mainPane, BoxLayout.Y_AXIS));
              //mainPane.setLayout(new BorderLayout());
              //mainPane.setOpaque(false);
              //JPanel upPane = new JPanel();
              setupTitleBar();
              //URL url = TrdHistForm.class.getResource("tvbg.JPG");
            //ImageIcon icon = new ImageIcon(url);
              //mainPane.add(Share.wrapInBackgroundImage(titleBar, icon), BorderLayout.NORTH);
              mainPane.add(titleBar,BorderLayout.NORTH);
              JPanel butPane = new JPanel(new FlowLayout(FlowLayout.RIGHT));
              JButton but = new JButton("_");
              but.setActionCommand("Minimized");
              but.setToolTipText("Minimized this window");
              but.setMargin(new Insets(0,0,0,0));
              but.setMaximumSize(butDim);
            but.setMinimumSize(butDim);
            but.setPreferredSize(butDim);
              but.addActionListener(this);
              but.setFocusPainted(false);
              butPane.add(but);
              but = new JButton("\u25FB");
              but.setActionCommand("Restore");
              but.setToolTipText("Restore this window to previous location and size");
              but.setMaximumSize(butDim);
            but.setMinimumSize(butDim);
            but.setPreferredSize(butDim);
              but.setMargin(new Insets(0,0,0,0));
              but.addActionListener(this);
              but.setFocusPainted(false);
              butPane.add(but);
              mainPane.add(butPane);
              mainPane.add(Box.createRigidArea(new Dimension(0,1)));
            t = new Vector();
            view = new TableView();
            int colNum = colName.length;
            table = new JTable(view.model);
            // Call custom rendering
            TableColumn column = null;
            for(int i = 0; i < colNum; i++)
                column = table.getColumnModel().getColumn(i);
                column.setCellRenderer(new CustomRenderer());
            // Set up columns' widths
            for (int i = 0; i < colNum; i++)
                column = table.getColumnModel().getColumn(i);
                column.setPreferredWidth(colWidth);
    int i = 0;
    for (int j = 0; j < colWidth.length; j++)
    i = i + colWidth[j];
              //table.setShowGrid(false);
    //table.setOpaque(false);
              //table.setPreferredScrollableViewportSize(new Dimension(i, 500));
              table.setRowHeight(ROW_HEIGHT);
    table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    //table.setGridColor(new Color(239, 239, 239));
    JScrollPane scrollPane = new JScrollPane(table, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
              //scrollPane.setBorder(BorderFactory.createEmptyBorder(0,0,0,0));
              //scrollPane.setOpaque(false);
              //scrollPane.getViewport().setOpaque(false);
              //scrollPane.getVerticalScrollBar().setOpaque(false);
              //scrollPane.getHorizontalScrollBar().setOpaque(false);
              mainPane.add(scrollPane, BorderLayout.CENTER);
              mainPane.setBorder(BorderFactory.createLineBorder(new Color(0x00, 0x66, 0xCC), 3));
              //URL url = AtBestForm.class.getResource("tvbg.JPG");
    //ImageIcon icon = new ImageIcon(url);
              //frame.setContentPane(Share.wrapInBackgroundImage(mainPane, icon));
              frame.setContentPane(mainPane);
    frame.setVisible(false);
    //frame.pack();
              frame.setSize(new Dimension(i, 500));
              //frame.setDoubleBuffered(true);
    //frame.setResizable(false);
    frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
    frame.setLocation(0,0);
              frame.setUndecorated(true);
              frame.addMouseListener(new MouseListener()
                        public void mousePressed(MouseEvent e)
                             sp = e.getPoint();
                             compStartHeight = frame.getSize().height;
                             compStartWidth = frame.getSize().width;
                             frameLoc = frame.getLocation();
                        public void mouseEntered(MouseEvent e)
                        public void mouseExited(MouseEvent e)
                             if (sp == null)
                                  frame.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
                        public void mouseClicked(MouseEvent e)
                        public void mouseReleased(MouseEvent e)
                             sp = null;
              frame.addMouseMotionListener(new MouseMotionListener()
                        public void mouseMoved(MouseEvent e)
                             Point p = e.getPoint();
                             if (p.y > e.getComponent().getSize().height - 5)
                                  if (p.x < 5)
                                       frame.setCursor(Cursor.getPredefinedCursor(Cursor.SW_RESIZE_CURSOR));
                                  else if (p.x > e.getComponent().getSize().width - 5)
                                       frame.setCursor(Cursor.getPredefinedCursor(Cursor.SE_RESIZE_CURSOR));
                                  else
                                       frame.setCursor(Cursor.getPredefinedCursor(Cursor.S_RESIZE_CURSOR));
                             else if (p.y < 5)
                                  if (p.x < 5)
                                       frame.setCursor(Cursor.getPredefinedCursor(Cursor.NW_RESIZE_CURSOR));
                                  else if (p.x > e.getComponent().getSize().width - 5)
                                       frame.setCursor(Cursor.getPredefinedCursor(Cursor.NE_RESIZE_CURSOR));
                                  else
                                       frame.setCursor(Cursor.getPredefinedCursor(Cursor.N_RESIZE_CURSOR));
                             else
                                  if (p.x < 5)
                                       frame.setCursor(Cursor.getPredefinedCursor(Cursor.W_RESIZE_CURSOR));
                                  else if (p.x > e.getComponent().getSize().width - 5)
                                       frame.setCursor(Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR));
                        public void mouseDragged(MouseEvent e)
                             Point p = e.getPoint();
                             int compWidth = frame.getSize().width;
                             int compHeight = frame.getSize().height;
                             if (frame.getCursor().getType() == Cursor.S_RESIZE_CURSOR)
                                  int nextHeight = compStartHeight+p.y-sp.y;
                                  if (nextHeight > MINIMIZED_HEIGHT)
                                       frame.setSize(compWidth,nextHeight);
                                       frame.validate();
                             else if (frame.getCursor().getType() == Cursor.N_RESIZE_CURSOR)
                                  int nextHeight = compStartHeight+sp.y-p.y;
                                  if (nextHeight > MINIMIZED_HEIGHT)
                                       frame.setLocation(frameLoc.x, frameLoc.y-(sp.y-p.y));
                                       frame.setSize(compWidth,nextHeight);
                                       frame.validate();
                                       //frame.repaint();
                             else if (frame.getCursor().getType() == Cursor.E_RESIZE_CURSOR)
                                  int nextWidth = compStartWidth+p.x-sp.x;
                                  if (nextWidth > MINIMIZED_HEIGHT)
                                       frame.setSize(nextWidth,compHeight);
                                       frame.validate();
                                       //frame.repaint();
                             else if (frame.getCursor().getType() == Cursor.W_RESIZE_CURSOR)
                                  int nextWidth = compStartWidth+(sp.x-p.x);
                                  if (nextWidth > MINIMIZED_HEIGHT)
                                       frame.setLocation(frameLoc.x-(sp.x-p.x), frameLoc.y);
                                       frame.setSize(nextWidth,compHeight);
                                       frame.validate();
                                       //frame.repaint();
                             else if (frame.getCursor().getType() == Cursor.SE_RESIZE_CURSOR)
                                  int nextWidth = compStartWidth+(p.x-sp.x);
                                  int nextHeight = compStartHeight+(p.y-sp.y);
                                  if (nextWidth > MINIMIZED_HEIGHT)
                                       frame.setSize(nextWidth,nextHeight);
                                       frame.validate();
                                       //frame.repaint();
                             else if (frame.getCursor().getType() == Cursor.SW_RESIZE_CURSOR)
                                  int nextWidth = compStartWidth+(sp.x-p.x);
                                  int nextHeight = compStartHeight+(p.y-sp.y);
                                  if (nextWidth > MINIMIZED_HEIGHT)
                                       frame.setLocation(frameLoc.x-(sp.x-p.x), frameLoc.y);                              
                                       frame.setSize(nextWidth,nextHeight);
                                       frame.validate();
                                       //frame.repaint();
                             else if (frame.getCursor().getType() == Cursor.NW_RESIZE_CURSOR)
                                  int nextWidth = compStartWidth+(sp.x-p.x);
                                  int nextHeight = compStartHeight+(sp.y-p.y);
                                  if (nextWidth > MINIMIZED_HEIGHT)
                                       frame.setLocation(frameLoc.x-(sp.x-p.x), frameLoc.y-(sp.y-p.y));                              
                                       frame.setSize(nextWidth,nextHeight);
                                       frame.validate();
                                       //frame.repaint();
                             else if (frame.getCursor().getType() == Cursor.NE_RESIZE_CURSOR)
                                  int nextWidth = compStartWidth+p.x-sp.x;
                                  int nextHeight = compStartHeight+(sp.y-p.y);
                                  if (nextWidth > MINIMIZED_HEIGHT)
                                       frame.setLocation(frameLoc.x, frameLoc.y-(sp.y-p.y));                              
                                       frame.setSize(nextWidth,nextHeight);
                                       frame.validate();
                                       //frame.repaint();
                             else
                                  int x = frame.getX()+p.x-sp.x;     
                                  int y = frame.getY()+p.y-sp.y;     
                                  setLocation(x,y);
         private void setupTitleBar()
              titleBar.setLayout(new BorderLayout());
              //titleBar.setToolTipText("Double click here to minimize the window");
              titleBar.setOpaque(true);
              titleBar.setBackground(Color.BLUE);
              titleBar.setBorder(BorderFactory.createLineBorder(new Color(0x00, 0x66, 0xCC), 2));
              title.setForeground(Color.WHITE);
              title.setOpaque(false);
              titleBar.add(title, BorderLayout.WEST);
              FlowLayout flow = new FlowLayout(FlowLayout.LEFT);
              flow.setVgap(0);
              flow.setHgap(0);
              JPanel conPane = new JPanel(flow);
              conPane.setOpaque(false);
              // Setup minimize label
              JLabel lab = new JLabel(" _ ");
              lab.setForeground(Color.WHITE);
              lab.setOpaque(false);
              lab.addMouseListener(new MouseListener()
                        public void mousePressed(MouseEvent e)
                        public void mouseReleased(MouseEvent e)
                             //frame.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
                        public void mouseEntered(MouseEvent e)
                             //frame.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
                        public void mouseExited(MouseEvent e)
                             //frame.setCursor(Cursor.getDefaultCursor());
                        public void mouseClicked(MouseEvent e)
                             if (minimized == false)
                                  size = frame.getSize();
                                  //titleBar.setToolTipText("Double click here to restore the window");
                                  frame.setSize(((int)size.getWidth()), MINIMIZED_HEIGHT);
                                  minimized = true;
              conPane.add(lab);
              // Setup restore label
              lab = new JLabel(" " + "\u25FB" + " ", JLabel.RIGHT);
              lab.setOpaque(false);
              lab.setForeground(Color.WHITE);
              lab.addMouseListener(new MouseListener()
                        public void mousePressed(MouseEvent e)
                        public void mouseReleased(MouseEvent e)
                             //frame.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
                        public void mouseEntered(MouseEvent e)
                             //frame.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
                        public void mouseExited(MouseEvent e)
                             //frame.setCursor(Cursor.getDefaultCursor());
                        public void mouseClicked(MouseEvent e)
                             if (minimized == true)
                                  frame.setSize(size);
                                  //titleBar.setToolTipText("Double click here to minimize the window");
                                  minimized = false;
              conPane.add(lab);
              // Setup close label
              lab = new JLabel(" x ", JLabel.RIGHT);
              lab.setForeground(Color.WHITE);
              lab.setOpaque(false);
              lab.addMouseListener(new MouseListener()
                        public void mousePressed(MouseEvent e)
                        public void mouseReleased(MouseEvent e)
                             //frame.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
                        public void mouseEntered(MouseEvent e)
                             //frame.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
                        public void mouseExited(MouseEvent e)
                             //frame.setCursor(Cursor.getDefaultCursor());
                        public void mouseClicked(MouseEvent e)
                             //frame.setVisible(false);
                             System.exit(0);
              conPane.add(lab);
              titleBar.add(conPane, BorderLayout.EAST);          
              titleBar.addMouseMotionListener(new MouseMotionListener()
                        public void mouseDragged(MouseEvent e)
                             //int x = ((int)frame.getLocation().getX());
                             //int y = ((int)frame.getLocation().getY());
                             //frame.setLocation(e.getX() + (x-e.getX()), e.getY() + (y-e.getY()));
                             Point p = frame.getLocationOnScreen();
                             frame.setLocation(p.x + e.getX() - loc.x,p.y + e.getY() - loc.y);
                        public void mouseMoved(MouseEvent e)
              titleBar.addMouseListener(new MouseListener()
                        public void mousePressed(MouseEvent e)
                             loc.x = e.getPoint().x;
                             loc.y = e.getPoint().y;
                        public void mouseReleased(MouseEvent e)
                             //frame.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
                        public void mouseEntered(MouseEvent e)
                             //frame.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
                        public void mouseExited(MouseEvent e)
                             //frame.setCursor(Cursor.getDefaultCursor());
                        public void mouseClicked(MouseEvent e)
    public void setFrameTitle(String s)
    title.setText(" " + s);
    public void setVisible(boolean b)
    frame.setVisible(b);
    private class TableView
    MyTableModel model;
    private TableView()
    try
    model = new MyTableModel();
    catch (Exception exc)
    //Share.d("TableView E: " + exc.toString());
    class MyTableModel extends AbstractTableModel
    public int getColumnCount()
    return colName.length;
    public int getRowCount()
    if (t == null)
    return 0;
    else
    return t.size();
    public String getColumnName(int col)
    return colName[col];
    public Object getValueAt(int row, int col)
    String[] data = t.get(row).toString().split(",");
    return data[col];
    public boolean isCellEditable(int row, int col)
    return false;
    public void setValueAt(Object value, int row, int col)
    String[] data = t.get(row).toString().split(",");
    data[col] = value.toString();
    String s = "";
    for (int i = 0; i < data.length; i++)
    s = s + data;
    if (i != data.length - 1)
    s = s + ",";
    t.set(row, s);
    fireTableCellUpdated(row, col);
    public void setData(Vector newData)
    t = newData;
    fireTableDataChanged();
    private class CustomRenderer extends JLabel implements TableCellRenderer
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int rowIndex, int vColIndex)
    try
    // 08/06/2007 18:54:44,62000,4,,
    setOpaque(true);
                        setForeground(Color.WHITE);
    if (vColIndex == PRICE_C)
    setText(" " + value.toString());
    setHorizontalAlignment(JLabel.LEFT);
    if (rowIndex == 0)
    //setForeground(new Color(0x00, 0x80, 0x00)); //VERY DARK GREEN
                                  //setForeground(Color.green);
                                  setBackground(new Color(0x00, 0x80, 0x00)); //VERY DARK GREEN
                                  rowColor = new Color(0x00, 0x80, 0x00);
    else
    Double d = getPrice(rowIndex - 1) - getPrice(rowIndex);
    if (d < 0.0)
    //setForeground(new Color(0x00, 0x80, 0x00)); //VERY DARK GREEN
                                       //setForeground(Color.green);
                                       setBackground(new Color(0x00, 0x80, 0x00)); //VERY DARK GREEN
                                       rowColor = new Color(0x00, 0x80, 0x00);
    else if (d > 0.0)
    //setForeground(new Color(0xcc, 0xcc, 0x00));
                                       setBackground(Color.red); //VERY DARK GREEN
                                       rowColor = Color.red;
    else if (d == 0.0)
                                       setForeground(Color.BLACK);
                                       setBackground(null);
                                       rowColor = Color.WHITE;
    //setForeground(Color.WHITE);
    else if (vColIndex == TIME_C)
    Date d;
    if (value.toString().split(" ").length == 3)
    d = sdf.parse(value.toString());
    else
    d = sdf1.parse(value.toString());
    setText(format.format(d));
    setHorizontalAlignment(JLabel.RIGHT);
                             setBackground(rowColor);
                             if (rowColor == Color.WHITE)
                                  setForeground(Color.BLACK);     
                             else
                                  setForeground(Color.WHITE);
    else if (vColIndex == VOL_C)
    setText(value.toString() + " ");
    setHorizontalAlignment(JLabel.RIGHT);
                             setBackground(rowColor);
                             if (rowColor == Color.WHITE)
                                  setForeground(Color.BLACK);     
                             else
                                  setForeground(Color.WHITE);
    else
    // For future buyer and seller info
    catch (Exception exc)
    //Share.d("CustomRenderer E: " + exc.toString());
    return this;
    public void addRow(String s)
    if (t.size() == MAX_LINE)
    t.remove(MAX_LINE - 1);
    t.add(0, s);
    view.model.setData(t);
    public double getPrice(int i)
    return(Double.parseDouble((t.get(i).toString().split(","))[0]));
    public Point getLocation()
    return frame.getLocation();
    public void setLocation(int x, int y)
    frame.setLocation(x, y);
    public void setOnTop(boolean b)
    frame.setAlwaysOnTop(b);
         public void removeAll()
              t.clear();
    view.model.setData(t);
    public void actionPerformed(ActionEvent e)
    String item = e.getActionCommand();
    if (item.equals("Minimized"))
                   if (minimized == false)
                        loc = frame.getLocation();
                        size = frame.getSize();
                        if (Share.MINIMIZED_WIDTH + size.getWidth() > Share.SCREEN_WIDTH)
                             Share.MINIMIZED_ROW++;
                             Share.MINIMIZED_WIDTH = 0;
                             //frame.setLocation(Share.MINIMIZED_WIDTH, Share.MINIMIZED_START_POS);
                             frame.setSize(((int)size.getWidth()), Share.MINIMIZED_HEIGHT);
                             frame.setLocation(Share.MINIMIZED_WIDTH, Share.MINIMIZED_START_POS-(Share.MINIMIZED_ROW*Share.MINIMIZED_HEIGHT));
                             Share.MINIMIZED_WIDTH = Share.MINIMIZED_WIDTH + ((int)size.getWidth());
                        else
                             //frame.setLocation(Share.MINIMIZED_WIDTH, Share.MINIMIZED_START_POS);
                             frame.setSize(((int)size.getWidth()), Share.MINIMIZED_HEIGHT);
                             frame.setLocation(Share.MINIMIZED_WIDTH, Share.MINIMIZED_START_POS-(Share.MINIMIZED_ROW*Share.MINIMIZED_HEIGHT));
                             Share.MINIMIZED_WIDTH = Share.MINIMIZED_WIDTH + ((int)size.getWidth());
                        Share.MINIMIZED_NUM++;
                        minimized = true;
    else if (item.equals("Restore"))
                   if (minimized == true)
                        frame.setLocation(loc);
                        frame.setSize(size);
                        frame.setVisible(true);
                        if (Share.MINIMIZED_WIDTH - size.getWidth() < 0)
                             Share.MINIMIZED_WIDTH = Share.SCREEN_WIDTH;
                             Share.MINIMIZED_ROW--;
                        else
                             Share.MINIMIZED_WIDTH = Share.MINIMIZED_WIDTH - ((int)size.getWidth());
                        Share.MINIMIZED_NUM--;
                        minimized = false;
         public static void main(String[] args)
              System.getProperties().put("sun.awt.noerasebackground", "true");
              MoveWindow form = new MoveWindow();
              form.setFrameTitle("TEST");
              form.addRow("2,69000,2007/07/07 05:05:05");
              form.setVisible(true);
    Thanks again for your time and help!

  • Ae 13.1can't pan in viewer with mouse wheel button !!!!!!

    one of the bad things in ae 13.1 is that you can't pan in viewer with mouse wheel button

    In all honesty though, even if fixing this kind of bug would create a new one, its not a bug that should be ignored. Its a major one imo (fix this bug and create a new one, I would personally take my chances). I remember after effects had a bug in a recent update, were audio always was set to low quality when you export, which was very annoying, and it wasn't fixed for months! This bug is worse, and happily I read this thread before updating so Im staying away for now, I hope it won't take months to fix this one.
    It makes sense and Im really happy to hear a chunk of the AE team is working on optimizing the code.Though I think they should devote more people to that. AE is such an old program that I assume those working with keying or other of the features that have been updated lately, they bought a better plugin for it allready. I would much rather have NO updates for a year if that means the program would become more stable, faster and in the future they would not need to patch up layers and layers of old code, as you say....and from what I remember the response from the community was pretty much the same from every single one when it was asked in public what people wanted in the future updates....a faster program. THe content of AE is all ready great, and you can get plugins for pretty much everything you need...except optimization and an up to date software that uses the computer to the maximum potential. 

  • Tabcontrol transitions between tab with mouse gesture ?

    Hi
    Can we create a tabcontrol with gridview in tab, and when we can scroll gridview and tabcontrol with mouse hold and move ?
    Example :
    Tab1 Tab2
    1 2   5 6
    3 4 7 8
    When we hold and move mouse Up-Down gridview will scroll in tab.
    When we hold and move mouse Left-Right we will see tab transtion
    Tab1 Tab2
    .. 2 5 ..
    .. 4 6 ..
    Tab navigation will dependent where we release mouse.
    Exactly i want do something the same app screen smart phone, exclude it can scroll in Up-Down in a page.
    I'm researching in Google but now see anything sample like this.
    Please help me.
    Sorry for my bad english.

    Hi Cygnus
    Durant
    I'm not really what you said.
    We will create 
    <TabPanel >
    <ScrollViewer>
    <StackPanel >
    <Item>
    So will
    horizontal smooth-scroll we will use ScrollViewer
    Add handlers for MouseMove to
    scroll verically in StackPanel ?
    Sorry i'm just beginner.

  • Resizing image within Canvas with mouse ?

    Hi,
    I am developing a paint program. In this I want to use selection tool as like microsoft paint. That select an area. and then resize it. Firstly i want to know about is how to select a particular area within canvas. and after selection can i resize it with mouse. Please help me.
    Thanks in advance.
    Manveer

    Manveer-Singh wrote:
    Hi,
    I am developing a paint program. In this I want to use selection tool as like microsoft paint. That select an area. and then resize it. Search google for my Resizeable class. This will only work on Components, but you could build a component that as it resizes, it resizes the image.
    Firstly i want to know about is how to select a particular area within canvas. and after selection can i resize it with mouse. Please help me. You may want to search google to see if you can find my MouseDragOutliner class.
    keywords include tjacobs and java :-)

  • How do i run an external monitor with my macbook and change settings so that when i close the lid the signal to the monitor is not lost and i can continue using the mac with a mouse and a wireless keyboard?

    How do i run an external monitor with my macbook and change settings so that when i close the lid the signal to the monitor is not lost and i can continue using the mac with a mouse and a wireless keyboard?

    No, nothing will prevent the computer from going to sleep when you close its display except third-party hacks that are designed to do exactly that. I strongly advise against using any of those, as they may interfere with successful entry into clamshell mode (and they carry other downside risks as well). Just wait until the computer is asleep (with its sleep light pulsing), then press any key on the keyboard. It sounds as though your setup is working as it's designed to do.

Maybe you are looking for