Resizing a JDialog

Hello,
I was trying to disable the resizing option for a JDialog. I've set the
initial size of the dialog by using myDialog.setSize(...) but I'm still able
to resize the dialog once it pops up. I want to restrict that. It should be
of fixed size and the user should not be able to modify it.
Could anybody please tell me how do I do it. I heard there is a function
called resizable(boolean false)..!!
Thanks a lot.
-Amitabh

Do you know a way to disable the resizing feature while diplaying the ICONs? I've implemented a ComponentAdapter but there is nothing I can do from the componentResized() method! The resizing seems to happen before the event is passed to me! How can I do this!
Thanks.

Similar Messages

  • Dynamic resizing in JDialog using setSize not working properly on solaris

    can anyone help..
    Dynamic resizing in JDialog using setSize is not working properly on solaris, its work fine on windows.
    i have set Jdialog size to setSize(768,364),
    when i dynamically resizing it to setSize(768,575); it doesn't get change but when i move dialog using mouse it gets refreshed.
    this problem is only happening on solaris not on windows.

    Hi,
    It's only an approach but try a call of validate() or repaint() after re-setting the size of your dialog.
    Cheers, Mathias

  • Problem resizing the JDialog???

    hi,
    I have a JDialog to which I am adding a JTable and JButton to search.
    Based on search condition the table gets populated.
    Problem here is
    I give search condition 1 and puplate the table after that I resize the JDialog
    Now i again serach it.Now the JDialog's size goes to the previous thing it does'nt take the resized size.
    in the end of my seacrh action listner I am doing
    this.pack();
    this.setVisible(true);
    this.setResizable(true);While running in debug mode I noticed once it execute this.pack();
    the resizing is gone.but if I remove this.pack() the JTable is not shown...
    Any idea about this problem??
    thnx
    neel

    The pack() method lays it out according to the preferred size of the content.
    You need to either only pack it when you first create it, or note the actual size before packing and if it's non-null and non-zero then restore it after packing.

  • Detecting Resizing of JDialog

    Hey all,
    I have a JComponent added to a JDialog that is the size of the JDialog in question. When I resize my JDialog by dragging around the edge of the JDialog window, I want my JComponent to be resized DURING the resizing of the JDialog. Currently, it seems to be that when the resizing is done, my Layout Manager(FlowLayout by default right?) resizes my JComponent for me AFTER the event. Is there anyway to resize the component DURING the resizing of the JDialog? Resize Event listeners under the ComponentListener(componentResized) does not work, it only detects resizing at the end of the event, like I said, I am looking for something that works DURING the event!
    Any and all help is appreciated!
    Rob

    I tried to do this before and I would recommend against it. The resize events are posted to the end of the thread queue. I think in order to do this you would have to muck around with the base class. Ugly stuff. If possible I would try to rework the design so you don't need to do this.

  • JLabel needs resizing in JDialog

    I have a subclass of JDialog that shows messages to the user, kind of like JOptionPane, but with a bit more processing for my own purposes. I have a JLabel in the dialog that I set the message text on. The message is almost always HTML with some formatting, and frequently the text causes the size of the label to be higher than it was when laid out in NetBeans. If I just show the dialog that way, the label will adjust it's height but will push items below it (like my MMButtons) off the bottom of the dialog. The code calls pack() and validate() immediately before setVisible(true).
    If I use a SwingWorker to schedule another pack() and validate() 500ms after showing the dialog, then that pack/validate cause the dialog to resize as it needs to.
    Note: the text is set on the JLabel after the entire dialog has been created and layed out.
    Question: how can I get the dialog to resize properly the first time it shows, so that there is not a delay before the full contents will show?
    I'm using GroupLayout in my dialog. The layout code is shown below.
    <pre>
    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addContainerGap()
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addComponent(pnlButtons, javax.swing.GroupLayout.DEFAULT_SIZE, 372, Short.MAX_VALUE)
    .addComponent(lblMessage, javax.swing.GroupLayout.DEFAULT_SIZE, 372, Short.MAX_VALUE)
    .addComponent(txtText, javax.swing.GroupLayout.DEFAULT_SIZE, 372, Short.MAX_VALUE))
    .addContainerGap())
    layout.setVerticalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addContainerGap()
    .addComponent(lblMessage, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addComponent(txtText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addComponent(pnlButtons, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addContainerGap())
    </pre>

    Why? Because the { code } tag was not documented in the help box on the right side, nor is there a button for it in the tool bar.
    Anyway, here is the layout code again:
        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
          layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(pnlButtons, javax.swing.GroupLayout.DEFAULT_SIZE, 372, Short.MAX_VALUE)
              .addComponent(lblMessage, javax.swing.GroupLayout.DEFAULT_SIZE, 372, Short.MAX_VALUE)
              .addComponent(txtText, javax.swing.GroupLayout.DEFAULT_SIZE, 372, Short.MAX_VALUE))
            .addContainerGap())
        layout.setVerticalGroup(
          layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addComponent(lblMessage, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(txtText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(pnlButtons, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addContainerGap())
        );

  • 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/

  • Smooth animated moving/resizing of JDialog

    Greetings all,
    I'm not sure if this belongs here or in the Java 2D subforum, but whatever. I'm working on a Swing desktop application whose main frame is laid out in a 3x3 GridLayout. Some of the panels in this grid have JLists with very long entries in them, and our users frequently complain that these panels are too small, so we'd like to implement the ability for them to "pop out" into bigger panels temporarily. We did this by simply removing the panel from the grid and dropping it in a JDialog of suitable size.
    Now, it may seem pedantic, but I'm interested in making this as pretty as technologically possible. My approach thus far has been to make the JDialog undecorated and initially position it directly where the original panel was, then animate it growing by having a Timer call SetBounds with increasing parameters until the desired maximum size is reached. This looks pretty nice, but it's kind of jaggy and flickery. Is there a better way of doing this that takes advantage of Java's graphics capabilities?
    Thanks!

    We did this by simply removing the panel from the grid and dropping it in a JDialog of suitable size.It would probably be better to simply grab the model from the list and use it to create a new JList that you add to the dialog, that way you don't need to worry about replacing the list after the dialog is closed, because a component can only have a single parent.
    then animate it growing by having a Timer call SetBounds with increasing parameters until the desired maximum size is reached. This looks pretty nice, but it's kind of jaggy and flickerySounds reasonable to me, I don't see why it would be jaggy and flickery.
    If you need further help then you need to create a [Short, Self Contained, Compilable and Executable, Example Program (SSCCE)|http://homepage1.nifty.com/algafield/sscce.html], that demonstrates the incorrect behaviour.
    Don't forget to use the Code Formatting Tags so the posted code retains its original formatting. That is done by selecting the code and then clicking on the "Code" button above the question input area.

  • Dynamic resizing in JDialog using setSize not working properly

    Hi,
    I have a dialog in which i have two radio buttons.
    As i click on other radio button the size of the dialog should change.
    I did so using setSize.
    As i change the size from smaller dialog to a bigger one then newly created portion is not painted properly. Although the size is increased but the painting of the new portion is not done fine.
    Any ideas?
    Is this is a Java bug?
    Here is the code snippet:
    public MyDialog() {
         Container contentPane = this.getContentPane();
         JPanel radioPanel = new JPanel();
    ButtonGroup radioGroup = new ButtonGroup();
    mInstancesButton = new JRadioButton("Instances");
    mActivitiesButton = new JRadioButton("Activities");
    mInstancesButton.setBounds(100,0,100,25);
    mActivitiesButton.setBounds(200,0,100,25);
    mInstancesButton.addItemListener(this);
    mActivitiesButton.addItemListener(this);
    radioGroup.add(mInstancesButton);
    radioGroup.add(mActivitiesButton);
    radioPanel.setLayout(null);
    radioPanel.add(mInstancesButton);
    radioPanel.add(mActivitiesButton);
    radioGroup.setSelected(mInstancesButton.getModel(), true);
         contentPane.add(radioPanel);
         this.setSize(600,300);
    public void itemStateChanged(ItemEvent ie) {
    Container contentPane = this.getContentPane();
    if(ie.getSource().equals(mInstancesButton) && ie.getStateChange() == ie.SELECTED) {
    this.setSize(600,300);
    else if(ie.getSource().equals(mActivitiesButton) && ie.getStateChange() == ie.SELECTED) {
    this.setSize(600, 500);

    Hi,
    It's only an approach but try a call of validate() or repaint() after re-setting the size of your dialog.
    Cheers, Mathias

  • IMAGE NOT DISPLAYED OVER JButton ON JDialog

    Hi,
    I am trying to display an image over a JButton inside a JDialog(pops up on button click from an applet). But it is invisible. But I am sure that it is drawn on the ContentPane since when i click partially/half at the position
    of the JButton I could see the JButton with the image. Actualy I am resizing the JDialog since I have two buttons, one to minimise and the other two maximise the size of the JDailog.
    All the buttons are in place but not visible neither at the first place nor when the JDialog is resized.
    The code is as follows:
    package com.dataworld.gis;
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.print.*;
    import javax.swing.*;
    public class PrintThisPolygon extends JDialog {
         protected Image image;
         protected JButton print;
         protected JButton resize;
         protected JButton desize;
         private int pX=0, pY=0, pWidth=0, pHeight=0;
         public PrintThisPolygon(JFrame parent, Viewer viewer) {
              super(parent, "Print Polygon", true);
              this.setModal(false);
              getContentPane().setLayout(null);
              image = this.viewer.getScreenBuffer();
              pane = new Panel();
              print = new JButton("print", new ImageIcon("images/print.gif"));
              print.setBounds(0,5,50,20);
              print.setEnabled(true);
              print.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent ae){
                        print();
              resize = new JButton("+", new ImageIcon("images/print.gif"));
              resize.setBounds(55,5,50, 20);
              resize.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent ae){
                        resizePlus();
              desize = new JButton("-", new ImageIcon("images/print.gif"));
              desize.setBounds(105,5,50, 20);
              desize.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent ae){
                        resizeMinus();
              getContentPane().add(print);
              getContentPane().add(resize);
              getContentPane().add(desize);
    public String getAppletInfo() {
         return "Identify Polygon\n"
    public void paint(Graphics g){
         System.out.println("Paint : pX " + pX + " pY :" + pY);
         g.drawImage(image, pX, pY, pWidth, pHeight, getBackground(), this);
    protected void print() {
         ImagePrint sp = new ImagePrint(this.viewer);
    public void resizeMinus(){
         repaint();
    public void resizePlus(){
         repaint();
    Can anybody has any clue. Can anybody help me out.
    Thanx

    I added resize code for those buttons and ended up with repaint problems too. When you manually resized the window everything was fine again. After a bit of digging around I found you need to call validate on the dialog and then things work.
    IL,
    There is the new scaling version of the code I modified above:package forum.com.dataworld.gis;
    import java.awt.Graphics;
    import java.awt.Image;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.ImageIcon;
    import javax.swing.JButton;
    import javax.swing.JDialog;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    public class PanelPaintFrame extends JFrame {
         public static void main(String[] args) {
              PanelPaintFrame frame = new PanelPaintFrame ();
              frame.setVisible (true);
         public PanelPaintFrame ()  {
              setBounds (100, 100, 600, 600);
              setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
              JButton showPrintDialogButton = new JButton ("Show Print Dialog...");
              JPanel buttonPanel = new JPanel ();
              buttonPanel.add (showPrintDialogButton);
              getContentPane ().add (buttonPanel);
              showPrintDialogButton.addActionListener (new ActionListener ()  {
                   public void actionPerformed (ActionEvent e)  {
                        PrintThisPolygon printDialog = new PrintThisPolygon (PanelPaintFrame.this);
                        printDialog.show();
              pack ();
         public class PrintThisPolygon extends JDialog {
              protected ImageIcon myOrigonalImage = null;
              protected Image image;
              protected JButton print;
              protected JButton resize;
              protected JButton desize;
              private int pX=0, pY=0, pWidth=0, pHeight=0;
              JPanel pane = null;
              public PrintThisPolygon(JFrame parent/*, Viewer viewer*/) {
                   super(parent, "Print Polygon", true);
    //               this.setModal(false);
                   getContentPane().setLayout(null);
                   //  Substitute my own image
                   myOrigonalImage = new ImageIcon (PrintThisPolygon.class.getResource ("images/MyCoolImage.jpg"));
                   //  Start off full size
                   pWidth = myOrigonalImage.getIconWidth();
                   pHeight = myOrigonalImage.getIconHeight();
                   image = myOrigonalImage.getImage ().getScaledInstance(pWidth, pHeight, Image.SCALE_DEFAULT);
    //               image = this.viewer.getScreenBuffer();
    //               pane = new Panel();
                   //  Create a JPanel to draw the image
                   pane = new JPanel(){
                        protected void paintComponent(Graphics g)  {
                             System.out.println("Paint : pX " + pX + " pY :" + pY);
                             g.drawImage(image, pX, pY, pWidth, pHeight, getBackground(), this);
                   pane.setBounds (0, 0, pWidth, pHeight);
                   //  Load the button image using a URL
                   print = new JButton("print", new ImageIcon(PrintThisPolygon.class.getResource ("images/print.gif")));
    //               print = new JButton("print", new ImageIcon("images/print.gif"));
                   print.setBounds(0,5,55,20);
                   print.setEnabled(true);
                   print.addActionListener(new ActionListener(){
                        public void actionPerformed(ActionEvent ae){
                             print();
                   resize = new JButton("+", new ImageIcon("images/print.gif"));
                   resize.setBounds(55,5,50, 20);
                   resize.addActionListener(new ActionListener(){
                        public void actionPerformed(ActionEvent ae){
                             resizePlus();
                   desize = new JButton("-", new ImageIcon("images/print.gif"));
                   desize.setBounds(105,5,50, 20);
                   desize.addActionListener(new ActionListener(){
                        public void actionPerformed(ActionEvent ae){
                             resizeMinus();
                   //  Setup a transparent glass panel with no layout manager
                   JPanel glassPanel = new JPanel ();
                   glassPanel.setLayout (null);
                   glassPanel.setOpaque (false);
                   //  Add the image panel to the dialog
                   getContentPane().add(pane);
                   //  Add the buttons to the glass panel
                   glassPanel.add(print);
                   glassPanel.add(resize);
                   glassPanel.add(desize);
                   //  Set our created panel as the glass panel and turn it on
                   setGlassPane (glassPanel);
                   glassPanel.setVisible (true);
                   setBounds (100, 100, pWidth, pHeight);
    //               setBounds (100, 100, 500, 300);
              public String getAppletInfo() {
                   return "Identify Polygon\n";
    //          public void paint(Graphics g){
    //          protected void paintComponent(Graphics g)  {
    //               System.out.println("Paint : pX " + pX + " pY :" + pY);
    //               g.drawImage(image, pX, pY, pWidth, pHeight, getBackground(), this);
              protected void print() {
                   //  Pretend to print
    //               ImagePrint sp = new ImagePrint(this.viewer);
                   System.out.println ("Print view...");
              public void resizeMinus(){
                   //  Scale the image down 10%
                   int scaledWidth = pWidth - (int)(pWidth * 0.1);
                   int scaledHeight = pHeight - (int)(pHeight * 0.1);
                   scaleImage (scaledWidth, scaledHeight);
              public void resizePlus(){
                   //  Scale the image up 10%
                   int scaledWidth = pWidth + (int)(pWidth * 0.1);
                   int scaledHeight = pHeight + (int)(pHeight * 0.1);
                   scaleImage (scaledWidth, scaledHeight);
              private void scaleImage (int scaledWidth, int scaledHeight)  {
                   //  Create a new icon for drawing and retrieve its actuall size
                   image = myOrigonalImage.getImage ().getScaledInstance (scaledWidth, scaledHeight, Image.SCALE_DEFAULT);
                   pWidth = scaledWidth;
                   pHeight = scaledHeight;
                   //  Resize
                   setSize (pWidth, pHeight);
                   pane.setSize (pWidth, pHeight);
                   validate();
    }

  • How to set maximum bound for JDialog

    Hai..
    I want to resize the JDialog ...but it should particular size ....
    In JFrame ,We will define maximum Size using
    setMaximizedBounds(Rectangle bounds)
    like that i want in JDialog....
    give Solution
    Thanks in Advance....

    What you are asking doesn't make much sense because, setMaximizedBounds() only defines the bounds for the window in the maximized state, not the maximum size you can manually resize. And JDialogs don't have a maximized state. So what you are asking is not possible.
    If you want to restrict manual resizes, then use a component listener and restrict the bounds as it's resized.

  • Catching the start/end of component resizing?

    Hi Folks,
    I have a JPanel descendant and I want to store its initial size before being resized (by mouse), then at the end of resining, use this value to calculate the resizing factor.
    componentAdapter.componentResized() works fine for Windows LAFs, as it is called just once (when the mouse is released). But, using other Look and feels, it is called several times during the resize process (it can be seen also that the panel is repainted continuously).
    I tried to turn off repainting with setDynamicLayout(), but besides it did not worked at all, it looked ugly.
    My question: is there a way to get an event for determining the beginning and the end of the resizing process using any LAFs?
    Thanks,
    -meri

    Hello,
    well, who's controlling the resize? You have a mouse
    drag to do it? Then you can know on mouse press what
    the size is...Yes, a mouse drag is used to resize a JDialog which contains my component. The problem with mouse press is if it's a resizing (grabbing the border of the dialog), then no other mouse events are fired on the component (either MousePressed).
    or maintain the "current size" in a variable and
    compare that to the componentResized call and after
    done, reset the "current size" to the new size.Fine, I could do it (already done), but for special reasons, it would be much more better to calculate further sizes of the very first (initial) one.
    Thanks anyway! I will keep on searching for some solution...
    -meri

  • JDialog Problem

    When ever i set resize of JDialog is false ,the image idisappears. Plz help me
    Advanced thanx to all
    Susi

    Ahem... It's amazing that you haven't posted a minimal example program that demonstrates your problem.

  • SImple TextArea problem.

    I am getting back into Java after working in C++ for a long while so I am very rusty.
    I need my jTextArea to resize when when the jDialog resizing
    The jDialog uses a Gridbag layout with two cells
    The first cell has a jTextArea and the second contains a panel with two buttons.
    I have the jTextArea set to fill the cell vertically and horizontally and set the anchor to NorthWest.
    Any suggestions on what to try?

    Use a BorderLayout. Add the JScrollPane containing the JTextArea to the "CENTER" and then add your other panel to some other area in the BorderLayout.
    Read the Swing tutorial on [Using Layout Managers|http://java.sun.com/docs/books/tutorial/uiswing/TOC.html].

  • Resize jdialog without flicker effect

    I made a vertical tool palette with a JDialog : I have "setcontentpane" a JPanel with vertical boxlayout.
    This JPanel contains other JPanels (class PaletteZone extends JPanel) that act like tool zones : they can be collapse or expand. If you want to have look of what i'm talking about, there is an image here of the palette :
    http://db-maths.nuxit.net/im1.png
    Here is my problem... I have a PaletteZone method used to collapse the tool zone :
    public void collapse(){
            ContentVisible=false;
            ZoneTitle.title.setIcon(rightTriangle);
    // component 0 is the zone title bar, component 1 an icon set (within a JPanel) :
            this.remove(1);
            JP.validate();
    }******* 1) When I use JP.validate, there is no flickering at all and the zone collapse nicely. BUT the JDialog isn't set to the good size. If you want to have a look on what you get when you clic on "Construction" :
    http://db-maths.nuxit.net/im2.png
    ******* 2) If I use JP.pack(), of course the dialog is correctly resized and redrawn. BUT there is a flickering effect : I've made some tries on JFrames and JDialogs and I saw that a pack() call clear immediatly the background and then send a paint call : this "clear/paint" sequence makes a bad flickering effect. I have a quite recent computer (G5 and OS X), and I use java 1.4.2 so I don't think the fact that I see this flicker is caused by hardware or software...
    ******* 3) If I use JP.setSize(), things behave exactly like if I do a pack() call...
    Do you know what I could do to avoid this flicker ? to set the size to the JDialog without this "clear/paint" sequence ?

    you will have to create a jpanel and place this in the dialog's NORTH.
    add a mouseListener to the panel and provide your own moving-handling.
    this.setLocation((int) (this.getX() + e.getX() - m_iOffset.getX()) ...
    this.repaint();you'll have to set m_iOffset wehen mousePressend, and call the moving method when mouseDragged.

  • 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!

Maybe you are looking for

  • I just got a virus on my new MacBook Pro I used to get on my PC!

    This is my first Mac, and I am freaking out. I was just browsing the internet with Safari, and all of a sudden I had a popup that said, "Your PC is running slower than normal. You need to scan for viruses!" I tried just closing it, but it just kept p

  • Is it possible to use 3D objects in Flash CS4 for animation?

    Hi, Is it possible to use 3D objects created in 3D Max, Blendor, iClone etc. to perform animation to make Flash Movie more realistic? Can I make nice animations like in iClone 4 Software? If it is possible to use 3D Objects in Flash, please provide a

  • Need help with an effect I am going for

    Can anyone offer advice on how to create an image where the central subject is in color while making the remaining background B&W? Thank you.

  • Cannot add Users to Groups

    Hi there, I cannot add any users to any groups in the last week. This occurs only with the Server app.  In Workgroup Manager I can, but the group membership do not appear when I open the Server app.  I have tried to do this through the individual use

  • Help!! Sound Problems

    Hey all - I hope someone can help me out. I have a 30GB Ipod that I bought this April 06. For some reason my iPod's "sound", sounds really bad. Almost like it is muffled and has way to much bass. Any ideas on what is causing this and how I could chan