How can i make a swing frame block?

Hi,
I have an application with several frames, before building a frame, I want to query the user about some information. So I build another Jframe, with some radio buttons, etc. and display that first.
However, the new Jframe does not make the rest of the program block, and thus the other Jframe is still created immediately...is there a way to make the JFrame with the query info block, until it is closed?
thanks!

I am still a bit confused....here is what i am trying to do:
dialogFrame.setVisible(true);
System.out.println(submit);
if(!submit)
return;
else
submit = false;
dialogFrame the JDialog...it is built like this:
JRadioButton rButtons[] = new JRadioButton[3];
JPanel rPanel = new JPanel(new GridLayout(0, 1));
rButtons[0] = new JRadioButton("Use Milliseconds Scale");
rButtons[0].setSelected(true);
rButtons[0].setActionCommand("MS");
rButtons[1] = new JRadioButton("Use Seconds Scale");
rButtons[1].setActionCommand("SEC");
rButtons[2] = new JRadioButton("Use Minutes Scale");
rButtons[2].setActionCommand("MIN");
for (int i = 0; i < 3; i++) {
bGroup.add(rButtons);
rPanel.add(rButtons[i]);
dialogFrame.getContentPane().setLayout(new BorderLayout(10,10));
dialogFrame.getContentPane().add(rPanel, BorderLayout.CENTER);
dialogFrame.getContentPane().add(yes, BorderLayout.SOUTH);
dialogFrame.pack();
I put a button "yes" in there, and when the user clicks it, the boolean 'submit' goes true.
But, as you can see above, when i set the dialog frame as visible, it does not block on that line of code, rather it prints out false...

Similar Messages

  • How can i make a still frame from imovie 11 using mpeg streamline clip

    How can I make a still frame from iMovie using mpeg stream clip?

    See my User Tip here.
    https://discussions.apple.com/docs/DOC-3231

  • How Can I make A Dialog/Frame Transparent

    Hi
    I want to make a dialog or frame Transparent. Is it possible in java. Actually i want to add an gif image on the Frame container that image is in curve shape with transparency, and I want this transparency also on the Frame in the java application. I m using JFrame with setUndecorated(true). It will display image (just image) not any Frame behind it, I any one solves my problem to make a frame transparent.
    Thanks
    Khurram

    Check out this link:
    http://forum.java.sun.com/thread.jsp?forum=57&thread=490146
    The program contained therein is really slick.
    My hat is off to the coder.
    Lance

  • How can i make serial in tabular block

    dear friends
    I have a tabular block.
    i added unbound item to the block just to display the record number . in other words i want to display a serial like that we make in reports.
    the value of the serial is not saved on the table. it is just for view.
    i did the following
    on post query trigger i wrote:
    *:browse.RECORDNUMBER := to_number(:system.cursor_record);*
    but this display only number 1
    i want to display like
    1
    2
    3
    4
    and so on
    is this possible?
    thanks in advance

    [email protected] wrote:
    dear friends
    I have a tabular block.
    i added unbound item to the block just to display the record number . in other words i want to display a serial like that we make in reports.
    the value of the serial is not saved on the table. it is just for view.
    i did the following
    on post query trigger i wrote:
    *:browse.RECORDNUMBER := to_number(:system.cursor_record);*
    but this display only number 1
    i want to display like
    1
    2
    3
    4
    and so on
    is this possible?
    thanks in advance:SYSTEM.CURSOR_RECORD represents the number of the record where the cursor is located, so your cursor is on the first record and that is why you always get the number 1.
    You need to use :SYSTEM.TRIGGER_RECORD which returns the number of the record which the Oracle Forms' is processing.
    Use the below code in your POST-QUERY trigger:
    :browse.RECORDNUMBER := :SYSTEM.TRIGGER_RECORD;And when creating a new record, just use the below code in your WHEN-NEW-RECORD-INSTANCE trigger on block level.
    IF :browse.RECORDNUMBER IS NULL AND :SYSTEM.RECORD_STATUS = 'INSERT' THEN
      :browse.RECORDNUMBER := :SYSTEM.TRIGGER_RECORD;
    END IF;Tony
    Edited by: Tony Garabedian on Sep 8, 2008 12:03 PM

  • How do i make the old frame dissapear when i click a button for a new frame

    I have a program were you have 2 buttons in a frame. When you click on a choice a new frame pops up with another choice. I wanted to know how can i make the old frame dissapear after the user makes the choice and the new frame has come up?
    Thank you,
    Dan

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Frame extends JFrame implements ActionListener
         private JButton Three;
         private JButton Four;
         private JButton One;
         private JButton Two;
         static int num = 0;
    public Frame()
         JPanel p1 = new JPanel();
    getContentPane().add(p1);
         if(num == 0)
         p1.add(One = new JButton("Admin"));
         One.addActionListener     (this );
         p1.add(Two = new JButton("Buy"));
         Two.addActionListener     (this );
    if(num == 1)
         this.dispose();
         p1.add(Three = new JButton("Password"));
         Three.addActionListener (this);
    if(num == 2)
         p1.add(Four = new JButton("Product-ID"));
         Four.addActionListener(this);
    public void actionPerformed(ActionEvent e)
         if (e.getSource() == One)
              num = 1;
              Frame g = new Frame();
              g.pack();
              g.setVisible(true);
    if (e.getSource() == Two )
                   num = 2;
                   Frame h = new Frame();
              h.pack();
              h.setVisible(true);
         if(e.getSource() == Three )
              System.out.println("Password");
         if(e.getSource() == Four)
                   System.out.println("Product-ID");
    public static void main(String[] args)
         Frame frame = new Frame();
    frame.pack();
    frame.setVisible(true);

  • How can i make my scrollpane in a way that at the opening of a frame it doe

    How can i make my scrollpane in a way that at the opening of a frame it does not scroll down automatically?
    code is below
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.net.*;
    import javax.swing.JOptionPane.*;
    import java.io.*;
    import javax.swing.colorchooser.*;
    import javax.swing.filechooser.*;
    import javax.accessibility.*;
    import javax.swing.border.*;
    import java.sql.*;
    public class Signup extends JFrame
         JLabel p1,p2,p3,p4,p5,p6,uid,upass,cpass,fname,sname,hint,sl,ed,age,adr,cit,zip;
         JTextField uname,fnamet,snamet,hintt,adrt,adrt1,city,zipcode;
         JPasswordField upassw,cpassw;     
         JComboBox sex,education,agegr;
         Signup()
         Container c=getContentPane();
         c.setLayout(null);
         c.setBackground(Color.white);
         /** JPanel c = new JPanel();
         c.setBackground(Color.white);
         int v = ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS;
         int h = ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED;
         JScrollPane jsp = new JScrollPane(c, v, h); ***/
    p1=new JLabel("Create Your Icafe!ID",10);
         p2=new JLabel("Personal Information");
         p3=new JLabel("User Address");
         p4=new JLabel("Tell Us About Your Hobbiess (Optional) ");
         p5=new JLabel("Tell us something about what you like. This will help us choose the kind of content to display on           your pages.");
         p6=new JLabel("--------------------------------------------------------------------------------");
    uid=new JLabel("User Id");
         upass=new JLabel("Password");
         cpass=new JLabel("Confirmation Password");
         fname=new JLabel("UserName");
         sname=new JLabel("SurName");
         hint=new JLabel("Hint Question");
    sl=new JLabel("Sex");
         ed=new JLabel("Education");     
         age=new JLabel("Age Group");     
         adr=new JLabel("Address");
    cit=new JLabel("City");
    zip=new JLabel("ZipCode");
         uname=new JTextField(10);
         uname.requestFocus();     
         uname.setToolTipText("UserName");
    upassw=new JPasswordField(10);
         upassw.setToolTipText("Password");
         upassw.setEchoChar('*');
         cpassw=new JPasswordField(10);
         cpassw.setToolTipText("Confirmation Password");
         cpassw.setEchoChar('*');
         fnamet=new JTextField(10);
         fnamet.setToolTipText("FullName");
         snamet=new JTextField(10);
         snamet.setToolTipText("SurName");
         hintt=new JTextField(10);
         hintt.setToolTipText("Hint Question");     
    String[] gender={"[Select one]","Male","Female"};
         sex = new JComboBox(gender);          
    String[] edu={"[Select one]","S.S.C","Inter","Graduate","Post Graduate"};
         education= new JComboBox(edu);     
    String[] ageg={"[Select one]","0 - 15","16 - 35","36 - 70","70 - 100"};
         agegr= new JComboBox(ageg);     
    adrt=new JTextField(15);
         adrt.setToolTipText("Address");
         adrt1=new JTextField(15);
         adrt1.setToolTipText("Address");
         city=new JTextField(15);
         city.setToolTipText("City");
    zipcode=new JTextField(15);
         zipcode.setToolTipText("ZipCode");
         p1.setBounds(200,70,160,30);
         uid.setBounds(350,100,160,30);
         uname.setBounds(400,100,160,30);
         upass.setBounds(335,140,160,30);
         upassw.setBounds(400,140,160,30);
         cpass.setBounds(260,180,160,30);
         cpassw.setBounds(400,180,160,30);
         p2.setBounds(200,220,160,30);
         fname.setBounds(330,260,160,30);
         fnamet.setBounds(400,260,160,30);
         sname.setBounds(335,300,160,30);
         snamet.setBounds(400,300,160,30);
    hint.setBounds(315,340,160,30);     
    hintt.setBounds(400,340,160,30);
         sl.setBounds(370,380,160,30);     
         sex.setBounds(400,380,160,30);
         ed.setBounds(335,420,160,30);     
         education.setBounds(400,420,160,30);
    age.setBounds(330,460,160,30);
    agegr.setBounds(400,460,160,30);
    p3.setBounds(200,500,160,30);
         adr.setBounds(340,540,160,30);
         adrt.setBounds(400,540,160,30);
         adrt1.setBounds(400,580,160,30);
         cit.setBounds(370,620,160,30);
         city.setBounds(400,620,160,30);
    zip.setBounds(590,620,160,30);
    zipcode.setBounds(640,620,160,30);
         Font font = new Font("SansSerif",Font.BOLD, 12);
         setFont(font);
         c.add(p1);
    c.add(uid);
         c.add(uname);     
         c.add(upass);
         c.add(upassw);
    c.add(cpass);
         c.add(cpassw);
    c.add(p2);
    c.add(fname);     
         c.add(fnamet);
    c.add(sname);
    c.add(snamet);
         c.add(hint);
    c.add(hintt);     
    c.add(sl);
    c.add(sex);
    c.add(ed);
         c.add(education);
    c.add(age);
         c.add(agegr);
    c.add(p3);
    c.add(adr);
         c.add(adrt);
         c.add(adrt1);
    c.add(cit);
    c.add(city);
    c.add(zip);
    c.add(zipcode);
         setResizable(false);
         //int a=DO_NOTHING_ON_CLOSE;
         //setDefaultCloseOperation(a);
         show();
         setSize(800,500);
    // Border raisedBorder = new BevelBorder(BevelBorder.RAISED);     
         setContentPane(c);     
    public static void main (String arg[])
         try{
         UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
         }catch(Exception s)
         Signup swu=new Signup();

    just try the following:
    jsp.getVerticalScrollbar().setValue(0);after inserting and adding all your components. this will set the vertical scrollbar up to the very first line.
    regards

  • How can i make a  flowing toolbar that stays in front of the main frame?

    I want to make a toolbar that has to stay in front of one of my JInternalFrame, this toolbar will have two buttons and they will change the states of some TextPanes in the JInternalFrame (font,styles, etc.). How can i do so?? how can i make it flow on the internalFrame? how can i make it interact with the internal frame's components? and how can i associate both of them ( their 'actionPerform') ??
    thank's

    You can check for problems with the <b>places.sqlite</b> database file in the Firefox profile folder.
    *http://kb.mozillazine.org/Bookmarks_history_and_toolbar_buttons_not_working_-_Firefox
    *https://support.mozilla.org/kb/Bookmarks+not+saved#w_fix-the-bookmarks-file
    *Places Maintenance: https://addons.mozilla.org/firefox/addon/places-maintenance/

  • "I have to manually select pop up blocker everytime i open firefox. how can i make it permenent?'

    i have to manually select pop up blocker everytime i open new firefox window. How can i make this arrangement permenent?
    == This happened ==
    Every time Firefox opened
    == a week ago

    See http://kb.mozillazine.org/Preferences_not_saved

  • How can i make trigger with basler camera GIGE 659x494 - 70 FPS and I/O terminal block

    Hi all,
    How can i make trigger with basler camera GIGE 659x494 - 70 FPS and I/O terminal block

    Frank,
    If you are wiring an isolated power output to the EVS you will need to apply a power supply to the terminal block.  This is mentioned in the "wiring isolated power output" section of the EVS getting started guide located here.  The guide references the EVS user manual which provides a pinout of the d-ub connector in table 2-11 of the manual located here.  For more information on the camera settings you need to set on the Basler camera please see the user manual of the camera you refrenced here.
    To provide power to the camera you can purchase a power cable for the camera.  Rather than a power cable, since you want to also do triggering, you will want a Trigger and I/O Cable instead which is part number 779985-01 as seen on this product page.  The I/O cable would allow you to wire the trigger lines to the terminal block as well as the power lines.
    David A
    National Instruments
    FlexRIO Product Support Engineer

  • NetBeans 5.5. + layout - how can I make a jar?

    1. I try to build my application.
    2. I've developed it in NetBeans 5.5
    3. I ve used form as a base for my GUI
    4. I've made application with help of GUIBuilder+some swing components I create dynamically during program execution.
    The problem:
    I can't make runnable JAR.
    When I try to launch project.jar form folder /dist I get message:
    "No main class found"
    I need to have these jars (they are in my project's library section:
    1.swing-layout-1.0.1.jar
    2. AbsoluteLayout.jar
    I found a solution:
    How can I package the swing-layout-version.jar library
    into my application JAR?
    Having developed your Swing application in Matisse (using the "Free Design" layout) you can
    package the required swing-layout-version.jar library inside your application JAR file.
    Requirements:
    &#9679; Standard Java project
    &#9679; Swing Layout Extensions library included in your project's classpath
    Open your project's build.xml from the Files tab and insert this:
    <target name="-post-jar">
    <jar update="true" destfile="${dist.jar}">
    <zipfileset src="${libs.swing-layout.classpath}"/>
    </jar>
    </target>
    Just press F11 to build your project as usual. This Ant target will bundle swing-layout.jar
    inside your distribution JAR file.
    You can adapt this Ant target to different requirements.
    So I've inserted this code into my build.xml
    Size of built project jar file increased.
    I try to lauch it and I get no message. Nothing happens.
    What else I have to do if I want to get distributable jar....?

    So I found a problem.
    Jar with main class created using GUIBuilder (NetBeans) doesn't launch.
    I use netbeans 5.5. + jdk 1.6.
    If I launch jar with frame-based main class - everything works.
    If I try to launch form-based main class - it doesn't work.
    I do not get any error message or something like that.
    What it can be?

  • How can I make the combo box turn to the value of black.

    When the show button is pressed (and not before), a filled black square should be
    displayed in the display area. The combo box (or drop down list) that enables the user to choose the colour of
    the displayed shape and the altering should take effect immediately.When the show button is pressed,
    the image should immediately revert to the black square, the combo box should show the value that
    correspond to the black.
    Now ,the problem is: after I pressed show button, the image is reverted to the black square,but I don't know
    how can I make the combo box turn to the value of black.
    Any help or hint?Thanks a lot!
    coding 1.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class test extends JFrame {
         private JPanel buttonPanel;
         private DrawPanel myPanel;
         private JButton showButton;
         private JComboBox colorComboBox;
    private boolean isShow;
         private int shape;
         private boolean isFill=true;
    private String colorNames[] = {"black", "blue", "cyan", "darkGray", "gray",
    "green", "lightgray", "magenta", "orange",
    "pink", "red", "white", "yellow"}; // color names list in ComboBox
    private Color colors[] = {Color.black, Color.blue, Color.cyan, Color.darkGray,
                              Color.gray, Color.green, Color.lightGray, Color.magenta,
                              Color.orange, Color.pink, Color.red, Color.white, Color.yellow};
         public test() {
         super("Draw Shapes");
         // creat custom drawing panel
    myPanel = new DrawPanel(); // instantiate a DrawPanel object
    myPanel.setBackground(Color.white);
         // set up showButton
    // register an event handler for showButton's ActionEvent
    showButton = new JButton ("show");
         showButton.addActionListener(
              // anonymous inner class to handle showButton events
         new ActionListener() {
                   // draw a black filled square shape after clicking showButton
         public void actionPerformed (ActionEvent event) {
                             // call DrawPanel method setShowStatus and pass an parameter
              // to decide if show the shape
         myPanel.setShowStatus(true);
                   isShow = myPanel.getShowStatus();
                                            shape = DrawPanel.SQUARE;
                        // call DrawPanel method setShape to indicate shape to draw
                                            myPanel.setShape(shape);
                        // call DrawPanel method setFill to indicate to draw a filled shape
                                            myPanel.setFill(true);
                        // call DrawPanel method draw
                                            myPanel.draw();
                             myPanel.setFill(true);
                             myPanel.setForeground(Color.black);
                   }// end anonymous inner class
         );// end call to addActionListener
    // set up colorComboBox
    // register event handlers for colorComboBox's ItemEvent
    colorComboBox = new JComboBox(colorNames);
    colorComboBox.setMaximumRowCount(5);
    colorComboBox.addItemListener(
         // anonymous inner class to handle colorComboBox events
         new ItemListener() {
         // select shape's color
         public void itemStateChanged(ItemEvent event) {
         if(event.getStateChange() == ItemEvent.SELECTED)
         // call DrawPanel method setForeground
         // and pass an element value of colors array
         myPanel.setForeground(colors[colorComboBox.getSelectedIndex()]);
    myPanel.draw();
    }// end anonymous inner class
    ); // end call to addItemListener
    // set up panel containing buttons
         buttonPanel = new JPanel();
    buttonPanel.setLayout(new GridLayout(4, 1, 0, 50));
         buttonPanel.add(showButton);
    buttonPanel.add(colorComboBox);
    JPanel radioButtonPanel = new JPanel();
    radioButtonPanel.setLayout(new GridLayout(2, 1, 0, 20));
    Container container = getContentPane();
    container.setLayout(new BorderLayout(10,10));
    container.add(myPanel, BorderLayout.CENTER);
         container.add(buttonPanel, BorderLayout.EAST);
    setSize(500, 400);
         setVisible(true);
         public static void main(String args[]) {
         test application = new test();
         application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    coding 2
    import java.awt.*;
    import javax.swing.*;
    public class DrawPanel extends JPanel {
         public final static int CIRCLE = 1, SQUARE = 2;
         private int shape;
         private boolean fill;
         private boolean showStatus;
    private int shapeSize = 100;
    private Color foreground;
         // draw a specified shape
    public void paintComponent (Graphics g){
              super.paintComponent(g);
              // find center
    int x=(getSize().width-shapeSize)/2;
              int y=(getSize().height-shapeSize)/2;
              if (shape == CIRCLE) {
         if (fill == true){
         g.setColor(foreground);
              g.fillOval(x, y, shapeSize, shapeSize);
    else{
                   g.setColor(foreground);
    g.drawOval(x, y, shapeSize, shapeSize);
              else if (shape == SQUARE){
         if (fill == true){
         g.setColor(foreground);
                        g.fillRect(x, y, shapeSize, shapeSize);
    else{
                        g.setColor(foreground);
    g.drawRect(x, y, shapeSize, shapeSize);
    // set showStatus value
    public void setShowStatus (boolean s) {
              showStatus = s;
         // return showstatus value
    public boolean getShowStatus () {
              return showStatus;
         // set fill value
    public void setFill(boolean isFill) {
              fill = isFill;
         // set shape value
    public void setShape(int shapeToDraw) {
              shape = shapeToDraw;
    // set shapeSize value
    public void setShapeSize(int newShapeSize) {
              shapeSize = newShapeSize;
    // set foreground value
    public void setForeground(Color newColor) {
              foreground = newColor;
         // repaint DrawPanel
    public void draw (){
              if(showStatus == true)
              repaint();

    Hello,
    does setSelectedIndex(int anIndex)
    do what you need?
    See Java Doc for JComboBox.

  • How can I make a decorative page border in Pages?

    How can I make a decorative page border in Pages?

    Hi Janet,
    I suppose that you are asking how to include a decorative border of your design into a pages document. How you design that border is rather out of the range of these discussions. So, let's say that you have a graphic that approximates a picture frame and has the required dimensions to frame your content.
    If you want to have the graphic appear on every page, Drag or Insert > Choose, to incorporate your design in to the document. The position it as you want it, and then Arrange > Send to Background and Format > Advanced > Move Object to Section Master.
    If there is more than one section in your document, there may be more considerations, but if you do this at the outset in the creation of your document, the design of the first section will flow to subsequent sections.
    Regards,
    Jerry

  • How can I make a still photo from imovie

    How can I make a still photo from imovie?

    Let's assume you have iMovie 11 (Version 9). (If you have a different version, let me know. The instructions will be different.)
    First, get an app called MPEG Streamclip, which is free. (google MPEG Streamclip from Squared 5)
    Open MPEG Streamclip.
    In iMovie, select the clip you need. Then, right-click/Reveal in Finder.
    Drag this clip into MPEG Streamclip
    In MPEG Streamclip, move the playhead to the frame you want.
    In MPEG Streamclip, click FILE/EXPORT FRAME.
    Choose JPEG, TIFF, or PNG and give it a name.
    You can then drag this photo into iPhoto.
    I have created a short video Tutorial on how to do this. There is one error in the Tutorial, where it says that Command-click is the same as right-click. I should have said Control-click instead.

  • How can I make a palm tree sway?

    How can I make a palm tree sway?
    I have a palm tree that is a tiff file with alpha. I would like the tree trunk to bend a little and a few of the branches to sway as though it’s gently moving in the wind.
    What would be the easiest way to make that happen?
    Should I save the trunk and a few leaves as separate elements, and then animate them in motion.
    Or is there any way to turn my palm tree into a shape in motion, add edit points and key frames to animate it?
    Any advice would be appreciated.
    Thanks

    Down and dirty: highlight the tree's layer, move the anchor point to the base of the tree, add an Oscillate Behaviour to its Shear X axis. Adjust the Amplitude to 5, Speed to 7 or so, depending on how breezy the day is.

  • How can I make a "property node" for a VI?

    Hello!
    If I add a boolean button on the FP then I am able to make a property node for that button in the Block Diagram. But how can I make a property node for a VI? I have several VI:s an that together is one program. What I need to do is to verify what kind of VI some of my VI:s is. I need to verify if it is .exe or .vi-file, and if it is .exe then I want to disable run, abort, run continuously bottons otherwise not. I have hard that this is possible to do programmaticaly but I can´t figure out how. I am aware that I could do that manually in the File->vi properties->customize->windows appearance but theese choises makes it last forever.
    I want to be able to stop and run and everything if it is a .vi file, but if it is .exe-file then all those buttons should be disabled.
    Anyone have an example on this?
    In an other message at this Forum I read "You can use the `Front Panel Window. Allow Runtime PopUp`" property to disable run-time shortcuts menues programmaticaly, but still I dont know how to create this property node.
    /Amir

    You really shouldn't open a new thread. If you don't understand something, ask and we will explain it.
    Like I said in the other thread, you can check if you are running in LV or an EXE by using the Application>>Kind property. To get it, place a property node (from the Application Control palette) on the diagram, click it and find the property.
    To set the properties for the VI, place another property node, right click it and select Select Class>>VI Server>>VI. You should have the properties you want under Front Panel Window.
    To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here and here are a couple you can start with. You can also contact your local NI office and join one of their courses.
    In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf). I believe chapter 17 of the user manual explains about programmatic control of VIs.
    Try to take over the world!

Maybe you are looking for