JDialog with out close button

hi, I wanna get a JDialog without the close button in the top right corner of it how can i get that...plz help

Did you search? No! Do so, it has been asked very often in the swing forum.

Similar Messages

  • JFrame with out icon buttons

    Hi all,
    Is there a way to make a JFram with out the buttons at the upper left and upper right (unix), the ones that min/max the frams on the right and the
    pull down on the left ?
    Also, I know you can make the JFrame not resizable but can you lock it in place in the screen so users can not move it around ?
    Thanks
    Pat
    IMS Field Applications

    Frame.setUndecorated(true); // JFrame inherits this methodI don't know if it works with Unix, but on windows this command removes the border from the Frame or JFrame. The buttons vanish together with the border, and since there is no border to drag, the JFrame is neither movable nor resizable. Another command that makes (decorated) Frames unresizable is
    Frame.setResizable(false);

  • JTabbedPane with one close button for all tabs

    Hello,
    there have several solutions been posted for JTabbedPane subclasses that provide tabs with icons working as close buttons on each tab. I think this is not user friendly because the user can hit the close button accidentally when selecting a tab. And a "really close?" dialog is clumsy.
    Therefore I prefer the Netscape browser style: There's only one close button rightmost of the tabs that closes the selected tab. But I don't have an idea how to achieve this.
    Does anyone have a solution or an idea? Thanks in advance for help.

    This solution has been posted several times and is not what I wanted. But I rewrote the thing so that
    - the close buttons are on the right hand side of each tab so that it is conformant with Eclipse style, and
    - the close buttons work only with a left click (see code below).
    I just wonder how I can move the text a little bit to the left so that the appearence is a bit more balanced. Can someone help, please?
    import java.awt.Color;
    import java.awt.FontMetrics;
    import java.awt.Graphics;
    import java.awt.Rectangle;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseListener;
    import javax.swing.plaf.basic.BasicTabbedPaneUI;
    class TabbedPaneCloseButtonUI extends BasicTabbedPaneUI {
        public TabbedPaneCloseButtonUI() {
            super();
        protected void paintTab(
            Graphics g,
            int tabPlacement,
            Rectangle[] rects,
            int tabIndex,
            Rectangle iconRect,
            Rectangle textRect) {
            super.paintTab(g, tabPlacement, rects, tabIndex, iconRect, textRect);
            Rectangle rect = rects[tabIndex];
            g.setColor(Color.black);
            g.drawRect(rect.x + rect.width -19, rect.y + 4, 13, 12);
            g.drawLine(
                rect.x + rect.width -16,
                rect.y + 7,
                rect.x + rect.width -10,
                rect.y + 13);
            g.drawLine(
                rect.x + rect.width -10,
                rect.y + 7,
                rect.x + rect.width -16,
                rect.y + 13);
            g.drawLine(
                rect.x + rect.width -15,
                rect.y + 7,
                rect.x + rect.width -9,
                rect.y + 13);
            g.drawLine(
                rect.x + rect.width -9,
                rect.y + 7,
                rect.x + rect.width -15,
                rect.y + 13);
        protected int calculateTabWidth(
            int tabPlacement,
            int tabIndex,
            FontMetrics metrics) {
            return super.calculateTabWidth(tabPlacement, tabIndex, metrics) + 24;
        protected MouseListener createMouseListener() {
            return new MyMouseHandler();
        class MyMouseHandler extends MouseHandler {
            public MyMouseHandler() {
                super();
            public void mouseReleased(MouseEvent e) {
                int x = e.getX();
                int y = e.getY();
                int tabIndex = -1;
                int tabCount = tabPane.getTabCount();
                for (int i = 0; i < tabCount; i++) {
                    if (rects.contains(x, y)) {
    tabIndex = i;
    break;
         if (tabIndex >= 0 && ! e.isPopupTrigger()) {
    Rectangle tabRect = rects[tabIndex];
    y = y - tabRect.y;
    if ((x >= tabRect.x + tabRect.width - 18)
    && (x <= tabRect.x + tabRect.width - 8)
    && (y >= 5)
    && (y <= 15)) {
    tabPane.remove(tabIndex);
    import java.awt.BorderLayout;
    import javax.swing.ImageIcon;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JTabbedPane;
    public class TabbedPaneWithCloseButtons {
    JFrame frame;
    JTabbedPane tabPane;
    public TabbedPaneWithCloseButtons() throws Exception {
    frame=new JFrame();
    frame.getContentPane().setLayout(new BorderLayout());
    tabPane=new JTabbedPane();
    tabPane.addTab("test1xxxxxxxxxxxxxx", new JLabel("1"));
    tabPane.addTab("test2xxxxxxxxxxxxxxxxxxx", new ImageIcon("images/icon.gif"), new JLabel("2"));
    tabPane.addTab("test3xxxxxxxx", new JLabel("3"));
    tabPane.setUI(new TabbedPaneCloseButtonUI());
    frame.getContentPane().add(tabPane);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setSize(200,200);
    frame.setLocationRelativeTo(null);
    frame.setVisible(true);
    public static void main(String[] args) throws Exception {
    TabbedPaneWithCloseButtons test=new TabbedPaneWithCloseButtons();

  • Unloading a loaded external SWF with a close button on the external SWF to unload

    I have found some discussion on this topic but I am still having trouble getting it to work and was hoping to get some help here.
    Here I have a file: http://www.dril-quip.com/test/main.swf
    I have: main.swf (a menu) and I have module.swf (content)
    If you navigate to Subsea Wellhead Systems/SS-15 BigBore II and click on that I have it load an external swf which covers most of the parent.
    So far so good. My problem is unloading the loaded 'Child' swf with the button provided on the loaded 'Child' swf.
    below is the code I used to load the file but I cant, for the life of me, find a way to unload it.
    var bigboreLoader:Loader = new Loader();
    btnbb2.addEventListener(MouseEvent.MOUSE_UP, bigborecontent);
    function bigborecontent(event:MouseEvent):void{
    var bigboreRequest:URLRequest = new URLRequest("moduletemplate.swf");
    bigboreLoader.load(bigboreRequest);
    stage.addChild(bigboreLoader);
    I am certain it requires the Child to communicate with the parent somehow but I am at a loss. If I could get a bit of advice or a link to something deal with this, it would be a big help. I just need to have my links load my modules and the remove them when the close buttong is hit on the loaded swf. I promise I have done searches and I admit I have found asnwers but still they are not working. I found the code below:
    Main FLA:
    function removeF() {
    removeChild(bigboreLoader);
    var bigboreLoader:Loader = new Loader();
    btnbb2.addEventListener(MouseEvent.MOUSE_UP, bigborecontent);
    function bigborecontent(event:MouseEvent):void{
    var bigboreRequest:URLRequest = new URLRequest("moduletemplate.swf");
    bigboreLoader.load(bigboreRequest);
    stage.addChild(bigboreLoader);
    EXTERNAL FLA:
    btnClose2.addEventListener(MouseEvent.CLICK, bigborecontent);
    function bigborecontent(myevent:MouseEvent):void {
    MovieClip(parent.parent).removeF();
    I think I have a misunderstanding of the code. Thanks for any help you might be able to provide.

    This was the original code I got:
    Main FLA: (on AS layer inside DropDownButton Movie Object)
    function removeF() {
    removeChild(myLoader);
    var myLoader:Loader=new Loader ();
    page1_mc.addEventListener(MouseEvent.CLICK, page1content);
    function page1content(myevent:MouseEvent):void {
    var myURL:URLRequest=new URLRequest("page1.swf");
    myLoader.load(myURL);
    addChild(myLoader);
    EXTERNAL FLA: (on main time line of this file)
    close_mc.addEventListener(MouseEvent.CLICK, closeMC);
    function closeMC(myevent:MouseEvent):void {
    MovieClip(parent.parent).removeF();
    Main.FLA
    myLoader=bigboreLoader (my new loader)
    page1_mc=btnbb2 (the button who event will call external swf)
    page1content = bigborecontent (name given to SWF being loaded???)
    myURL=bigboreRequest (my new URLrequest for bigbore)
    page1.swf=moduletemplate.swf (actual address of what I am loading)
    External.FLA
    close_mc=button that will close external swf
    closeMC=movie clip to close?

  • PROBLEMS WITH A "CLOSE BUTTON"

    Hello,
    I'm not a pro with flash. But I have a full flash site to
    modify, Well I did it but now I have some needs:
    This is the site:
    my site
    If you can see the pages open with an animation. I need to do
    something to close the pages to see the main animation.
    .. and to do that I thought to put a "X" button above the
    pages .. But I don't know the script to make it!
    Please someone can help me!?!?!?

    I tried with this ..... but this is the error string:
    ERROR = Symbol=symbol 653, layer=layer 53, fotogramma=1: Line
    1: The instruction must be inside the ON GESTOR
    y.onRelease=function(){
    WHAT DOES IT MEANS?!??!

  • Can we put iphone 3gs into  DFU mode with out power button

    My Iphone 3gs power button not working, so is there any way I can put my iphone into DFU mode..

    No - you can't put the phone in recovery mode or DFU mode without a functioning sleep/wake (power) button.
    Note that DFU mode is only useful when hacking the phone.  Recovery mode is what you want for troubleshooting.
    http://www.ihackintosh.com/2009/06/recovery-mode-and-dfu-mode/

  • Widget close button stopped working?

    i am finding that in the latest version of muse i can no longer create a lightbox or blank composition in the way i used to, with a close button that would remove the superposed element and return you to the page behind. the option to put in a close button is there, but it does nothing when clicked, so that once you have opened a lightbox or composition you cannot close it again.
    has the way to do this changed? it used to work just fine.
    thanks.
    mat

    Hello,
    It seems to work fine for me for Lightbox. Could you please test it creating a new test website and then preview it in a web browser?
    Also, when you say Blank Composition, I assume you are using Lighbox option under widget settings for blank composition as the close button only works for Lightbox functionality.
    Please confirm if it works with new test site or not.
    Regards,
    Sachin

  • Accessing Close button in TitleWindow

    Hi all,
    I have a situation where I'm adding buttons to a TitleWindow
    chrome. They co-exist with the close button provided by the panel.
    I create classes for my button images and then I size the buttons
    to fit the image.
    I also set the styles for the panel-provided close button
    with classes. My goal was to have all the buttons look & feel
    the same.
    Excerpt from application mxmxl ...
    <mx:Style>
    TitleWindow {
    backgroundColor: #333333;
    closeButtonDisabledSkin: Embed("assets/close.png");
    closeButtonDownSkin: Embed("assets/closeDown.png");
    closeButtonOverSkin: Embed("assets/closeDown.png");
    closeButtonUpSkin: Embed("assets/closeUp.png");
    </mx:Style>
    <v:ResizeWindow id="testResizeWindow"
    height="50%"
    width="50%"
    title="Resize Window"
    useWindowButtons="true"
    status=""
    showCloseButton="true"
    restoreWindow="this.currentState=''"
    maximizeWindow="this.currentState='maximized'"
    minimizeWindow="this.currentState='minimized'"
    close="popUp('Close button clicked')">
    </v:ResizeWindow>
    Excerpt from my ResizeWindow class ...
    override protected function createChildren():void{
    super.createChildren();
    if(useWindowButtons){
    if(btnMinimize == null){
    btnMinimize = new Button();
    var btnMinimizeImageObj:BitmapAsset = new
    btnMinimizeUpSkin() as BitmapAsset;
    btnMinimize.width = btnMinimizeImageObj.width;
    btnMinimize.height = btnMinimizeImageObj.height;
    btnMinimize.setStyle("upSkin", btnMinimizeUpSkin);
    btnMinimize.setStyle("overSkin", btnMinimizeDownSkin);
    btnMinimize.setStyle("downSkin", btnMinimizeDownSkin);
    btnMinimize.addEventListener(MouseEvent.CLICK,
    minimizeHandler);
    btnMinimize.focusEnabled=false;
    btnMinimize.visible=true;
    rawChildren.addChild(btnMinimize);
    Questions:
    1) For the buttons I add (e.g. btnMinimize) ... if I don't
    explicitly set the width and height, they default to 0 and button
    is invisible. Button class says it should size in accordance with
    the image. Is this normal behavior?
    2) Along the lines of #1 above, if I just create btnMinimize
    and give it a text label (no image), the button sizes to a width
    and height of 0. I have to set the width and height for it to
    appear? Is this normal behavior?
    3) I can't include a screen clip here but the close button
    succesfully uses the images I provide but it is larger than the
    other buttons (and the image is distorted). Can I set the height
    and width of the close button to match the image I'm providing (or
    conversely can I get the height and width of the close button so I
    can size my buttons the same)?
    Spent a few days and I'm getting nowhere ...
    thx in advance for any help ...

    Hi Laxmi,
    User has no control on OVS window.You can't  add your custom button on OVS window.In OVS Listener implement the three life cycle methods  i)onQuery ii) applyResult and  iii) applyInputValues which are predefine.
    Regards,
    Mithu

  • Popup Close Button

    Hi,
    I'd like to show a popup with a close button in its title bar. I'm using this code to create the popup:
           IWDWindow popup = wdComponentAPI.getWindowManager().createModalWindow(
                     wdComponentAPI.getComponentInfo().findInWindows(
                     "InvoiceDetailsWindow"));
           popup.setTitle("Title");
           popup.setWindowPosition(WDWindowPos.CENTER);
    but only the maximize button in shown.
    Thank you,
    Pietro

    For release >= 7.11 see this [tutorial|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/70c5186d-2d08-2d10-a6b6-818e832d05d8].

  • JDialog with Only a Title but no close button

    Hi
    How can create a JDialog with a title but no close button.Only a title
    Thanks

    Maybe this is a start:
    http://forum.java.sun.com/thread.jspa?forumID=54&threadID=501146

  • Not able to get the minimize maximized and close button and its running with full screen mode.

    Hi
    My Thunderbird is running with ubuntu OS and while using some shortcut key my thunderbird mailbox switched to full screen mode. now i am not able to resize it's view and also not able to see minimize, maximize and close buttons on top left corner.
    Please help me out.
    Thanks

    I'm also running Ubuntu. Not sure how you got there, but you can try a Control-Q to quit. Then restart it and hope in comes back normal.

  • JFrames with only the close button

    I have been writing a notepad as my first java project and have done most things but cant seem to fix this: coding a JFrame with only the close button. Most of us know that when you click Help > About... a window pops up describing the company that wrote the software.
    Please help....

    I have been writing a notepad as my first java
    project and have done most things but cant seem to
    fix this: coding a JFrame with only the close button.
    Most of us know that when you click Help > About... a
    window pops up describing the company that wrote the
    software.
    Please help....so whats the problem? you're asking if a person clicks on help->about then a description dialog box should pop up describing the company right? you can use JDialog or a popupmenu. look at the swing tutorial at sun

  • JDialog with no buttons ?

    short question, can you create a JDialog to inform a user what is happening (to stop them tampering with other things) with no button (so basically i can close it when the task is complete ?

    Well it is possible to make a Modal JDialog with no buttons, but when u make it modal, it will halt the program. I had this problem and I just started a thread to do some processing while the dialog is displayed, here is a sample of what i mean
    public class ButtonlessDialog extends JFrame {
         JButton showDialogButton;
         JDialog buttonless;
         JLabel stuff;
         public ButtonlessDialog() {
              super("No button dialog");
              setSize(400, 400);
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              showDialogButton = new JButton("Show Dialog");
              showDialogButton.addActionListener(
                   new ActionListener() {
                        public void actionPerformed(ActionEvent e) {
                             showTheDialog();
              getContentPane().add(showDialogButton);
              setVisible(true);
              validate();
         public void showTheDialog() {
              buttonless = new JDialog(this, "WaitForStuff", true);
              stuff = new JLabel("MESSAGE");
              buttonless.getContentPane().add(stuff);
              buttonless.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
              buttonless.setSize(200, 200);
              Thread stuffToDo = new Thread() {
                   public void run() {
                        try {
                             stuff.setText("about to do stuff");
                             this.sleep(1500);
                             stuff.setText("Doing Stuff");
                             this.sleep(1500);
                             stuff.setText("Almost done");
                             this.sleep(1500);
                             stuff.setText("Done");
                             this.sleep(1500);
                             buttonless.dispose();
                        catch(Exception e)
                     //Make sure to start the thread before setting the modal dialog to visible
              stuffToDo.start();
              buttonless.setVisible(true);
         public static void main(String args[]) {
              ButtonlessDialog bd = new ButtonlessDialog();
    }Hope that helps

  • Tried purchasing iTunes music. Put in my apple id and password then i was directed to a 'Terms and Conditions' page. I checked the box then clicked the 'accept' button next page read 'your Session has timed out '  try again  with a Done button to click on

    Tried purchasing music from the iTunes Store. When the window popped up I put in my apple id and password. Then I was directed to a 'Terms and Conditions' page. I checked the box next to the 'Yes I agree to these terms and conditions' - then clicked the 'accept' button next page read 'Your Session has timed out. Try again.'  with a 'Done' button to click on. Oh the same thing happens when i try to download  free iTunes. Yes I have tried & tried it again I even logged off and singed back in-- no joy 
    After accessing my iTunes account I was not able to change anything like my credit card number when I tried and was sent right to the 'Your session has timed out. Try again.'
    The last time I purchased any anything was on September 25th 2011 and the 'terms & conditions' page was last updated on October 12, 2011
    Does anyone have an idea to what is going on with my iTunes version 9.2.1 (5) and I can not upgrade to a higher version my iMac does not have the intel processor chip.Thank you for your time and help with this matter. You are greatly appreciated 

    I am having the same problem also! I posted on here about it, but no one has responded with ideas. I called technical support and e-mailed them, the only suggestions they gave was for the to turn off my firewall. But I didn't change anything, so it shouldn't suddenly stop working. Maybe this is just an iTunes issue? But it doesn't even recognize my account anymore, and I cannot log in now.
    If you happen to get an answer, will you please let me know what works for you?
    Thanks!

  • I tried updating my iPhone3g through itunes. Now i'm stuck in recovery mode and i've EVERYTHING even websites and such but nothing worked out! I've also tried restarting and fiddling with the home button but nothing still worked. Please help!

    I tried updating my iPhone3g through itunes. Now i'm stuck in recovery mode and i've EVERYTHING even websites and such but nothing worked out! I've also tried restarting and fiddling with the home button but nothing still worked. Please help! What should I do??

    Well, if you've indeed tried EVERYTHING, then you'll need to bring your phone to Apple for evaluation.

Maybe you are looking for