Display transparent panel over JFrame

Hi
I need to display a transparent panel (or even just a panel for that matter) on top of the other components in a JFrame, this would be like a notification box that can come and go away, but it should not be a JFrame, instead a floating JPanel. Basically if I can just position it on top of the other components without affecting them (I'm using a BorderLayout) it would be great.
Regards
Lionel

Hi
Thanks a million.
Got it working, is there a way to make the top layer smaller and center in the middle of the frame? I've got all my normal components now a DEFAULT_LAYER and a JPanel as MODAL_LAYER, can I make this JPanel sit in the center of the frame?
I have this at the moment:
panel.add(workBar, BorderLayout.CENTER, JLayeredPane.MODAL_LAYER);
But it fills the entire frame once this is added.
Regards
Lionel

Similar Messages

  • Unable to set a transparent panel over Images for annotations

    Hi All,
    I am developing a Swing Application for image processing.
    My aim is to display the image on a JPanel and over which the user should be able to draw different geometrical figures(line,circle,polygons,etc) and write annotations on that. These drawings should not affect the original image.
    Also, these drawings should be movable, like if I zoom the image, drawings over the image should also zoom in the same ratio.
    Initially, I thought of using the GlassPane but stuck up with some issues, relating to its implementation.
    It would be great, if you could suggest me some guidelines or pont me to some resources for the same.
    Any help in this regard will be highly appreciated.
    Thanks,
    Manu
    Edited by: manu_agarwal on May 8, 2009 12:46 PM

    Hi Adam,
    Thanks for your reply.
    My intention is that after draing annotations on the image, if the user wants to zoom or move image(panning), the annotations should also move.
    Thanks,
    Manu

  • Connecting extra monitor to DVI-I connection EVS 1464 (displaying Front Panel)

    Hi,
    Currently developing a Vision system using the following:
    LabVIEW 2010 SP1
    LabVIEW 2010 Real-Time SP1
    Vision Development 2010 SP1
    EVS 1464
    My question is:
    How can I display my front panel, running on the EVS, on a monitor connected to the DVI-I output of the EVS 1464?
    Thanks ahead!
    Roy
    Solved!
    Go to Solution.

    Hi Roy, I'm not sure if Hossein actually read that KB or not, but it deals with displaying the front panel over the network on a Windows machine, not out through the monitor connection on the EVS running LabVIEW RT.
    To answer your original question, no, it is not possible to view the standard LabVIEW front panel on the RT system today. All the code for displaying all the front panel UI buttons, controls, and indicators is simply not present in LabVIEW Real-Time and is only viewable on a seperate machine that is either running the development environment or using a web browser that has the LabVIEW plugin installed. 
    Having a UI display on RT is certainly a requested feature and perhaps it might be available some day. You might want to check this request: http://forums.ni.com/t5/LabVIEW-Real-Time-Idea-Exchange/Real-time-display/idi-p/1391108 . It has some good ideas for what other alternatives exist today as well.
    However, this is one way to use the monitor output on the EVS and other LabVIEW RT systems. Vision Development Module includes RT Video Out VIs that can display any image on the connected monitor. You can either display images captured from cameras or custom images, as well as overlay text and simple graphic objects (lines, circles, rectangles, etc). It is certainly more effort than the normal front-panel editor in LabVIEW but it might be suitable for your needs if you want a few things to display. Of course you will have no mouse/keyboard so you cannot interact with any on-screen elements directly.
    Eric

  • Scrolling semi-transparent panels

    I have a parent panel that paints a custom background. Within that panel, I embed another panel held by a JScrollPane. My intent is to have the custom background show through on the panel that is being scrolled.
    To accomplish this, I set both the scrollpane and the viewport to non-opaque and then I set the panel held by the scrollpane to non-opaque as well.
    When I run the program everything works fine and the panel can be scrolled and displayes the background image just as I want it.
    Next, I want to set the panel in the scrollpane to be semi-transparent. I set the panel to opaque and give it a semi-transparent background color(ie alpha value or .5). This gives me a see-through effect and when I run the program it initially looks good. However, when I scroll the panel, the refresh is not handled correctly. The problem appears to be that the paint method of the parent panel is not being called.
    I think the scrollbar code incorrectly assumes that since the embedded panel is defined as opaque that the parent panels do not need to be painted. However, this assumption is only valid if the background color of the embedded panel has an alpha value of 1.0
    Does anyone have a workaround for scrolling semi-transparent panels?

    On second thought, that's going to cause a stack overflow. You are going to need a flag to not call it. Something like so:public void paint(Graphics g) {
        if (someflag) {
            someflag=false;
            bgPanel.paint(bgPanel.getGraphics());
            someflag=true;
        // do my painting stuff ... super.paint(g); ???
    }Just a thought, I haven't tested it.

  • Any way to display dorpdown menu over quick time player

    hi all,
    Is there Any way to display dorpdown menu over quick time
    player in Dynamic HTML page like the flash parameters wmode
    transparent....The menu and quick time is different Td's
    Thanks

    Not that I know of.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "jibysk" <[email protected]> wrote in
    message
    news:ff9rjk$i6l$[email protected]..
    > hi all,
    >
    > Is there Any way to display dorpdown menu over quick
    time player in
    > Dynamic HTML page like the flash parameters wmode
    transparent....The menu
    > and quick time is different Td's
    >
    > Thanks

  • Applying a mask via Transparency Panel

    I want to mask a bunch of lines to a rectangle.
    - I select the entire group of lines and choose and object > group
    - I drag the group over the rectangle
    - I double click in the open area next to the thumbnail for it in the Transparency panel to apply a mask
    Nothing seems to happen. How am I doing this wrong?

    Place the rectangle above your artwork. Select the artwork and the rectangle. Choose Make Opacity Mask from the Transparency panel Menu.
    It sounds like you want a clipping mask though...... Place the rectangle above your artwork. Select the artwork and the rectangle, choose Object > Clipping Mask > Make

  • Problem Displaying Images in a JFrame

    I am writing a program that displays images on a JFrame window. I have been reading the other postings about this topic however I have not been able to make my code work. I am hoping there is some obvious solution that I am not noticing. Please help, I am very confused!
    public class WelcomeWindow {
    private JLabel label;
    private ImageIcon logo;
    public WelcomeWindow() {
    label = new JLabel();
    logo = new ImageIcon("/images/logo.gif");
    label.setIcon(logo);
    this.getContentPane().add(label);

    Instead of a JLabel, have you tried to use a JButton containing the Icon?
    Also (but I think you've done it already), you could do that :
    File iconFile = new File("/images/logo.gif");
    if (!iconFile.isFile()) {
    System.out.println("Not a file");
    That way you'll be certain that the path given is correct.
    Hope this helps.

  • Problem with display an image on JFrame in Java 6

    I'm trying to display an image on JFrame in this way:
    1.) I'm creating a variable in the class:
        private Image imgSpeaker = null;2.) I'm overiting the paint method:
    public void paint(Graphics g) {
            super.paint(g);   
            g.drawImage(imgSpeaker, 330, 230, null);  
        }3.) In the constructor I'm using this code:
       imgSpeaker = Toolkit.getDefaultToolkit().getImage("D:\\speaker.gif");
            MediaTracker trop = new MediaTracker(this);
            trop.addImage(imgSpeaker,0);
            try {
                trop.waitForID(0);    // waiting untill downloading progress will be complite
            } catch (Exception e) {
                System.err.println(e);
            }        The Image will be displayed on form, but if I catch the window and move it (for example: down as possible)
    the image is not refreshed (repainted). What I'm doing wrong? I've been used this solution in Java 5 and everything
    works perfectly. Any of described methods aren't depricated... Anyone can help me?

    Thanks for your code, I've been tryed to apply your solution (with create a Buffered Image), but it still not working correctly. Firstly, the image isn't loading, and secondly the basic problem is not give in. Why have you been using "bg2d.draw(img, x, y, w, h, frame);" not in the paint method?
    I'm use "Free Design" layout. Below I put on completly code from Netbeans.
    import java.awt.Graphics;
    import java.awt.Image;
    import java.awt.MediaTracker;
    import java.awt.image.BufferedImage;
    public class ImageTest extends javax.swing.JFrame {
        private Image imgSpeaker = null;
        private BufferedImage bi = null;
        private MediaTracker trop = null;
        public ImageTest() { 
                initComponents();
                trop = new java.awt.MediaTracker(this);
                imgSpeaker = java.awt.Toolkit.getDefaultToolkit().getImage("D:\\speaker.gif");
                try {
                    trop.addImage(imgSpeaker, 0);
                    trop.waitForID(0);
                } catch (java.lang.Exception e) {
                    java.lang.System.err.println(e);
                bi = new java.awt.image.BufferedImage(100, 100, java.awt.image.BufferedImage.TYPE_INT_RGB);
                java.awt.Graphics2D bg2d = (java.awt.Graphics2D) bi.createGraphics();
                trop.addImage(bi, 1);
    //            java.io.File f = new java.io.File("D:\\speaker.gif");
    //            try {
    //                bi = javax.imageio.ImageIO.read(f);
    //            } catch (IOException e) {
    //               java.lang.System.err.println(e);
        public void paint(Graphics g) {
    //      super.paint(g);
           try {                                                   
                trop.waitForAll();                                 
            } catch (Exception e) {
                System.err.println(e);
            g.drawImage(bi, 50, 100, imgSpeaker.getHeight(this), imgSpeaker.getHeight(this), this);
        // <editor-fold defaultstate="collapsed" desc=" Generated Code ">
        private void initComponents() {
            jButton1 = new javax.swing.JButton();
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            jButton1.setText("jButton1");
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                    .addContainerGap(283, Short.MAX_VALUE)
                    .addComponent(jButton1)
                    .addGap(44, 44, 44))
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                    .addContainerGap(252, Short.MAX_VALUE)
                    .addComponent(jButton1)
                    .addGap(25, 25, 25))
            pack();
        }// </editor-fold>
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new ImageTest().setVisible(true);
        private javax.swing.JButton jButton1;
    }

  • How to connecttwo external 19" LCD panels over DVI to MBP

    Hi,
    Is it possible to connect two 19" LCD panels over DVI to a MBP and run them as a single extended desktop?
    I've not been able to find an answer in the many posting and I get the impression its possible, but I'm not sure. I get more doubtful when I start to figure out how to do the cabling (daisy-chain the panels, use a DVI splitter?).
    Any help is greatly appreciated!
    F

    Do you use this set-up with multiple monitors and the extended desktop?
    I ask because I followed your suggestion but at the Matrox site (http://www.matrox.com/graphics/en/cadgis/products/th2go/th2go.php) all the indications are that it only works with Windows. Even the user handbook doesn't reference Apple at all.
    It sounds like a great idea, but I'd like to verify it works before spending the $300.
    Francis

  • Semi transparent drawing over the picture

    Hello every one
    I am drawing the arrow image over the picture , so after drawing the arrow over the picture how to make it semi transparent so that background picture also should appear . 
     Please see the attached vi
    Attachments:
    arrow1.zip ‏2436 KB

    Thank you Strokes
    See the below pic i need this kind of output, transparent  drawing over the 2picture 
    Attachments:
    arrow transparent.PNG ‏411 KB

  • Title: How to give transparency effect to JFrame?

    Hai,
    we are developing stand alone application using java swing. In our application we need to show an image in JFrame. We draw an image in JPanel using JPanel's paintComponent method. Then we place this JPanel into JFrame. The image is having transparent effect. But we are not able to give transparency effect to JFrame so we couldn't see desktop we are seeing only JFrame's background. *{color:#0000ff}How to give transparency effect to JFrame?*
    *{color}*
    Thanks for your help.

    It's not a commited part of the standard API yet, but as of 1.6_10 you can add transparency effects to a window through the use of
    com.sun.awt.AWTUtilitiesI think this was the original article on the release. If you google, you will find many creative ideas that people have come up with using this particular feature.

  • Displaying HTML page from JFrame

    Hi ,
    I have a JFrame GUI with menus and menu items. After Clicking on the Help Menu Item, I want to display a HTML page. Does anyone know of a function to display an HTML page?

    import javax.swing.*;
    import java.awt.*;
    import java.io.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    // This class is used in the Image Tool class when the help menu item is selected
    public class HelpMenu extends JInternalFrame implements HyperlinkListener{
    // A new JEditorPane to display the help html file in.     
    private JEditorPane jep;
         public HelpMenu () {
              super("Help Menu",
                        true, //resizable
                        true,     //closable
                        true,     //maximizable
                        true);     //iconifiable
              // Set the size and location of the frame
              setSize(500,500);
              setLocation(20,20);
              // create the JeditorPane
              jep = new JEditorPane( );
         jep.setEditable(false);
              // Make jep a scrollable pane
              JScrollPane jsp = new JScrollPane(jep);
         getContentPane( ).add(jsp, BorderLayout.CENTER);
              // Add a listener to listen for hyperlinks within the document
         jep.addHyperlinkListener(this);
         try {
         String HelpFile = "file:C:/Documents and Settings/Patrick/Desktop/Help.html";
         jep.setPage(HelpFile);
              // If the file can be loaded display the frame
              setVisible(true);
         catch(Exception e) {
              // The file could not be loaded.
              System.out.println(
                   "Could not open help page! Has it been deleted from: C:/Documents and Settings/Patrick/Desktop/");
              // If the file can not be loaded display an error message
              JFrame f = new JFrame();
         JOptionPane.showMessageDialog(f, "Could not open help page! Has it been deleted from: C:/Documents and Settings/Patrick/Desktop/",
                   "Help Menu", JOptionPane.WARNING_MESSAGE);
              // If the file cannot be loaded do not display a frame
              setVisible(false);
    public void hyperlinkUpdate(HyperlinkEvent he) {
    HyperlinkEvent.EventType type = he.getEventType( );
         if (type == HyperlinkEvent.EventType.ACTIVATED) {
    try {
    // set the page to show the selected section of the file
    jep.setPage(he.getURL( ));
    catch (FileNotFoundException e) {
    catch (Exception e) {
    }     

  • Displaying "af:panel accordion" dynamically in UI when page loads

    Hi
    My problem is, whenever my homepage loads "af:panel accordian" should display dynamically in UI. Like, if I mention value 4 in manged bean it should display 4 panel accordion in UI when it loads, and if it is 6 then it should display 6 panel accordion in my homepage.
    Please help me in this issue. Looking forward for you response.
    Regards
    Venkat.S

    Hi
    Actually only one panel accordion will be in my UI(sorry for my previous message), but the "af:showdetailitem" under af:panel accordion will differ and the values of this will varies each time when the page loads. So dynamically i should add af:showDetailItem into this af:panelAccordion from manged bean.
    Regards
    Venkat.S

  • Could not load Displays preference panel?

    Hi I need some help. I keep getting the following error when I try to open the Desktop & Screen save or the Displays Preference panel in the System Preferences.
    Ive just purchased the device and Its a new MacBook Pro (Retina, 13-inch, Mid 2014), 3 GHz Intel Core i7, 8 GB and Ive just installed Yosemite. Not a massive issue at the moment but I guess its an underlying issue that needs resolving so any help would be appreciated.
    Thanks

    Hi I need some help. I keep getting the following error when I try to open the Desktop & Screen save or the Displays Preference panel in the System Preferences.
    Ive just purchased the device and Its a new MacBook Pro (Retina, 13-inch, Mid 2014), 3 GHz Intel Core i7, 8 GB and Ive just installed Yosemite. Not a massive issue at the moment but I guess its an underlying issue that needs resolving so any help would be appreciated.
    Thanks

  • Transparent layer over something opaque

    Hi I'm trying to put an image over a webcam video. Is it possible to put a transparent layer over the video so it makes the video form into a shape.
    Like here's the webcam ->
    |                    |  
    |                    |
    Can I put a image layer over it that is transparent, that will show the background through? Like this ->
    |              |___ <- this is an image layered over the webcam with the background visible.
    |                    |
    Thanks if anyone can lend me a hand.

    Hi...
    Looks like we are trying to do the same thing - unfortunately we don't know much about coding, so we don't quit understand what to do.
    we would like to place an image on top of the webcamera
    so that the image of whats is being recorded is behind this image.
    is it possible?

Maybe you are looking for

  • EEWB (attributes from product set type)

    Hi gurus, I have a question about EEWB. Could you please help me. There is possibility to add components (attributes from product set type) at item level: Business object - BUSINESS_TRANSACTION Extension Type - ADD_NEW_ITEM_COMPONENT. I’ve created an

  • How to hide a SWF file on a Stage?

    Hi, I am loading my SWF file onto stage. Later, I want to hide it. For movie clips, I am using the following code:      TAC_mc.visible =false; But I can't do the same to my SWF file.      Countdown.swf.visible = false; Please do help.

  • Wont send text messages.

    i have full service but my iphone 3gs wont sent text messages

  • Concept of SAP Clustering in Windows

    Dear Experts I  am Installing the SAP ECC6 EHP4 Clustering in the Windows 2003 Enterprise Edition.  I have completed the windows Clustering MSCS and Database Clustering SQLSERVER 2005  in the NODE A and NODE B.  I also aware that i need to install th

  • Audio files taking up too much room- which format should I use?

    I bought a 32GB iphone so that I would be able to put a decent amount of music on it, but it seems to be eating the memory space. Itunes says I have 2GB of audio, but I only have 214 tracks (average 3-4 minute songs). Compared to my Creative Zen play