Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #435

Re: Windows Decoration Li

Path csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!novia!news-out.readnews.com!news-xxxfer.readnews.com!news-out.news.tds.net!newsreading01.news.tds.net!86597e80!not-for-mail
From "Michael Dunn" <michael.dunn@THRWHITE.remove-dii-this>
Subject Re: Windows Decoration Li
Message-ID <1166481378.405097.235620@80g2000cwy.googlegroups.com> (permalink)
X-Comment-To comp.lang.java.gui
Newsgroups comp.lang.java.gui
In-Reply-To <1166464557.075332.270460@l12g2000cwl.googlegroups.com><V
References <1166464557.075332.270460@l12g2000cwl.googlegroups.com><V
Content-Type text/plain; charset=IBM437
Content-Transfer-Encoding 8bit
X-Gateway time.synchro.net [Synchronet 3.15a-Win32 NewsLink 1.92]
Lines 43
Date Wed, 27 Apr 2011 15:27:31 GMT
NNTP-Posting-Host 96.60.20.240
X-Complaints-To news@tds.net
X-Trace newsreading01.news.tds.net 1303918051 96.60.20.240 (Wed, 27 Apr 2011 10:27:31 CDT)
NNTP-Posting-Date Wed, 27 Apr 2011 10:27:31 CDT
Organization TDS.net
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.gui:435

Show key headers only | View raw


  To: comp.lang.java.gui

> there doesn't seem to be any way to see actions on the title bar on a JFrame.

seems to work OK like this, but the frame might not be what you want.

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class Testing
{
  public void buildGUI()
  {
    JFrame.setDefaultLookAndFeelDecorated(true);
    final JFrame f = new JFrame();
    f.setSize(400,200);
    f.setLocationRelativeTo(null);
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.setVisible(true);
    f.addMouseListener(new MouseAdapter(){
      public void mousePressed(MouseEvent me){
        if(me.getY() < f.getRootPane().getInsets().top +
                              f.getContentPane().getY())
        {
          System.out.println("Title bar clicked");
        }
      }
    });
  }
  public static void main(String[] args)
  {
    SwingUtilities.invokeLater(new Runnable(){
      public void run(){
        new Testing().buildGUI();
      }
    });
  }
}

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Windows Decoration Listen "Jason Cavett" <jason.cavett@THRWHITE.remove-dii-this> - 2011-04-27 15:27 +0000
  Re: Windows Decoration Li "Knute Johnson" <knute.johnson@THRWHITE.remove-dii-this> - 2011-04-27 15:27 +0000
    Re: Windows Decoration Li "Jason Cavett" <jason.cavett@THRWHITE.remove-dii-this> - 2011-04-27 15:27 +0000
    Re: Windows Decoration Li "Jason Cavett" <jason.cavett@THRWHITE.remove-dii-this> - 2011-04-27 15:27 +0000
  Re: Windows Decoration Li "Michael Dunn" <michael.dunn@THRWHITE.remove-dii-this> - 2011-04-27 15:27 +0000
    Re: Windows Decoration Li "Knute Johnson" <knute.johnson@THRWHITE.remove-dii-this> - 2011-04-27 15:27 +0000
      Re: Windows Decoration Li "Thomas Hawtin" <thomas.hawtin@THRWHITE.remove-dii-this> - 2011-04-27 15:27 +0000
  Re: Windows Decoration Li "Michael Dunn" <michael.dunn@THRWHITE.remove-dii-this> - 2011-04-27 15:27 +0000

csiph-web