Displaying a panel

I have the following class Complete which i am calling from another java class. The problem is that the frame is getting diaplayed but the panel is not added on the frame...when i minimize the frame and then click on it to see again, the i can see the panel on the frame i.e. the white color of the panel.... I have done something like this before also but i do not know why this problem is occuring......can anyone please help me out..thanx in advance.....
import java.util.ArrayList;
import java.util.Iterator;
import java.awt.*;
import java.awt.geom.Rectangle2D;
import javax.swing.*;
class Complete extends JPanel
      JFrame jf1;
      Graphics gg;
      String name;
      ArrayList attributes;     
      ArrayList operations;
      Point p;
      Iterator itr;
     Complete(ArrayList attr,ArrayList oper,String nm)
     jf1 = new JFrame();     
     this.setBackground(Color.WHITE);
     this.setLayout(null);
     this.setBorder(BorderFactory.createLineBorder (Color.blue, 2));      
     jf1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     jf1.setVisible(true);
     jf1.add(this);
     attributes=attr;
     operations=oper;
     name=nm;     
     public void paintComponent(Graphics g)
            super.paintComponent(g);
                    gg = (Graphics2D)g;
            p=this.getLocationOnScreen();     
            p.x=p.x+30;
           System.out.println("inside this");
}

This is what I modified ur program and executed....
import java.util.ArrayList;
import java.util.Iterator;
import java.awt.*;
import javax.swing.*;
class Complete extends JPanel
JFrame jf1;
Graphics gg;
String name;
ArrayList attributes;     
ArrayList operations;
Point p;
Iterator itr;
/*Complete(ArrayList attr,ArrayList oper,String nm)     {
     jf1 = new JFrame();     
     JButton hi = new JButton("Hi");
     this.setBackground(Color.WHITE);
     this.setLayout(new BorderLayout());
     this.setBorder(BorderFactory.createLineBorder (Color.blue, 2));      
     this.add(hi);
     jf1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     jf1.setVisible(true);
     jf1.add(this);
     attributes=attr;
     operations=oper;
     name=nm;     
     public Complete() {
          // TODO Auto-generated constructor stub
     public void paintComponent(Graphics g)     {
     super.paintComponent(g);
gg = (Graphics2D)g;
     p=this.getLocationOnScreen();     
     p.x=p.x+30;
     System.out.println("inside this");
     public static void main(String[] args){
          Complete cmp = new Complete();     
          cmp.Call();
     void Call(){
          attributes = new ArrayList();
          operations = new ArrayList();
          attributes.add(new Integer(1));
          attributes.add(new Integer(2));
          attributes.add(new Integer(3));
          operations.add(new String("Hi"));
          operations.add(new String("Bye"));
          operations.add(new String("Run"));
          Complete(attributes, operations, "Intoto");
     private void Complete(ArrayList attr,ArrayList oper,String nm) {
          jf1 = new JFrame();     
          this.setBackground(Color.WHITE);
          this.setBorder(BorderFactory.createLineBorder (Color.blue, 2));      
          JButton hi = new JButton("Hi");
          this.setBackground(Color.WHITE);
          this.setLayout(new BorderLayout());
          this.setBorder(BorderFactory.createLineBorder (Color.blue, 2));      
          this.add(hi);
          jf1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          jf1.setVisible(true);
          jf1.add(this);
          jf1.setSize(50, 100);
          attributes=attr;
          operations=oper;
          name=nm;     
If not this issue...can u please ellobrate wht's ur prb and what u want to view on panel.

Similar Messages

  • 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

  • You are not authorized to display the panel for selecting a power plan

    I'm running Windows 7. Installed "Power Manager" via System Update 4.0 last night (10/23/2009). Getting this error when hitting FN+F3.
    You are not authorized to display the panel for selecting a power plan.
    Furthermore, I'm unable to see any of the default power schemes. Finally, I created two new power schemes, neither of them display for selection.
    Any one else experiencing this issue?!?!?

    Welcome to the forum!
    Hmm...  That seems odd.  Does the userid that you're using have admin rights to the machine?
    English Community   Deutsche Community   Comunidad en Español   Русскоязычное Сообщество
    Jane
    2015 X1 Carbon, ThinkPad Slate, T410s, X301, X200 Tablet, T60p, HP TouchPad, iPad Air 2, iPhone 5S, IdeaTab A2107A, Yoga Tablet, Yoga 3 Pro
    I am not a Lenovo Employee.
    I AM one of those crazy ThinkPad zealots!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"!

  • Early 2009 24" iMac Haywire Display: LCD Panel or Logic Board?

    Hi,
    My 24" display just developed severe vertical and horzontal lines, mouse trailing, color changing and flickering.  The problem begins as soon as the computer is turned on (even the Apple screen goes nuts).
    When I plug in an external display, the external looks just fine.
    This is one of the Nvidia GeForce 9400 chipsets, so there is no separate videocard board to replace - it is integrated onto the logic board.
    It seems like it should be the display panel because the external monitor works fine, but these are complicated machines.
    This is an iMac 9,1 Early 2009, Core2 2.66 Mhz machine.
    Thank you,
    Josh

    Can you connect an external monitor and test? If the artifacts do not show on the external monitor, some component of the display is faulty but not the logic board. The dispay repair is not cheap but cheaper than replacing an LB
    If the same artifacts show on both, well... it's the logic board.
    AHT seldom picks up display faults.

  • RichFaces: Issue with displaying Dynamic panel

    {color:#0000ff}Hi ,
    My requirement is that, i have a page with four links. On clicking on each link, i should display a table and a textfield to filter out the table results.
    To make it generic i am generating the table and filter fields dynamically and binding to a <rich:panel>
    <rich:panel id="manageUsersPanel" styleClass="surveyPanel">
    <rich:panel binding="#{adminUsersDataBean.searchTablePanel}" />
    </rich:panel>The binding #{adminUsersDataBean.searchTablePanel} is of type HtmlPanel.
    It has two child components HtmlPanelGrid and HtmlDataTable.
    and finally rendering the panel on clicking on each link.
    Now the issue is, By the moment i click on any link and reRender the panel it is not showing up.
    If i do F5/ Ctrl + F5 i am able to see the table and other fields.
    Surprisingly if a place any richfaces tags (some <h:outputtext> /<a4j:commandButton> any code) it is coming.
    Only the dynamic binding value is not refreshing.
    Some body please help me out to sortout the issue.
    Thanks in advance.
    Thanks
    Venkat{color}

    i found solution to this problem..
    use <af:iterator>r instead of af:forEach
    bind <af:iterator> to collectionModel
    <af:iterator id="i3"
    value="#{bindings.VO_DA1.collectionModel}"
    var="ls">
    <af:outputText value="#{ls.AREASECTOR}" id="ot8"
    binding="#{backing_Home.ot8}" truncateAt="0"/>
    </af:iterator>
    Regards
    Manav Ratra

  • 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

  • How to display Tools panel in Photoshop Elements Organizer?

    When I open Photosfop elements 11 Organizer the Tools panel is not displayed.  Please help me,I can find no help in Adobe Help 

    No Brian.  Normally when I open Organizer there is as vertical list of tools on the left side of the screen.  Tonight that list of tools is not present.  I want to add a caption in Organizer. Usually on the tools panel (long list of buttons on left of screen)  there is T tool and I click that and drag the rectangle to a desired part of the photo and type the caption.  Very simple if the Tools Panel is present.
    Hope you can help 
    Regards
    Dean Harvey
    Dean Harvey
    65 Harding Street
    Glengowrie  SA  5044
    e-Mail:   <mailto:[email protected]> [email protected]
    Tel:  08 8295 5122
    Mobile:  0414 520 621

  • Display the panel container when user select the specific tab in a tab set

    Hi SAP Experts,
    I've faced some problems and i would like to seek some help from the experts.
    Basically, my requirement is to display the component "panel container" which contains some data whenever a user select e.g. Tab "A" of my component Tab set. Similarly, it hides again when the user select Tab "B" and another panel container appear for it.
    I am not sure if this is achievable in Xcelsius. Experts, please advise me.
    Your help will be greatly appreciated!
    Thanks a lot!
    Feel free to clear any doubts with me
    Best regards,
    htoh

    actually, you can not do that, since you dont have a reference of the current selected tab

  • Display 3 Panels in one frame.....

    Hi
    I need to display 3 different panels in one frame.
    The first panel will contain a JXTreeTable [North]
    The second Panel will contain a Tree [Center]
    The third Panel will contain a JXTreeTable [South]
    I am unable to get this working as the components to be displayed
    are not being placed properly.
    The JXTreeTable is being displayed only at the NORTH.
    Is it better to create 3 different panels or create just one panel with GridLayout(as I have done)
    Have I overlooked something in the code below?
    Thnx
    This is my code:
    public class PositionCostingView {
         public PositionCostingView(){
              initComponents();
         private void initComponents(){
              final JFrame frame = new JFrame("Position Costing");
              frame.setPreferredSize(new Dimension(450, 300));
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              // First,testing my model
              TreeTableModel model = new OpTreeTableModel();
              JXTreeTable treeTable = new JXTreeTable(model);
              // Add the TreeTable to a Scroll Pane.
              JScrollPane scrollPane = new JScrollPane(treeTable);
              JPanel players = new JPanel(new GridLayout(3, 0));
              players.add(scrollPane);
              players.add(MyTree);
              players.add(scrollPane);
              JPanel content = new JPanel();
              content.setLayout(new BoxLayout(content, BoxLayout.PAGE_AXIS));
              content.add(players);
              frame.getContentPane().add(content);
              frame.pack();
              frame.setVisible(true);
         public static void main(String[] args) {
              new PositionCostingView();

    Please ignore my code on top.I am trying something else.....
    No offence meant please.

  • Dreamweaver not displaying properties panel

    I am having trouble getting my properties panel to display its options. I have it there, but it keeps always saying that I need to refresh the code to get it back, but otherwise the panel is blank. I can go to the properties under modify and properties, but it's quicker if I have access to it on the Dreamweaver interface. I am on a Macbook running 10.9.2. Is there an issue that's keeps it from refreshing in the OS? Or did I do something to have it do this?

    If you change some code in Code View, you need to either hit F5 or click in Design View to get the inspector's options back.

  • TabbedPane displays the panel incorrectly with FlowLayout child

    I copied the code example, TabbedPaneDemo.java from Sun/Java. Made some modifications. Now each panel with a FlowLayout. Got incorrect display in the beginning. If I manually select each of the tabs once, then the display becomes correct. Do not know what I have missed? Following is the modified code.
    Please Help!!
    Anna
    * TabbedPaneDemo.java is a 1.4 example that requires one additional file:
    * images/middle.gif.
    import javax.swing.*;
    import java.awt.*;
    public class MyTabbedPaneDemo extends JPanel {
    public MyTabbedPaneDemo() {
    super(new GridLayout(1, 1));
    JTabbedPane tabbedPane = new JTabbedPane();
    int ct = 5;
    JPanel panel[] = new JPanel[ct];
    for ( int i=0; i<ct; i++ ) {
         panel[i] = new JPanel();     
         panel.setLayout( new FlowLayout( FlowLayout.LEFT, 0, 0 ) )     
         switch (i)
         case 0:
         panel[0].add( new Label( "U1" ) );               panel[0].add( new Label( "U2" ) );
         panel[0].add( new Label( "U3" ) );
         panel[0].add( new Label( "U4" ) );
         panel[0].add( new Label( "U5" ) );          
         tabbedPane.addTab("Tab 0", panel[0] );     
         break;                         
         case 1:
         panel[1].add( new Label( "U6" ) );
         panel[1].add( new Label( "U7" ) );
         panel[1].add( new Label( "U8" ) );
         panel[1].add( new Label( "U9" ) );
         panel[1].add( new Label( "U10" ) );                    tabbedPane.addTab("Tab 1", panel[1] );     
         break;
         case 2:
         panel[2].add( new Label( "U11" ) );
         panel[2].add( new Label( "U12" ) );
         panel[2].add( new Label( "U13" ) );                    tabbedPane.addTab("Tab 2", panel[2] );     
         break;
         case 3:
         panel[3].add( new Label( "U14" ) );
         tabbedPane.addTab("Tab 3", panel[3] );     
         break;
         case 4:
         panel[4].add( new Label( "U15" ) );
         tabbedPane.addTab("Tab 4", panel[4] );     
         break;
         default: System.out.println( " i=" + i );               }
    panel[4].setPreferredSize(new Dimension(410, 50));
    add(tabbedPane);
    * Create the GUI and show it. For thread safety,
    * this method should be invoked from the
    * event-dispatching thread.
    private static void createAndShowGUI() {
    //Make sure we have nice window decorations.
    JFrame.setDefaultLookAndFeelDecorated(true);
    //Create and set up the window.
    JFrame frame = new JFrame("TabbedPaneDemo");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    //Create and set up the content pane.
    JComponent newContentPane = new TabbedPaneDemo();
    newContentPane.setOpaque(true); //content panes must be opaque
    frame.getContentPane().add(new TabbedPaneDemo(),
    BorderLayout.CENTER);
    //Display the window.
    frame.pack();
    frame.setVisible(true);
    public static void main(String[] args) {
    //Schedule a job for the event-dispatching thread:
    //creating and showing this application's GUI.
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    createAndShowGUI();

    There are some errors in the code while I cut and paste for it.
    Please use this one.
    * TabbedPaneDemo.java is a 1.4 example that requires one additional file:
    * images/middle.gif.
    import javax.swing.*;
    import java.awt.*;
    public class MyTabbedPaneDemo extends JPanel {
    public MyTabbedPaneDemo() {
    super(new GridLayout(1, 1));
    JTabbedPane tabbedPane = new JTabbedPane();
    int ct = 5;
    JPanel panel[] = new JPanel[ct];
    for ( int i=0; i<ct; i++ ) {
    panel[i] = new JPanel();
    panel.setLayout( new FlowLayout( FlowLayout.LEFT, 0, 0 ) );
    switch (i)
    case 0:
    panel[0].add( new Label( "U1" ) ); panel[0].add( new Label( "U2" ) );
    panel[0].add( new Label( "U3" ) );
    panel[0].add( new Label( "U4" ) );
    panel[0].add( new Label( "U5" ) );
    tabbedPane.addTab("Tab 0", panel[0] );
    break;
    case 1:
    panel[1].add( new Label( "U6" ) );
    panel[1].add( new Label( "U7" ) );
    panel[1].add( new Label( "U8" ) );
    panel[1].add( new Label( "U9" ) );
    panel[1].add( new Label( "U10" ) ); tabbedPane.addTab("Tab 1", panel[1] );
    break;
    case 2:
    panel[2].add( new Label( "U11" ) );
    panel[2].add( new Label( "U12" ) );
    panel[2].add( new Label( "U13" ) ); tabbedPane.addTab("Tab 2", panel[2] );
    break;
    case 3:
    panel[3].add( new Label( "U14" ) );
    tabbedPane.addTab("Tab 3", panel[3] );
    break;
    case 4:
    panel[4].add( new Label( "U15" ) );
    tabbedPane.addTab("Tab 4", panel[4] );
    break;
    default: System.out.println( " i=" + i ); }
    panel[4].setPreferredSize(new Dimension(410, 50));
    add(tabbedPane);
    * Create the GUI and show it. For thread safety,
    * this method should be invoked from the
    * event-dispatching thread.
    private static void createAndShowGUI() {
    //Make sure we have nice window decorations.
    JFrame.setDefaultLookAndFeelDecorated(true);
    //Create and set up the window.
    JFrame frame = new JFrame("TabbedPaneDemo");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    //Create and set up the content pane.
    JComponent newContentPane = new TabbedPaneDemo();
    newContentPane.setOpaque(true); //content panes must be opaque
    frame.getContentPane().add(new TabbedPaneDemo(),
    BorderLayout.CENTER);
    //Display the window.
    frame.pack();
    frame.setVisible(true);
    public static void main(String[] args) {
    //Schedule a job for the event-dispatching thread:
    //creating and showing this application's GUI.
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    createAndShowGUI();

  • 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

  • Displaying different Panels

    Hi,
    I have a small application that will act as a quiz module for a tutorial I am writing. I am using GridBagLayout to display the first question. When the user gets the right answer or clicks a next button I want another GridBagLayout to display.
    Questions:
    From a design point of view I could probably use setVisable(true) or false. But is that the most efficient way to do it? If I have ten questions, I would have to create ten different objects. I've posted my code below, I just need a nudge in the right direction or a code snippet that gives me a better understanding.
    Thanks,
    Steve
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    class TestButtonApplicationv1 {
        public static void main(String[] arguments) {
            JFrame frame = new Interface();
            frame.show();
    class Interface extends JFrame {
         private dataPanel screenvar;
         private NamePass abcdef;
         private JTextArea msgout;
         Interface () {
              super("This is a JFrame");
            setSize(800, 400);  // width, height
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              JPanel pane = new JPanel();
              // create empty space
              pane.setBorder(BorderFactory.createEmptyBorder(30, 20, 10, 30)); //top, left, bottom, right
              // declare components
              msgout = new JTextArea( 8, 40 );
              NamePass testGrid = new NamePass(screenvar, msgout, abcdef);
              // end declare components
              pane.setLayout(new GridLayout(1, 4, 5, 15));   // one less object to keep track of.
              pane.add(testGrid);
                 pane.add( new JScrollPane(msgout));
              msgout.append("Successful");
              setContentPane(pane);
              setVisible(true);
    class updateDataFields implements ActionListener {     // 400
         private dataPanel abc;
         private NamePass  def;
         private JTextArea msg;
         int count = 0;
         public updateDataFields(dataPanel xyz, JTextArea msgout, NamePass qrs) {     // 100
              abc = xyz;
              def = qrs;
              msg = msgout;
         }     // 100
         public void actionPerformed(ActionEvent evt) {     // 200
              count++;
              String command = evt.getActionCommand();
                   if (command.equals("TestMe")){     // 300
                        msg.append("\nSuccessful");
                        abc.right01.setText("1000");
                        abc.left02.setText("Hi!");
                        abc.right03.setText("123456");
                   }     // 300
                   if (command.equals("OK")){     // 300
                        msg.append("\nThis is the Okay Button!");
                        abc.left01.setText("1000");
                        abc.left02.setText("1100");
                        abc.left03.setText("1200");
                        abc.right01.setText("2000");
                        abc.right02.setText("2100");
                        abc.right03.setText("2200");
                   }     // 300
                   if (command.equals("Exit")){     // 400
                             def.answerTextA.setText("" + count);
                             msg.append("\nThis is working" + " " + count);
                   }     // 400
         }     // 200
    }     // 400
    // This is the object that represents one complete question
    class NamePass extends JPanel {
        JLabel answerTextA;
        void buildConstraints(GridBagConstraints gbc, int gx, int gy,
            int gw, int gh, int wx, int wy) {
            gbc.gridx = gx;
            gbc.gridy = gy;
            gbc.gridwidth = gw;
            gbc.gridheight = gh;
            gbc.weightx = wx;
            gbc.weighty = wy;
        public NamePass(dataPanel xyz, JTextArea msgout, NamePass qrs) {
          // set up layout
          GridBagLayout gridBag = new GridBagLayout();
          GridBagConstraints constraints = new GridBagConstraints();
          setLayout(gridBag);
          setBorder(BorderFactory.createCompoundBorder(
                                              BorderFactory.createMatteBorder(
                                                              1,1,2,2,Color.blue),
                                    BorderFactory.createEmptyBorder(5,5,5,5)));
          // radio button A
          buildConstraints(constraints, 0, 0, 1, 1, 5, 5); // gx, gy, gw, gh, weightx, weighty
          JRadioButton answerA = new JRadioButton( "Answer A", true );
          constraints.fill  = GridBagConstraints.NONE;
          constraints.anchor = GridBagConstraints.WEST;
          gridBag.setConstraints(answerA, constraints);
          add(answerA);
          // radio button B
          buildConstraints(constraints, 0, 1, 1, 1, 5, 5); // gx, gy, gw, gh, weightx, weighty
          JRadioButton answerB = new JRadioButton( "Answer B", false );
           constraints.fill = GridBagConstraints.NONE;
           constraints.anchor = GridBagConstraints.WEST;
          gridBag.setConstraints(answerB, constraints);
          add(answerB);
          // radio button C
          buildConstraints(constraints, 0, 2, 1, 1, 5, 5); // gx, gy, gw, gh, weightx, weighty
          JRadioButton answerC = new JRadioButton( "Answer C", false );
           constraints.fill = GridBagConstraints.NONE;
           constraints.anchor = GridBagConstraints.WEST;
          gridBag.setConstraints(answerC, constraints);
          add(answerC);
          // radio button D
          buildConstraints(constraints, 0, 3, 1, 1, 5, 5); // gx, gy, gw, gh, weightx, weighty
          JRadioButton answerD = new JRadioButton( "Answer D", false );
           constraints.fill = GridBagConstraints.NONE;
           constraints.anchor = GridBagConstraints.WEST;
          gridBag.setConstraints(answerD, constraints);
          add(answerD);
           // answer A
          buildConstraints(constraints, 1, 0, 1, 1, 30, 5); // gx, gy, gw, gh, weightx, weighty
          answerTextA = new JLabel("Answer A");
           constraints.fill = GridBagConstraints.NONE;
           constraints.anchor = GridBagConstraints.WEST;
           gridBag.setConstraints(answerTextA, constraints);
          add(answerTextA);
          // answer B
          buildConstraints(constraints, 1, 1, 1, 1, 30, 5); // gx, gy, gw, gh, weightx, weighty
          JButton answerTextB = new JButton("Answer B");
           constraints.fill = GridBagConstraints.NONE;
           constraints.anchor = GridBagConstraints.WEST;
          gridBag.setConstraints(answerTextB, constraints);
          add(answerTextB);
          // answer C
          buildConstraints(constraints, 1, 2, 1, 1, 30, 5); // gx, gy, gw, gh, weightx, weighty
          JButton answerTextC = new JButton("Answer C");
           constraints.fill = GridBagConstraints.NONE;
           constraints.anchor = GridBagConstraints.WEST;
          gridBag.setConstraints(answerTextC, constraints);
          add(answerTextC);
          // answer D
          buildConstraints(constraints, 1, 3, 1, 1, 30, 5); // gx, gy, gw, gh, weightx, weighty
          JButton answerTextD = new JButton("Answer D");
           constraints.gridx = 1;
           constraints.gridy = 3;
           constraints.gridwidth = 1;
           constraints.gridheight = 1;
           constraints.weightx = 30;
           constraints.weighty = 5;
           constraints.fill = GridBagConstraints.NONE;
           constraints.anchor = GridBagConstraints.WEST;
          gridBag.setConstraints(answerTextD, constraints);
          add(answerTextD);
          // exit button
          buildConstraints(constraints, 0, 4, 2, 1, 0, 5); // gx, gy, gw, gh, weightx, weighty
          JButton exit = new JButton("Exit");
           constraints.fill = GridBagConstraints.NONE;
           constraints.anchor = GridBagConstraints.CENTER;
           exit.addActionListener( new updateDataFields( xyz, msgout, this ));
          gridBag.setConstraints(exit, constraints);
          add(exit);
          setVisible(true);
    [\code]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    I don't think there is anything wrong with having ten different objects, it's more a matter of how many you want instantiated at a time.
    Since it's a quiz, where every page is about the same (except for the number of questions, the text, etc.) you can probably make the quiz panel a class which takes parameters of what the options are, similarly to JOptionPane.
    To switch between pages you can use a CardLayout.
    Then you just have to decide how many pages you want instantiated at any point in time. You can create each one as needed, or you can create all of them at the start and use the CardLayout to move each one to the front. An in-between solution is create the next one in the background while the user is making their choice.
    You might be able to find something like a Wizard component, which does similar things so you can avoid duplicating code.

  • How to enable COLOR EFFECT, DISPLAY, etc. panels for the custom components?

    POSITION AND SIZE and COMPONENT PARMETERS are the only panels available for the custom components. Is there a way to configure the custom components or the Flash Pro itself to enable other panels (COLOR EFFECT, DISPLAY, etc.) that available for the Adobe UI components?

    In Flash CS6, you'll need to place your component(compiled clips) inside a Movieclip symbol to apply these settings. In Flash CC, you may do so directly from the Properties panel like for any other movieclip symbol.
    Let me know if you face issues.
    -Nipun

  • Static VI with Visa serial functions is very slow to display front panel

    THere is a delay time of about 10-20 seconds to "display" the first VI's front panel that has Visa serial functions in the source code.
    All works fine after the first load but the initial delay of the front panel load makes it look like the PC could hang during this time. AFter this other VI's load immediately with no delay. I am concerned because I do not want to have to load a VI manually every time I start the APP which is the only workaround I can do at this time.
    Im wondering if anyone else has seen this kind of behaviour.
    I do not remember this happening until I upgraded my APP to LV7.
    DEll optiplex GX260 with 500MB RAM, Win2k and using N.I PCI-232-16 card w/ LV7 now.
    Attachments:
    RECV_LOOP.vi ‏55 KB

    I would like to resurrect this thread, as I am having the same problem. The problem stems from the VISA resource control on my front panel, because I have many COM ports registered on my system. The last suggestion from Scott B. was to "post the resulting .SPY file and I'll take a look at it". So, here is my .SPY file, and as you can see, it takes far too long. As many of these COM ports were registerd from USB converters, most of them are not actually present at this time on the system. However, even the ports that ARE present take a long time to register (i.e. COM1 is present and shows 3 seconds to register). These COM ports shown in my VISA resource do not correspond to those shown in my Device Manager, nor do they correspond to those shown in MAX under Devices and Interfaces.
    I am using LV 7.0 on WinXP SP2, with VISA version 3.2.
    OK, I just discovered something that mostly cured the delay. When I was getting the VISA version number just now, from MAX in the Software>NI-VISA item, there is a tab "VISA Options", and another tree structure in the middle pane. Selecting "General Settings>Aliases", there was a list of the old COM ports, so I cleared this list and then re-started MAX, checked again, and now only the COM ports shown in "Devices and Interfaces" matched this list (which still doesn't match my Device Manager, but no matter). When I re-opened the LabVIEW FP, it opened quickly, and the ports listed in the VISA resource matched those I saw in MAX.
    At any rate, although I just cured the symptom, the original problem of old aliases in VISA causing unacceptable delay should be fixed by NI.
    David Moerman
    TruView Technology Integration Ltd.
    P.S. the message poster didn't allow my to post a *.spy extension, so here is the *.zip of it.
    Attachments:
    Capture.zip ‏2 KB

Maybe you are looking for