Button into the title of a JFrame

How can I put Buttons or Icons (which can handle the mouse click) into the title bar of a JFrame? Is it possible anyway?
Fast reply will be pleased.
Bye Zafir

I used a JWindow and created my title bar, add a mouseListener as sort of a secert code to get out of the app.
private JLabel setBanner(){
    banner = new JLabel();
    banner.setBackground( Color.blue );
    banner.setBounds(0,0,screenW, 15 );
    banner.addMouseListener (new java.awt.event.MouseAdapter () {
        public void mouseReleased (java.awt.event.MouseEvent evt) {
          // do your work or whatever in here
     return banner;
   // add the banner
   mainPanel.add(setBanner());Of course you lose the icon and min max close

Similar Messages

  • Any way to get at the title bar in JFrame?

    I'd like to either add a button to the title bar (title pane?) or override the behavior of the resize button. As far as I can tell, the LookNFeel classes don't allow you to add anything, just change colors, icons, etc. The WindowListener classes don't let you get at the resize button. I don't want to override Component.setSize() (that causes other problems), I just want to have the resize button do something different (or add another button).
    I'd appreciate any ideas!

    1) You could create your own frame that extends JWindow. This would be quite involved, since you'd need to make it respond to mouse drags, mouse resizing etc explicitly (if you wanted that functionality), but you would be able to add your own custom border, which you could make to look like a system border, or you could make comletely different.
    2) I don't know this could be persuaded to do what you want, but you could try adding a ComponentListener to the JFrame to check for resizes, and take action accordingly

  • How do I insert a clip into my Primary Storyline?  Every time I try to insert a clip the way instructions say, it goes into the title storyline (at top) instead.

    I have been unable to find out how to select the storyline where I want a clip inserted.  Every time I try to insert a clip at the beginning of my project, it goes into the Title Storyline, not my primary one.

    What does the instruction say? Are you pressing the Insert button? Are you using the W key? Are you tryin to drag into the storyline?
    If you have a secondary storyline, make sure it's not selected when you do the edit.

  • FROM - TO Dates passed from prompt into the Title of the WEBi report

    What is the right approach to pass two reporting period dates (FROM /TO) from user's input into the Title(Header) of the Universe based WEBi report, like "Tickets submitted from:MM-DD-YY to:MM-DD-YY"
    Maybe this is trivial but it is easier to do in CR and I am not sure how to do it using Universe objects.
    These are my first steps in building real production Universe.
    Thanks in advance!
    Alex

    i dunn know if i understand you well, but it seems like you want to pass 2 dates (from, to) to some report and to have those 2 dates in the report title.
    its too easy, first at the universe level you have to have a Date objects, which comes in the time dimension.
    when you create a report usin Webi, just drag this Objects to the query filter and make the operator "between" and make both of them "prompt"
    give two texts to the prompts lets say "From Date" and "To Date",,,, and run the report.
    at the report design mode there is a function called "UserResponse"
    in the report title text add this =userresponse("From Date")
    you can modify the text as you require.
    good luck
    Amr

  • Unicode in the Title bar of JFrame

    Hi
    I have a unicode application and I am using the font Arial Unicode MS. I want to show unicode charecters in the title of my JFrame. I am able to show unicode chars in all other controls except for the title of the main JFrame.
    I read several posts on the forum and came to an understanding that, the title bar of the JFrame is controlled by the OS.
    So I changed the fonts used in my windows also to Arial Unicode MS. But still I see only ??? in place of unicode characters.
    Need urgent help.
    Thanks
    Vineet

    import java.awt.*;
    import javax.swing.*;
    public class X {
        public static void main(String[] args) {
            JFrame.setDefaultLookAndFeelDecorated(true);
            JFrame f = new JFrame("ABCabcXYZxyz");
            Font font = new Font("Lucida Bright", Font.BOLD|Font.ITALIC, 14);
            Container cp = f.getContentPane();
            JLayeredPane lp = f.getLayeredPane();
            for(int i=0, ub=lp.getComponentCount(); i<ub; ++i) {
                Component child = lp.getComponent(i);
                if (child != cp)
                    child.setFont(font);
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.setSize(500,400);
            f.setLocationRelativeTo(null);
            f.setVisible(true);
    }1. You have to use a LAF that draws its own title bar. If your platform is drawing your title bar, you'll
    have to go the JNI route :-(
    2. If you have a menu bar, it'll be in the layered pane as well, so you'll have to skip over the way
    content pane is skipped over...

  • User-defined F4 Search - cancel button in the title bar

    Hi,
    I implement user-defined F4 search for my WD application. F4 view comes from another component (as described in the tutorial). Everything is fine, I see that view popuped when F4 is clicked for an input field. My problem is, how to make visible the Close button in the title bar of that popup window.
    I was able to set window's title text, but have no idea how to control those buttons. I only see maximize button which comes by default.
    Also would be nice to create kind of standard OK and Cancel buttons on the bottom bar instead of creating them manually on my view... I've tried set_button_kind(), it works somehow: displayes three empty buttons without icons - need more info about it too...
    Thanks

    Hi Serguei,
    The empty buttons are worth a ticket.
    The behavior for the close button in popups is that the application developer can determine its visibility independent from the buttons in the lower row.
    The second aspect is the action that is triggered if someone clicks that button. There the application developer is able to bind a separate action to that close button. If no action was bound and if a cancel button is visible, clicking the close button will trigger the same action as it would have been the case for the cancel button. A bit complicated, I know. We had to do the latter for backwards compatibility.
    Best regards,
    Thomas

  • How to import a jpeg or psd file into the title

    i want to import a pic into the title at the end of my project. is this possible? im having the hardest time doing it. any help would be appreciated
    thanks!

    You will also find links to many free tutorials in the
    Premiere Pro Wiki that will quickly show you how things are done in PPro.
    Cheers
    Eddie
    Forum FAQ
    Premiere Pro Wiki
    - Over 250 frequently answered questions
    - Over 100 free tutorials
    - Maintained by editors like
    you

  • Adding a button to the title bar

    I need to place a button in the upper-right corner of an NSWindow's title bar. In Interface Builder, I can place a button in the correct spot, but it is always beneath the title bar. To work around this, I'm currently using a subclassed NSWindow with a borderless mask and creating the title bar, including the stoplight buttons, from scratch.
    Is there a better way to do this or a way to re-order my button on top of a title bar? It seems like there should be a simpler way to achieve this effect.

    > Is there anyway to change what the window is called when
    it's
    > minimized?
    The name you type into the file properties is the name you
    will see when the
    file is minimized.
    Steve
    ACE - Adobe Community Expert, Authorware
    My blog -
    http://stevehoward.blogspot.com/
    Authorware tips -
    http://www.tomorrows-key.com

  • Can you please fix the bug where firefox continually collapses addon buttons into the "more tools" dropdown? Your continued ignoring of the bug is incompetent.

    No further details needed. 140 people saw an archived report of this a year ago.
    Fix the problem already.

    A year ago Firefox had a different user interface, so a comparison isn't accurate.
    Usually caused by an extension or two - not directly by Firefox itself. Try moving the add-on buttons into a different order or disable them one at a time to find the culprit.

  • Displaying the username in the title bar of jframe

    hi
    how to display the username entered by the user in the title bar of jframe

    I'm not sure what you mean by 'entered' but does the following help?
    import javax.swing.*;
    public class DisplayUserNameInTitleOfJFrame extends JFrame
        public DisplayUserNameInTitleOfJFrame()
            setTitle(System.getProperty("user.name"));
            setSize(640, 480);
        public static void main(String[] args)
            new DisplayUserNameInTitleOfJFrame().setVisible(true);
    }

  • Displaying Jtimer in the title bar of jframe

    we have an urgent requirement to display Time (should run continously) and Date in the title bar of the java
    application. Please give input..

    To update a frame's title, call setTitle:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class TitleUpdater {
        public static void main(String[] args) {
            final JFrame f = new JFrame("TitleUpdater");
            JButton btn = new JButton("press here");
            btn.addActionListener(new ActionListener(){
                int count = 0;
                public void actionPerformed(ActionEvent evt) {
                    ++count;
                    f.setTitle("pressed: " + count + " times.");
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(btn, BorderLayout.NORTH);
            f.setSize(400,100);
            f.setLocationRelativeTo(null);
            f.setVisible(true);
    }

  • Inserting a column into the title of a graph

    Hi,
    I have a pie chart with a title. I also have a drop down column in the graph prompt area showing the months.
    I need the month value to show within the title, and for it to change when the user chooses another month
    from the drop down list.
    Any help would be really appreciated.
    Thanks,
    - Jenny

    Let's see if I can figure this out and type it up before the real GREP masters show up...
    \d{9} will find groups of nine digits, but what you actually need to do is find groups of five digits followed by groups of four digits.
    \d{5}\d{4}
    And you need to separate them into groups:
    (\d{5})(\d{4})
    so that in the Change field you can use "first found group" and "second found group":
    $1-$2

  • How to draw on the title bar of JFrame ?

    Is there any way in which I can draw on the title bar of the JFrame. I want to display animation on the JFrame title bar. Is it possible in Swing! For example I want to display a set of concentric circles increasing and decreasing in radii.

    What child window are you referring to? Do you mean a browser window opened with web.show_document?
    If so, you can use javascript to hide browser toolbars and so on. Search the forum for some javascript examples where windows are opened with toolbar=no.

  • Can you move a 'Multiple Image Upload' button  into the 'Update Form'?

    I am able to creat and an Update form and an image upload using the "Update Form Wizard" tool and the "Multiple Image Upload" tool succesfully.
    <br />
    <br />The problem comes when I try to move the "UPLOAD" button inside the Update form. Right now it looks like this:
    <br />http://www.webritesolutions.com/Test/upload/now.JPG
    <br />
    <br />This is how I would like it to show:
    <br />http://www.webritesolutions.com/Test/upload/tryingto.JPG
    <br />
    <br />I want to "Upload" button to go next to the "Update record" button. When I do this I get a javascript error and the "Update record" button is disabled.
    <br />Here is the code of what I tried to do:
    <br />
    <br />
    <br />
    <br />
    <br />
    <table>
    <tr class="KT_buttons">
    <td>
    <?php<br />        // Multiple Upload Helper<br /> echo $muploadHelper->Execute();<br /> ?>
    </td>
    <td colspan="1">
    <input type="submit" name="KT_Update1" id="KT_Update1" value="Update record" />
    <br /></td>
    </tr>
    </table>
    <br />
    <br />Here is the Javascript error:
    <br />http://www.webritesolutions.com/Test/upload/error.JPG
    <br />
    <br />thanks for your help.

    A control can only appear once in the visual tree. So you have to remove it from the Grid before you can add it to the DockPanel.
    This code will move the Border element from the Grid to the DockPanel when you click the button:
    Private Sub Button_Click(sender As Object, e As RoutedEventArgs)
    Dim border = CType(LayoutRoot.FindName("myborder"), Border)
    LayoutRoot.Children.Remove(border)
    contain.Children.Add(border)
    End Sub
    <StackPanel>
    <Grid x:Name="LayoutRoot">
    <Border x:Name="myborder" BorderBrush="Black" BorderThickness="2">
    <TextBlock>...</TextBlock>
    </Border>
    </Grid>
    <DockPanel x:Name="contain" Background="Yellow">
    <TextBlock>2</TextBlock>
    </DockPanel>
    <Button Click="Button_Click" Content="Move"/>
    </StackPanel>
    You can try it for yourself. But please post your code as formatted text and not as embedded images if you want anyone to be able to reproduce your issue and help you in the future.
    Please remember to close your threads by marking helpful posts as answer.

  • Is it possible to add a button into the spliter area of a JSplitPane?

    I want to have a button in the spliter area of the JSplitPane. the purpose is to add an item from the upper component to the lower component. is it possible to do it in this way?

    the above link requires to register using $$$ before u can view the code, so poor me didn't go. but anyway, i worked out how to do this in the easiest way:
    JSplitPane mySplitPane = new JSplitPane();
    BasicSplitPaneDivider divider = ((BasicSplitPaneUI)mySplitPane.getUI()).getDivider();
    divider.setLayout(new FlowLayout());
    divider.add(new JButton("haha"));then u can try to show() this split pane in any frame or panel. just get the divider obeject then modify it in any manner u like.

Maybe you are looking for

  • Error in printing a standard smartform (LE_SHP_DELNOTE)

    Hi, I'm supposed to copy a standard form for delivery note (LE_SHP_DELNOTE), the problem is, I'm trying to print preview the standard form but it's resulting in an error :  <b> Exception       FORMATTING_ERROR Message ID:          SSFCOMPOSER Message

  • Fields in active DSO table.

    hi... Why it shows the field name as /BIC/ZIOBJ(for custom InfoObject)? Due to that...error is occurring in reporting. How can i fix this? Pls guide me. Thanks.

  • Installing apps to macbook pro help

    I'm new to the macbook world, and wanted to know if I can install my purchased iphone or ipad apps to my macbook pro, and more importantly how to do it. I've read some info but still having a little trouble. Have moved app to the applications folder,

  • Simple question: using mainstage as sound module AND run multi tracks live

    i want to play live, using my mac book pro, mainstage as a sound module while running several (audio) outputs/tracks at the same time. is this possible and how is it done? i don't want to change to ableton live! thx a bunch everyone!

  • I Need to print last value

    Hi in the below statement I Need to print last value means last 5555,i can print all other values but last value 5555 is i am unable to print pls help me SELECT REGEXP_SUBSTR('5454 4587454 547451 188745 5555','[^'||' '||']+'||' ',1,5)  p1 from dual;T