How to put a Jpanel always over a JtextArea ?

I want to have a little Jpanel above a JTextArea.
At the initialize section, I add first the Jpanel and after the JtextArea (both in a 'parent' Jpanel with null layout)
When I run the program I see the Jpanel over the JtextArea, but when I write on it and it reaches the area when the Jpanel is placed, the JtexArea brings to front and the Jpanel is no longer visible.
So, how can I have my Jpanel on top always ?
And another question , is there a hierarchy that control that I Jpanel is always over a Jbutton (even if the initial z-order of the button is higher than the Jpanel's)
Thanks
( I do not send any code because it is so simple as putting this two components into a Jpanel)

tonnot wrote:
And another question , is there a hierarchy that control that I Jpanel is always over a Jbutton (even if the initial z-order of the button is higher than the Jpanel's)JLayeredPane
( I do not send any code because it is so simple as putting this two components into a Jpanel)Try it with a JLayeredPane and if you still have problems, post a [SSCCE (Short, Self Contained, Compilable and Executable, Example Program)|http://mindprod.com/jgloss/sscce.html].
db

Similar Messages

  • AS3 how to put the buttons always on top of the external swf in the code below?

    how to put the buttons always on top of the external swf in the code below?  I am  beginner use to as3, can someone help me?
    thanks, for all!!
    var Xpos:Number = 110;
    var Ypos:Number = 180;
    var swf:MovieClip;
    var loader:Loader = new Loader();
    var defaultSWF:URLRequest = new URLRequest("swfs/eyesClosed.swf");
    loader.load(defaultSWF);
    loader.x = Xpos;
    loader.y = Ypos;
    addChild(loader);
    // Btns Universal function
    function btnClick(event:MouseEvent):void {
    removeChild(loader);
    var newSWFRequest:URLRequest = new URLRequest("swfs/" + event.target.name + ".swf");
    loader.load(newSWFRequest);
    loader.x = Xpos;
    loader.y = Ypos;
    addChild(loader);
    // Btn listeners
    eyesClosed.addEventListener(MouseEvent.CLICK, btnClick);
    stingray.addEventListener(MouseEvent.CLICK, btnClick);
    demon.addEventListener(MouseEvent.CLICK, btnClick);
    strongman.addEventListener(MouseEvent.CLICK, btnClick);

    use:
    var Xpos:Number = 110;
    var Ypos:Number = 180;
    var swf:MovieClip;
    var loader:Loader = new Loader();
    var defaultSWF:URLRequest = new URLRequest("swfs/eyesClosed.swf");
    loader.load(defaultSWF);
    loader.x = Xpos;
    loader.y = Ypos;
    addChild(loader);
    // Btns Universal function
    function btnClick(event:MouseEvent):void {
    removeChild(loader);
    var newSWFRequest:URLRequest = new URLRequest("swfs/" + event.target.name + ".swf");
    loader.load(newSWFRequest);
    loader.x = Xpos;
    loader.y = Ypos;
    addChildAt(loader,0);
    // Btn listeners
    eyesClosed.addEventListener(MouseEvent.CLICK, btnClick);
    stingray.addEventListener(MouseEvent.CLICK, btnClick);
    demon.addEventListener(MouseEvent.CLICK, btnClick);
    strongman.addEventListener(MouseEvent.CLICK, btnClick);

  • How to put drop down menu over iframe?

    I created drop down menu in A-Master with height 100 pixels.
    On a page which uses A-Master template I've put youtube video, example:
    <iframe width="1000" height="500" src="//www.youtube.com/embed/8eDuupJ9Uus" frameborder="0" allowfullscreen></iframe>
    and when I export HTML, Iframe video is over dropdown menu so I can't see this menu, iframe is on top of it, how can I place dropdown menu on top of this iframe?
    Tried to search whole internet with no good results, I have only found other people has same problem.
    ...and I have tried this "wmode="transparent" too:
    <iframe width="560" height="349"src="http://www.youtube.com/embed/rLVCjnEGrqQ?wmode=transparent"frameborder="0" allowfullscreen wmode="transparent"></iframe>
    was no good

    Your menu layer should be on top of everything!
    Regards,
    Frank

  • How to put a JPanel in a JTable

    I have been having problems with using a JPanel in each cell in a column of a JTable. I have a class "myPanel" which extends JPanel and has an overridden paint() function. In each row I want the "myPanel" to be displayed in the cell.
    I've read all the documentation(that I could find online), and have searched for a while, but have not found the right way to do this.
    I currently have defined myPanel like this:
    class myPanel extends JPanel implements TableCellRenderer{
    public Component getTableCellRendererComponent( ... ) {
    repaint();
    public void paint(Graphics g) { ... }
    So, In my paint function I am not sure which cell(in the table) needs to be painted, but in the getTableCellRendererComponent, I know the cell to be rendered but I can't actually paint anything(I dont have a Graphics object to paint on).
    SO either I get my graphics painted into every cell in the column identically, or I don't see anything in the cells. How do I paint differently in different cells.
    Should I be using the object passed into getTableCellRendererComponent directly?
    And I don't think there is a default renderer for a panel which would display the panel.
    Any hints would be wonderful, as I can't get this to work.

    You should use your myPanel with the params row and column as if the panel in that row and that column is the one to paint and return it from the method getCellRendererComponent, like in this code.
    public Component getTableCellRendererComponent(...){
    //....set the properties of your panel/CellRenderer as needed
    //for displaiing the cell located in the row and column you get as //parameters,
    //even adding or removing buttons or other stuffs from your panel
    return this;
    // you return the CEllRenderer itself !!! The table will do the painting work !!
    That's it !!!
    Do not use paint or repaint, you don't need it !!!
    Bye Massimo

  • How do  put a straight line over an "o" such as in Roti Grille?

    How do I get a straight line over a letter "o" such as in Roti Grille?
    Thanks

    PeterBreis0807 wrote:
    Unless there is something else out there that I am unaware of, Roti grill is an Indian cooking method.
    Why the accent is needed I don't know, I was unaware it used one.
    One more time you read wrongly
    The OP wrote "*Roti Grille*" not "*Roti Grill*"
    In French rôti requires the accent and grillé requires its accent too !
    Yvan KOENIG (VALLAURIS, France) jeudi 28 janvier 2010 22:31:33

  • How can i put de number 2 over km 2?  Comment mettre le 2 surélevé pour km carré?

    How can i put de number 2 over km 2?  Comment mettre le 2 surélevé pour km carré?

    Hi Bellu77,
    Using the Character Viewer you can add a ² to make km² in Mountain Lion:
    OS X Mountain Lion: Enter special characters and symbols
    http://support.apple.com/kb/PH10758
    By default, the Digits list is not listed in Character Viewer, but that article includes instructions on showing other lists including Digits:
    Customize the Character Viewer
    If you don’t see the character or symbol that you want to use, try customizing the Character Viewer.
    Choose Customize List from the Action pop-up menu (looks like a gear) in the top-left corner of the Character Viewer.
    Select the categories that you want to appear in the Character Viewer, and then click Done.
    Cheers!
    - Ari

  • How to tint a JPanel that paints an Image

    Hello all,
    I have a basic understanding of Java Swing architecture and the Drawing capabilities of the Graphics and Graphics2D classes. However, i am utterly confused how to implement a basic tint over an image.
    Overview:
    I have a GCard (Graphical Card) class that extends JPanel. This class contains a BufferedImage so that when the GCard is added to a higher-level Container, it paints the BufferedImage. What I want to do is tint that card image to a user specified color (let's say RED) via the GCard.setTint(Color.RED) method and then allow them to control if the tint is on/off via the GCard.setTinted(true) method.
    What I have:
    Currently, I have the following in my GCard.paintComponent(Graphics g) method:
         @Override
         protected void paintComponent(Graphics g) {
              int xPosition = 0;
              int yPosition = 0;
              if(image != null) {
                   g.drawImage(image, xPosition, yPosition, null);
                   if(isTinted() && tint != null) {
                        g.setColor(tint);
                        for(int x = xPosition; x < (xPosition + image.getWidth()); x += 2)
                             for(int y = yPosition; y < (yPosition + image.getHeight()); y += 2)
                                  g.drawLine(x, y, x, y);
         }All this does is implement a rudimentary tinting scheme by setting every other pixel in the panel to the tint color.
    What I want:
    What I'd like to see instead is a red haze over the entirety of the image. Much like the multiple item selection process that occurs when you select multiple things in a modern-day OS.
    How can i do this?
    From what I've read/thought out, I can either edit the actual image data to increase the level of the appropriate tint color, but I would prefer to be non-destructive to the image I'm holding in memory. I would prefer to imitate the 'layer' functionality of Adobe Photoshop where my image is the 'background' and I have a transparent panel that is tinted which can be switched on and off. Can I accomplish all of this in the paintComponent() method or will i need to add a JPanel (let's call it a tintPanel)to the GCard object and then add/remove that component from the GCard as necessary?
    Thanks for the help!
    -Pheez

    Something likeprotected void paintComponent(Graphics g) {
       super.paintComponent(g);
       g.drawImage(....);
       g.setColor(new Color(r, g, b, a)); // where a <1.0
       g.fillRect(aRectThatOverlapsTheImage);
    }db

  • How to place a JPanel at the center of another JPanel?

    Can anyone tell me how to place a JPanel inside another JPanel? The first JPanel consists of three JPanels each consisting of a label&textfield and are placed using BoxLayout. The second JPanel is a big blank screen. So, i would like to put the first JPanel at the center of second JPanel(horizontally & vertically). The problem is that i don't have any other component. So,if i try to use FlowLayout, i am able to put it at the center(horizontally, not vertically) only on the top edge. I tried to use BoxLayout. But, i couldn't(as i don't have any other elements). I tried to create some blank elements. But, they are messing up the elements of my JPanel. Any cluesssssssss??????????

    import java.awt.*;
    import javax.swing.*;
    public class CenteredLayout
        private JPanel getPanel()
            GridBagLayout gridbag = new GridBagLayout();
            GridBagConstraints gbc = new GridBagConstraints();
            gbc.insets = new Insets(2,2,2,2);
            JPanel p = new JPanel(gridbag);
            addComponents(new JLabel("label 1"), new JTextField(8), p, gbc);
            addComponents(new JLabel("label 2"), new JTextField(8), p, gbc);
            addComponents(new JLabel("label 3"), new JTextField(8), p, gbc);
            JPanel panel = new JPanel(gridbag);
            panel.setBackground(Color.pink);
            gbc.anchor = GridBagConstraints.CENTER;
            gbc.insets = new Insets(0,0,0,0);
            panel.add(p, gbc);
            return panel;
        private void addComponents(Component c1, Component c2, Container c,
                                   GridBagConstraints gbc)
            gbc.anchor = GridBagConstraints.EAST;
            gbc.gridwidth = GridBagConstraints.RELATIVE;
            c.add(c1, gbc);
            gbc.anchor = GridBagConstraints.WEST;
            gbc.gridwidth = GridBagConstraints.REMAINDER;
            c.add(c2, gbc);
        public static void main(String[] args)
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(new CenteredLayout().getPanel());
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
    }

  • How do I get my "stuff" over to a Samsung device?

    Hi , I am working on Mac os x, Indesign cs6.
    My problem is when I am exporting my file as jpg ore a PDF using rgb coz its going on Ipad. The file is turning out real smoggy and dirty looking when i send them via mail and open it on I pod. When I use a cable and do it manually trough I tunes it works out fine. With that said it only works on my apple Ipad devices and NOT on Samsung.
    So to make my question short´n simple:
    how do I get my "stuff" over to a Samsung device with the right colours

    Are you only intending to put things on your personal tablet, or is the question about how to publish to digital tablets (Samsung with Android OS) in general?
    If you export to jpg or PDF, take care to set the compression to high or maximum so that the image doesn't suffer from lossy compression to a heavy degree.
    You mention iPad, then iPod, then iPad again, then Samsung Android. What really are you doing? More detail as to your intentions is needed. Most images on any digital device use the sRGB color space to define and control the color of an image.

  • How to put windows 7 on mac using bootcamp?

    i have a 2010 macbook air and an imac, i dont mind which windows 7 is on. i have a 4 gb usb, 4.7 gb disks and a downloaded (its not from microsoft) copy of windows 7.iso. macbook air has about 25gb of space left and imac over 3000gb. i need to know how to put windows 7 on bott camp with either machine.

    Use the BootCamp Aaistant, located in your Applications> Utilities folder. It will walk you thru the installation steps. howeve, once you get to the Windows installation step the Windows installer will check with MS if you have a legitimate copy.

  • I would like to know how do I install the brazilian keyboard into macbook air, keyboard with accents (Portuguese Language), I tried so many times how to put into it (Macbook Air). So, thanks for now! I'm waiting for it.

    I would like to know how do I install the brazilian keyboard into macbook air, keyboard with accents (Portuguese Language), I tried so many times how to put into it (Macbook Air). So, thanks for now! I'm waiting for it.

    After you go to system preferences/keyboard/input sources as suggested by sberman, click on the + button and scroll down to Portuguese and select that.  Over at the right you will see the choices Brazilian, Brazilian abnt, Portuguese.  You might want to add all three to see which you like best.
    The "Brazilian" layout is pretty useless.  It is identical to the US layout and the only way to make accents is via the option key shortcuts:  option + n, then o gives you õ.
    The Brazilian abnt and Portuguese layouts have dead keys for adding accents over at the right edge of the keyboard.  But these may not match what is printed on your keys.
    You may prefer to stay with the US layout.  On that you can get accented letters by just holding down the base letter and selecting what you want from the popup menu that appears.  Or you can use the option key shortcuts.
    Another option is the layout called US International PC, which has accent deadkeys on ~, ', etc.
    Which ever layout you want to use, you must select it in the "flag" menu at the top right of the screen.
    To see which key does what for any layout, use the Keyboard Viewer:
    http://support.apple.com/kb/PH13746

  • How to put the short movie clip(avi file) saved in CD  to Ipod machine

    I have some Japnese animation clips(10 of them).I like to transfer those clips saved with avi file in CD disk to my I pod...But it doesn't even bring files automaticlly to I tunes when I put CD in my lap tops...Is there somenone who can pls let me know how to put burnt movie clip to I pod?
    Thank you in advance

    GUIDES TO: Converting Video for iPod - Mac & Window
    http://forums.ilounge.com/showthread.php?s=&threadid=123067
    The Complete Guide to Converting Video to iPod Format (Mac)
    http://www.ilounge.com/index.php/articles/comments/the-complete-guide-to-convert ing-video-to-ipod-format-mac/
    See other tutorial articles over at iLounge...
    http://www.ilounge.com/index.php/articles/tutorials/
    Patrick

  • APEX:How to put dynamic buttons in a Report.

    Hello all,
    I am creating one application in which i want two buttons in every record. I can't put it manually because it should change according to records in a table So Can anyone tell me how to put dynamic buttons in a report.
    Thanks & Regards,
    Jiten Pansara

    Hi Jiten,
    you cannot create buttons in the report, but you can always create link columns with some css class to show it as button.
    So in the both link column report attributes you will have class="button1" and class="button2"
    And in dynamic actions you need to bind the events based on your link column's jquery selector like:
    .button1
    .button2Thanks

  • HOW TO PUT TWO PANNEL IN THE SAME PAGE

    HI ALL
    I NEED TO KNOW HOW TO PUT TWO PANNEL IN THE SAME PAGE TO FULLY UTILIZE FULL PAGE AREA BECAUSE THE PANNEL WIDTH IS TOO SMALL , SO I WANT TO MAKE THE PAPER CONTAIN TO PANNELS VERTICALLY.
    THANK YOU

    So Barb,
    I like to use multiple desktops and move back and forth between then using gestures. At the moment I have 5 open: Chrome, Firefox, Safari, Photoshop CS 6 and a desktop. I use "gestures" to navigate between them:
    Mac Basics: Multi-Touch gestures - Apple Support
    and I use Mission Control (F3) to move the various desktops around in the order I want them.
    Mac Basics: Mission Control - Apple Support
    So say I'm searching for a photo to open in CS 6, I find it on the open desktop then hit select "open" in CS 6 and go to that folder in the select pane.
    Even right now I'm typing this in Safari and "gesturing" back to Chrome where I did the search about multi touch and mission control. I drag copy the URL there  and gestured back here to paste the URL into this text.
    If you did a lot of photo searches, I set professional clients of mine in Chicago up with dual monitors (In this case you'd have an external monitor on extended desktop.). So all you need to do is just glance over at the second monitor slide your cursor over there open stuff up find your photo and go back to Photoshop and open it up.
    Hope this helps.

  • Putting a jpanel into a jframe

    I have a main JFrame which was created by:
    public class ControllerGUI extends javax.swing.JFrameand inside this somewhere is a JPanel called myPanel.
    I have a seperate class which is a JPanel created by:
    public class Calc extends javax.swing.JPanelI am quite new to swing and have been using the GUI builder in Netbeans, so could someone please tell me how to put the seperate Calc JPanel into the JPanel myPanel which is in the JFrame. Is it something to do with creating a container for it? Thanks.
    Thanks.

    Not sure if you're still around, but here's a very simple example of putting a JPanel derived object into another JPanel. The Calc class here extends JPanel. It does nothing but shows a 3 by 3 grid of JLabels:
    import java.awt.Color;
    import java.awt.GridLayout;
    import javax.swing.BorderFactory;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.SwingConstants;
    class Calc extends JPanel
        public Calc()
            setBorder(BorderFactory.createEmptyBorder(15, 0, 15, 0));
            // what the heck, have it show a 3x3 label grid
            setLayout(new GridLayout(0, 3, 10, 10)); // sets layout for the grid
            for (int i = 0; i < 3; i++)
                for (int j = 0; j < 3; j++)
                    String labelString = "[" + (i + 1) + ", " + (j + 1) + "]";
                    JLabel label = new JLabel(labelString);
                    label.setBorder(BorderFactory.createLineBorder(Color.blue));
                    label.setHorizontalAlignment(SwingConstants.CENTER);
                    add(label); // adds each label to the grid
    }Now I'll add it to myPanel which is a JPanel object, but before adding it, I'll set the myPanel's layout to be BorderLayout, and I'll add the Calc class to the CENTER position:
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.awt.FlowLayout;
    import java.awt.GridLayout;
    import javax.swing.BorderFactory;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    public class FooFrame extends JFrame
        // declare and initialize the myPanel JPanel object and
        // the myCalc Calc object:
        private JPanel myPanel = new JPanel();
        private Calc myCalc = new Calc();
        public FooFrame(String s)
            super(s);
            getContentPane().add(myPanel); // add myPanel to the contentPane making it the main panel
            setPreferredSize(new Dimension(500, 400));
            myPanel.setLayout(new BorderLayout());  // here set the layout of mypanel
            myPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
            // create a title panel and add it to the top of myPanel
            JLabel title = new JLabel("Application Title");
            JPanel titlePanel = new JPanel(new FlowLayout()); // redundant since jpanels
                                                            //use flowlayout by default
            titlePanel.add(title);
            myPanel.add(titlePanel, BorderLayout.PAGE_START); // adds title to top of myPanel
            // create a button panel and add it to the bottom of myPanel
            // here we'll use gridlayout
            JPanel buttonPanel = new JPanel(new GridLayout(1, 2, 15, 0));
            JButton okButton = new JButton("OK"); // create buttons
            JButton cancelButton = new JButton("Cancel");
            buttonPanel.add(okButton); // add buttons to button panel
            buttonPanel.add(cancelButton);
            myPanel.add(buttonPanel, BorderLayout.PAGE_END); // adds buttonpanel to bottom of myPanel
            //** add the myCalc object to the center of the myPanel via borderlayout
            myPanel.add(myCalc, BorderLayout.CENTER);
        // initialize and show the JFrame
        private static void createAndShowUI()
            JFrame frame = new FooFrame("FooFrame");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.pack();
            frame.setLocationRelativeTo(null);
            frame.setVisible(true);
        // but be careful to show the JFrame in a thread-safe manner:
        public static void main(String[] args)
            java.awt.EventQueue.invokeLater(new Runnable()
                public void run()
                    createAndShowUI();
    }

Maybe you are looking for

  • PDF file problem

    Apologies if I am posting this in the wrong part of the forum.  I am having trouble with pdf files I save from websites. When I try to open them, I get the message: unable to open FILENAME because it is either not a supported file type or because the

  • Downloading file from a database..

    Iam writing an application which downloads a file from the database.The file lists will be displayed for the user. When he clicks a particular file, he gets a window with open, save cancel options (i am using response.setHeader("Content-disposition",

  • Amending/changing PDF's with Elements

    Hi Everyone I want to know if you can pull a PDF document apart using Elements. I work in Marketing and would find it very useful if I could amend the designers PDF's to show them visually my comments/changes rather than just briefing them.  Can you

  • Downgrade ( lion to leopard ) without losing programs/data

    Sup everyone! I searched a lot and I can't find it anywhere. I need an answer to the next question: How do I downgrade from Lion to Leopard without losing my (paid) programs? See, I have Lion right now and I don't like it at all. I have the installat

  • Trying to DL PS CC  But say my Operating Systen no longer supported! Running Windows 7  HELP

    Anybody having issued with Download PS CC.  It says my operating system no longer Supported.  Here is what I'm running; Win 7 Service Pack 2 Processor: Intel i7 930 @ 2.80 GHz Ran 13 GB 64 Bit system