Hiding the Frame Border

Hi group,
You know when you start up Mozilla you get a little picture which flashes up breathing fire? I wanna make a frame do that! I've got it so it flashes up a picture for 3 seconds and disposes of itself. From the main application it is run as a thread. I run it by calling
new showflash().
Here is the code ...
import java.awt.*;
import javax.swing.*;
import java.awt.geom.*;
public class Flashpan extends JPanel {
private ImageIcon m_icon;
public Flashpan () {
JFrame frame = new JFrame("Border Title Bar");
frame.setSize(669, 525);
Container content = frame.getContentPane();
content.add(this);
m_icon = new ImageIcon("image.jpg");
/*flash the window*/
frame.setVisible(true);
/* 3 second delay */
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
/*kill the window*/
frame.setVisible(false);
frame.dispose();
public void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2d = (Graphics2D) g;
m_icon.paintIcon(this, g2d, 10, 10);
public static void showflash() {
new Flashpan();
Now the question is How do I make the window borders disappear. I have only one object contained in the frame, the picture. I want everything to disappear without killing it except this picture object? How do I do it? Im sure many people must have done this!! Maybe my code sucks.. pls forgive me :P
Ive been looking at Inset() BorderLayout() etc.. etc.. but cant seem to work it out or find an example. I thought maybe it was frame.Inset(0,0,0,0) but I was wrong.

Bingo, Ta for that....
Complete code is as follows (screen centers now)
import java.awt.*;
import javax.swing.*;
import java.awt.geom.*;
public class Flashpan extends JPanel {
private ImageIcon m_icon;
public Flashpan () {
JWindow frame = new JWindow();
frame.setSize(640, 480);
/* Get the size of the screen */
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
/* Determine the new location of the window */
int w = frame.getSize().width;
int h = frame.getSize().height;
int x = (dim.width - w) / 2;
int y = (dim.height - h) / 2;
/* Move the window */
frame.setLocation(x, y);
Container content = frame.getContentPane();
content.add(this);
m_icon = new ImageIcon("image.jpg");
/*flash the window*/
frame.setVisible(true);
/* 3 second delay */
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
/*kill the window*/
frame.setVisible(false);
frame.dispose();
public void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2d = (Graphics2D) g;
m_icon.paintIcon(this, g2d, 0, 0);
public static void showflash() {
new Flashpan();
greg

Similar Messages

  • Hiding the frame in Task Bar Tray

    My Problem is
    When i minimize the frame, i want to position it in the task bar tray.
    (which is on the right side of the task bar where all icons date,volume etc are shown)
    Eg: Suppose if we minimize the yahoo messenger,it will be shown in the task bar tray.
    Thanks
    Varma

    take a look at http://systray.sourceforge.net/
    You have to do the following to hide the frame when it's minimized:
        final JFrame frame = new JFrame("test");
        frame.addWindowListener(new WindowAdapter()
          public void windowIconified(WindowEvent e)
            frame.setVisible(false);
        });use the systray api to create the systray icon and menu, and you're finished

  • Adding a frame border to rounded corners photo

    New to PS..running current ver of 11.x... I found the rounded corners tutorial and that helps alot...but I have a number of photos on a website that I would like to also add a "border" to.
    sample image corner here:  http://members.cox.net/trinaz/roundercorner.gif
    This is a clip up the upper right corner.  The tutorial will let me round my photo corners as needed...but is there another function that will give the rounded photos a thin "chrome-like" border like in the gif link ?
    Thanks, Tim

    Just add a stroke using Layer Styles. Select the layer containing the frame border, go to the fx icon at the bottom of the Layers panel and choose Stroke. After that, select Bevel & Emboss from the same dialog and select Stroke Emboss from the Style dropdown

  • Content touches frame border of subform on pagebreak

    Hello everybody,
    we've got a (semi-) heavy problem with subforms and their content on page breaks.
    the subform contains a textbox which is bound to a data element (supplied by SAP data interface). when we get a page break because we have enough lines inside, the last line on the page hits the frame border of the subform, that means, it is not "inside" the subform completely (what it should be in fact!)...
    i can send screenshots of the problem as well as screenshots of the layout in the designer, just send me an email.
    every idea help solving is welcome,
    thanks a lot
    best regards
    Michael

    Thanks a lot.
    Works really fine...
    but in fact it is really strange to have to define an extra margin to prevent having the content being stroke through by the frame border, isn't it?
    with best regards
    Michael

  • The blue background colour is not shown with my client, so how can I change the frame colour of a field?

    Hey,
    I do have a problem, my client does not see the blue marked background fields in my form. He uses the version Acrobat X1, 11.0.10. I do see it with my Acrobat Pro and the Acrobat Reader version. Now I wanted to highlight the fields with a colour or a frame colour, but I can't select any of it. I don't want to mark the fields in Indesign and then put form fields in Acrobat over it. But I don't know any other way. I'm working on a Mac, my clients uses Windows.
    Can you please help me out?
    Thank you so much,
    Anna

    They can enable it by going to Edit - Preferences - Forms and clicking the "Show border hover color for fields" box.

  • How to set the size of the frame in the decoration controls

    Hi,
    I am drawing some frames or boxes using the patterns in the "Decorations" control in labview.
    Is there other way to set the size of the frames or boxes rather than to drag them? also how can I change the color of the borders?
    Thanks,
    Joyce
    Solved!
    Go to Solution.

    Select the item.  Go to the Resize Objects button on the toolbar.  Pick the last one which shows a resize within a dialog bubble.  Now a dialog pops up which lets you define the height and width.
    To color something, Shift right click to bring up the toolbox.  Pick the paint brush.  Click on the thing you want to change such as the border.  It might now be the wrong color, so right click which brings up the color picker.  Now select the color you actually want.  If you want something to be transparent, pick the T at the upper right corner of the color dialog box.

  • Panel doesn't display properly until I resize the frame

    Hiya folks,
    I'm currently trying to write a simple piece of music notation software. This is my first time using swing beyond a relatively simple JApplet and some dialog stuff. Anywho, I ran into a pretty discouraging issue early on. So far I've got a frame with a menu bar and a toolbar on the bottom border. The toolbar contains a button which should draw a new staff panel containing 11 panels (potentially more) within it, alternating between lines and spaces. Sort of like this:
    import javax.swing.*;
    import java.awt.*;
    public class Staff extends JPanel {
       private static JPanel nsp1,nsp3,nsp5,nsp7,nsp9,nsp11;
       private static JPanel nsp2,nsp4,nsp6,nsp8,nsp10;
       private ImageIcon image= new ImageIcon(this.getClass().getResource( "icons/treble clef.gif"));
        public Staff(){
        setLayout(new GridLayout(11,1));
        add(nsp1= new NoteSpace());
        add(nsp2= new LineSpace());
        add(nsp3= new NoteSpace());
        add(nsp4= new LineSpace());
        add(nsp5= new NoteSpace());
        add(nsp6= new LineSpace());
        add(nsp7= new NoteSpace());
        add(nsp8= new LineSpace());
        add(nsp9= new NoteSpace());
        add(nsp10= new LineSpace());
        add(nsp11= new NoteSpace());
    static class NoteSpace extends JPanel{
        public NoteSpace(){
        setPreferredSize(new Dimension(this.getWidth(),2));
    static class LineSpace extends JPanel{
          public LineSpace(){
          setPreferredSize(new Dimension(this.getWidth(),1));
          public void paint(Graphics g) {
              super.paint(g);
              g.drawLine(0, (int) super.getHeight()/2, (int)super.getWidth(), (int)super.getHeight()/2);
    }Anyway, this panel displays as a tiny box wherein nothing is visible until I resize the frame. Really frustrating. And I have have no idea what the problem might be. Here's the actionlistener:
    jbtcleff.addActionListener(new ActionListener (){
            public void actionPerformed (ActionEvent e){
                staff.setBounds(50,panel.getHeight()/2,panel.getWidth()-50,panel.getHeight()/2);
                panel.add(staff);
                staff.repaint();
            });...which is located in a custom jtoolbar class within the Main class, an extension of JFrame:
    public class Main extends JFrame{
       JMenuBar jmb=new CustomMenuBar();
       JToolBar jtb= new CustomToolBars("ToolBar");
       static boolean isStaff=false;
       static boolean isNote=false;
       static JPanel panel = new JPanel();
       private static Staff staff= new Staff();
        private static Toolkit toolkit= Toolkit.getDefaultToolkit();
       private static Image image=toolkit.getImage("C:/Users/tim/Documents/NetBeansProjects/ISP/src/MusicGUI/icons/treble clef.jpg");
        private static Cursor noteCursor = toolkit.createCustomCursor(image,new Point(0,0),"Image"); 
       public Main (String m) {   
            super(m);
            setJMenuBar(jmb);    
            getContentPane().add(jtb,BorderLayout.SOUTH);       
            panel.setLayout(new CardLayout(60,60));
            getContentPane().add(panel);
    public static void main (String[]args){
            JFrame frame= new Main("Music");
            frame.setSize(800,400);
            frame.setLocationRelativeTo(null);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setVisible(true);
            frame.setIconImage(image);
           Sorry for all the code. I'm desperate.
    Thanks!

    Oh my... have you been through the Swing tutorial?
    Let's look at some of your code,
    static class NoteSpace extends JPanel{
        public NoteSpace(){
        setPreferredSize(new Dimension(this.getWidth(),2));
    static class LineSpace extends JPanel{
          public LineSpace(){
          setPreferredSize(new Dimension(this.getWidth(),1));
          public void paint(Graphics g) {
              super.paint(g);
              g.drawLine(0, (int) super.getHeight()/2, (int)super.getWidth(), (int)super.getHeight()/2);
    }Here, NoteSpace and LineSpace are being set to a preferred size of 0x2 pixels, and 0x1 pixels respectfully. If you want them at 0 width, how do you expect them to show? In particular, NoteSpace isn't doing anything special. It's just a panel. Why an inner class? Lastly you should not override paint() for SWING. That's AWT stuff. For Swing, you override paintComponent(Graphics g) .
    Then we have this
    jbtcleff.addActionListener(new ActionListener (){
            public void actionPerformed (ActionEvent e){
                staff.setBounds(50,panel.getHeight()/2,panel.getWidth()-50,panel.getHeight()/2);
                panel.add(staff);
                staff.repaint();
            });I'm not sure what the variable jbtcleff is, but it seems you are adding your Staff panel to "panel" every time a button is pressed.... why? Why not just add it once (outside the action listener) and be done with it. Your panel object has a CardLayout, so I assume you meant to create a new+ staff panel everytime a button is pressed, and then add it to the card layout panel. Even so, setBounds(...) does not seem pertinant to this goal. (In fact, in most situtations the use of setBounds(...) is the antithesis of using layout managers).
    The problem you mentioned though seems to be related to the use of a JPanel (your Staff class) that adds zero-width compontents to a grid array.

  • Top and bottom margins to be inside the frame and form should less cluster

    Hi All,
    In my application we have created nearly 10 regions and for each region i have created sub regions with No templates. Here are the deatils below.
    I need to display two regions side by side with borders, so what i have done is
    1. Created a region as #Region Start with No template with Display point as "Page template body (1. items below region content) and Header and footer i have
    given as <table border="1"><tr><td>
    2. Followed by region as #What with Wizard region as "Page template body(1. items below region content) and nothing given under header and fotter.
    3. Followed by reagion as #Region Middle with No template with Display point as "Page template body (1. items below region content) and Header and footer i
    have as </td><td>
    4. Followed by region as #where with Wizard region as "Page template body(1. items below region content) and nothing given under header and fotter.
    5. Folowed by region as #Region End with No template with Display point as "Page template body (1. items below region content) and Header and footer i have
    given as </td></tr><tr><td>
    Simiallry followed by rest of regions by creating dummy regions and placing the <tr> and <td> in Header and Footer.
    Now users are asking me to have insde the frame and form shoul dbe less cluster.
    Can suggestiosn on this who we need to achieve.
    Thanks,
    Anoo..

    'File' > 'Page Setup' is used to alter the page margins when you need to print the email. It is not used to create a Template email nor to change the overall theme used in the Thunderbird user interface.
    To add a theme to the overall Thunderbird window, you can choose
    * either a Windows theme via Control Panel > Personalization >Theme
    * or download a theme Add-on, there is a huge range here: https://addons.mozilla.org/en-US/thunderbird/themes/
    such as : https://addons.mozilla.org/en-US/thunderbird/addon/balloons/?src=ss
    If you are looking to create a Template email, then you open a new Write message, design the email, enter a Subject so that you can easily locate the email and click on 'File > Save as > Template or click on Save button and choose 'Template' from the options. then the email is saved in the Templates folder. To use, you click on Templates folder and double click on the email to open in a new Write message. then compose and send as normal. The original email will be saved in Templates folder for reuse.

  • Is there a setting where a text frame (border, color, etc) will be visible only when it has content?

    I use data merge a decent amount, often when I am quick prototyping decks of cards for games. (Talk about an awesome tool for quickly cranking out a hundred different cards). I was wondering if it possible to have a text frame style (say a 1pt solid black border, or a yellow background etc.) appear only when there is text inside that frame.
    For example the cards need to have different combinations of text on each one. The lower part of this particular card has 30 data field placeholders (15 text frames and 15 graphic frames) that are linked back to my .txt file with data merge. (In the first image below, all 30 data fields have data in them, the other images only have some data applied) The text frames hold the two letter code, the graphics frame is basically a .png of either a rectangle or oval which is on a layer behind the text frame.
    It would be awesome if a text frame border was only present when there was content in the text frame. That way I could eliminate all of the graphics frames in this particular case. Is this possible? I knid of don't want to ask this, but is it possible through scripting with some sort of conditional statement? (Iknow very little about scripting except that it exists to do certain tasks on a as needed basis)
    I'm using InDesign CC on Mac OSX 10.7.5
    Thanks!
    go-dog-go

    There's no one solution. Depends on the context.
    When we know what we have and where we want to go, everything becomes simple ...
    In your case, the solution I prefer is that with grep styles.
    Why? because it is truly magical.
    The beginning...
    All you finally have to do in the data file is inserting columns of calculation. We can talk later.
    This solution with grep style is very simple to define. In ID and Excel (for instance). Because I know how to do. I understand It could be not so simple for another person.

  • Hiding the header of a group using dynamic programming

    Hi,
    I had a requirement where we needed to place a border around the UI elements. For this purpose i had used a group UI element. But the group UI element by default has an attached header (Setting the visible property of header to "None" only disables the header text). Hence as per the suggestions in the following thread i had set the caption dynamically (in WDDOMODIFYVIEW) which removed the group header completely.
    Hiding header of a group
    Now, when i was browsing through the forum i came across the reply by Thomas in the below thread,
    Setting value in cookie using ABAP code
    //if someone does post a "hack" or "illegal" way of setting the client cookie directly from Web Dynpro; this would not be supported by SAP and could stop working at any time.//
    Truly said, it might stop working at anytime. This might apply to my case as well as i am setting the caption dynamically. I am not sure is the right allowed way or if i am using one of the "illegal" ways (which would stop working at some SP levels).
    Can someone clarify if hiding the header of a group using the above method is allowed?
    Regards,
    Prasath N

    The usage of WDDOMODIFY method for dynamically altering the view (e.g. hiding or showing UI elements) is perfectly "legal".
    The manipulation of a cookie by the developer is not intended inside the Web Dynpro framework.
    These are two completely unrelated issues, as per my understanding Thomas warned about the second.
    I think you're mixing things up.

  • Is it possible on iMovie 11, to change the frame length of a still to something less then 0.1s?

    I have about 3008 different still photos that are frames of a slideshow introduction I made. When editing the frame length, the fastest I can make it is 0.1s and that does not look smooth enough. I am very new at this and am not even sure what speed i should have the frames moving so that it looks smooth, and is it even possible for the speed to be faster then 0.1s? Any support would be greatly appreciated, thanks.

    They can enable it by going to Edit - Preferences - Forms and clicking the "Show border hover color for fields" box.

  • Frame border in Gauge during drill through

    Hi,
    When I click on my charts or gauge to drill through, I notice that a outline of sorts appears when I click the object. I understand it is normal in charts as the specific series is clicked. But my problem is with the gauge. I have no frame for my gauge. But
    when I click the Gauge to drill through, I get a outline of sorts.  
    I'm not able to post a image here. A almost black circle appear when I click the Gauge. This happens in the report server and report viewer and not in Visual Studio. The Frame style in none. I have two Range. I have checked the all the possible properties
    with no solution.
    Kindly let me know if I have to look elsewhere.
    Thanks in advance.
    Leah

    Looks like even when the Frame Style is None when clicked for drill through, an outline or border of sorts appears according to the Frame shape.
    It was circular in my Gauge. I have changed it to rectangular. So it does not look odd anymore.

  • Why do background clips show at the edges of the frame?

    Disclaimer, I'm brand new to video editing... this may not be a bug or even a problem for others, but it's annoying the crap out of me right now.
    If I have 2 clips on the timeline that overlap, the edges of the frame let the lower clip peek through.
    It is especially noticeable when the top clip (the one I want to be actively playing) has a black background, and the clip underneath (that should not be visible at all) has a light colored background. The result is a white border about 1 pixel thick all the way around the image. Why does it do that?
    Note in the attached image the thin white border around the frame when played back at actual size (720p) in full-screen mode. The worst part, is that the white border is actually a moving image itself, and so it flickers and draws a lot of attention to itself.
    I know the simple answer would be to go in and cut out every single shot perfectly, so there are no overlapping clips at all. But that seems ridiculous to me. I like having handles to slide transitions around. What's the point of having a clip heirarchy if it doesn't even work?

    Scale up the image so the edge is cropped off.

  • CSS Display table with the bottom border alone

    Hi all,
    I am very poor in CSS, I badly in need of a style.
    I want the table with the bottom border alone
    i tried like
    <table frame="below" cellpadding="2px" cellspacing="0" style="overflow:scroll;empty-cells:show;border:1px solid #285577;" width="350px">';
    but frame="below" is not working with IE-7
    Please could any give me a solution.
    thanks in advance
    bye
    Srikavi

    Srikavi,
    I do not know what kind of table you exactly need but
    &lt;table style="border-bottom: 1px solid #285577;">
    should do the work.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Can you programmat​ically change a picture control frame/bord​er

    In a platform neutral manner can I programmatically change a picture control frame/border
    Solved!
    Go to Solution.

    You can make it look that way using many differnt methods.
    The simplest is to make the border transparent and put a boolean behind the picture. Size the boolean so it looks like it is the border of the picture. Change the color of the boolean and you are on you way.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

Maybe you are looking for

  • Jump to Message not working.

    One of my users showed me an odd behavior a few days ago, when they create "To Dos" in either Mail.app or iCal, the "Jump to Message" option is grayed out. I was able to replicate this on my machine. Both of us have multiple accounts in Mail.app, cou

  • How to save the output of report program??

    Hello Everbody, I want to save the output of a report program(i.e list),how can i do this???which function module should i use to achieve this??? Thanx in advance.

  • Revenue Planning to cost elements

    Hi, I am Working on Project system object. When i am trying  planned revenue is added on the project, I need to find if there is a way to assign the revenue amount on the lowest WBS to a cost element. This is required for revenue amounts to appear in

  • Confirm Receipt Workflow for Complex PO

    Hello, On R12.1.3 Oracle has stopped Confirm Receipt workflow for Complex PO Ref# Confirm Receipt Workflow Sents Notification To The Buyers For Complex Purchase Orders (Doc ID 1532652.1). We would like to get this notification (yes, it needs change o

  • Scroll too slow in table in WD abap

    Hi experts, in my Dynpro I have a table with Layout Data  defined as GridData and scroll is very very slow also with 20 entry in table. In the same portal I have a dynpro with a table with Layout Data defined as RowHeadData and there is no problem wi