Adding child panels

Is it possible to add 'Panels' within 'Panels' using the UIR editor or programmatically?

The UIR editor does not permit you to create a panel inside an existing panel, you must do it a load time instead. The trick is to pass a valid panel handle in the first parametere of the function; as you ca read in the online help;
parentPanelHandle
integer
Handle of the panel into which to load the panel as a child panel. Pass 0 to
load the panel as a top-level window.
Take a look at \userint\panels.prj for an example on how to create and treat child panels.
Proud to use LW/CVI from 3.1 on.
My contributions to the Developer Zone Community
If I have helped you, why not giving me a kudos?

Similar Messages

  • Child panel -how to put him at specific place in Parent panel

    Hello I created program with main panel which other panels as tabs.
    I need to put child panel on on of the tab panels .
    How can i do that and obtain view of the child panel only
    on the right panel?
    I'm attach a picture to describe.
    Thank you for your comments
    Meir
    Solved!
    Go to Solution.
    Attachments:
    panels.JPG ‏122 KB

    Hi Meir,
    it seems to me that you are missinig a very basic concept about the tab control: each tab actually IS a child panel! That is, all the controls you have on your test panel can be simply loaded on the tab page you want, leaving other pages unchanged.
    You may be missing the scroll bar on the right, which effectively is not present on tab controls, but as far as I can see your interface could be reduced to a single table control put on a tab page with appropriate row and colunm headers.
    In any case, if you don't want to heavily modify your existing code you can use InsertPanelAsTabPage () command to add a panel you have previously loaded to the tab control: in this case an existing scroll bar is maintained. Keep in mind that this instruction actually make a copy of the original panel, so you will need to retrieve the correct tab page handle to address control on the added page. The original panel can be discarded immediately after adding it to the tab control.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Adding a Panel to JApplet doesn't work properly

    Hi there,
    I have a class "Editor" extended from JPanel to edit some data. In my JApplet I added a JMenubar with setJMenubar() and registered an ActionListener to the menu items. Everything works fine except the displaying of the EditorPanel after choosing the menu item.
    When I'm adding the Panel in the constructor of the applet it is shown correctly.
    public class EditorApplet extends JApplet implements ActionListener
      public void init()
        setJMenuBar(createJMenuBar());
        Editor e = new Editor();
        getContentPane().add(e); // works perfectly
        e.load(2); // load data into editor
      public void actionPerformed(ActionEvent e)
        if (e.getActionCommand().equals("..."))
          Editor e = new Editor();
          e.loadObjects(1);
          getContentPane().removeAll();
          getContentPane().add(e); // nothing happens!?
          getContentPane().repaint(); // ???
          repaint(); // ???
        }What else needs to be done to display the 'new' Editor?

    Wait. You're adding an ActionEvent to your panel.
    I think you want to do "add(this.e)".

  • Using Child Panels - cannot FOCUS events are lost?

    Hi all,
    I am working with some legacy code that my boss would like updated.  We have a background (parent) panel with many child panels that can come and go.  Typically, we have two panels - one with controls and one with a graph - visible almost all the time.  I have been trying to use FOCUS events to do some things, but one child panel (the control) appears to constantly get and lose focus.  I'm seeing this in debug mode with the breakpoints at the event code for the panel callback.  I'm careful to move the code windows away from this panel so the mouse isn't over it, but that seems to make no difference.  Do child panels get the events of the parent panels?  Also, the child panels do not appear to have max/min or close buttons in the title bar like standard windows.  Is there some way to put them there without taking the child panel out of the parent panel?
    Other things:
    1.  The boss would like to be able to resize a panel down to the point where clipping occurs, then automatically rearrange the controls so they line up vertically on one side of the panel and stop the resizing when they begin to be clipped.  I have seen this done in Java with the Layout Manager, but never in C. Any suggestions?  I know we can set a minimum resize value for a panel, but are there any easy ways to move the controls the way he wants? 
    2.  An alternative is to make a toolbar with the controls inside, but he likes the windows icon tool buttons which I don't believe we have access to in CVI.  I know we can make a command button and import an image to it, but is there a package that has the standard windows tool buttons that we can use?
    Thank you for any and all help.
    Judy Harrigan

    Hi Roberto Bozzolo
         For the parent panels and the children panels,I have some questiones to ask you ,could you tell me how I should do? Monthes ago ,I have asked the same question in NI.COM ,you  cansee the uir:http://forums.ni.com/t5/LabWindows-CVI/menubar-and-toolbar-enveloped-by-the-childpanel/m-p/1112563,
    I use :GetPanelAttribute (mainPanel, ATTR_SYSTEM_WINDOW_HANDLE, &parent);
              GetPanelAttribute (mlsPanel, ATTR_SYSTEM_WINDOW_HANDLE, &child);
              oldparent = SetParent((HWND)child, (HWND)parent); to create an mainPanel and a childPanel.
    For the mainPanel ,it contain the menubar and the toolbar,when I load the childPanel and move it,or
    click the maximize,the menubar and toolbar for mainPanel enveloped by the childpanel.I want the
    menubar and toolbar on top of the childPanel,can you tell  me  what I shoud do?
        you can see ,when I maximize the child panel,the menubar and the toolbar for the parent panel are enveloped by the child panel,also the title for child panel display under the parent title,this are very inaesthetic.and how I should do to make the child panel and the parent panel works as the windows style like the under-side example? 
        When click the maximize button for the child panel,the title for child panel disappeared and the "minimize button","renert button",and "close button" for the child panel display on the top right of the parent menubar.To all of this,how I should do,could you please help me?
    Attachments:
    result.JPG ‏91 KB

  • Inconsistent results for adding child node in a JTree

    I have a JTree where I add child nodes when a user clicks on the node or handle. When the user clicks on the node, through implementing TreeSelectionListener interface, I add a node, the tree expands, and I see the newly added node. However, when the user clicks on the handle, through implementing the TreeExpansionListener, the tree does not expand and I do not see the newly added node. The problem is repeatable by compiling the code below.
    Why is there this difference? Aren't all the methods implemented through the TreeSelectionListener and TreeExpansionListener in the SWT thread?
    public class TestFrame extends JFrame implements TreeSelectionListener, TreeExpansionListener {
         public TestFrame() {
              String[] alphabets = {
                        "a", "b", "c", "d", "e", "f", "g",
                        "h", "i", "j", "k", "l", "m", "n",
                        "o", "p", "q", "r", "s", "t", "u",
                        "v", "w", "x", "y", "z"
              DefaultMutableTreeNode top = new DefaultMutableTreeNode("CEDICT");
              for(int i=0; i < alphabets.length; i++) {
                   DefaultMutableTreeNode node =
                        new DefaultMutableTreeNode(alphabets) {
                        public boolean isLeaf() { return false; }
                   top.add(node);
              JTree tree = new JTree(top);
              tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
              tree.addTreeSelectionListener(this);
              tree.addTreeExpansionListener(this);
              tree.setShowsRootHandles(true);
              JScrollPane treePane = new JScrollPane(tree);
              treePane.setHorizontalScrollBarPolicy(
                        JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
              treePane.setVerticalScrollBarPolicy(
                        JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
              treePane.setSize(new Dimension(200,400));
              treePane.setPreferredSize(new Dimension(200,400));
              getContentPane().setLayout(new BorderLayout());
              getContentPane().add(treePane, BorderLayout.CENTER);
              Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
              int inset = 50;
    setBounds(inset, inset,
    screenSize.width - inset*2,
    screenSize.height - inset*2);
              setLocationRelativeTo(null);
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              pack();
              show();
         public static void main(String[] args) {
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        JFrame.setDefaultLookAndFeelDecorated(true);
                        TestFrame frame = new TestFrame();
         public void valueChanged(TreeSelectionEvent e) {
              JTree tree = (JTree)e.getSource();
              DefaultMutableTreeNode node =
                   (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();
              System.out.println(node);
              Date date = new Date();
              node.add(new DefaultMutableTreeNode(date.toString()));
         public void treeCollapsed(TreeExpansionEvent event) {
              JTree tree = (JTree)event.getSource();
              TreePath path = event.getPath();
              DefaultMutableTreeNode node =
                   (DefaultMutableTreeNode) path.getLastPathComponent();
              System.out.println(node);
              Date date = new Date();
              node.add(new DefaultMutableTreeNode(date.toString()));
              tree.invalidate(); //does not help to show newly added child
         public void treeExpanded(TreeExpansionEvent event) {
              JTree tree = (JTree)event.getSource();
              TreePath path = event.getPath();
              DefaultMutableTreeNode node =
                   (DefaultMutableTreeNode) path.getLastPathComponent();
              System.out.println(node);
              Date date = new Date();
              node.add(new DefaultMutableTreeNode(date.toString()));
              tree.invalidate(); //does not help to show newly added child

    I couldn't figure out why inserting a node in the valueChanged(...) method works. In all three methods no listeners are notified about the change, so you would think all three would fail.
    For a JTree using the DefaultTreeModel the nodesWereInserted(...) method needs to be called. For example, if I change your last three methods to this
    public void valueChanged(TreeSelectionEvent e) {
       insertNode((JTree) e.getSource(),
                  (MutableTreeNode) e.getPath().getLastPathComponent());
    public void treeCollapsed(TreeExpansionEvent event) {
       insertNode((JTree) event.getSource(),
                  (MutableTreeNode) event.getPath().getLastPathComponent());
    public void treeExpanded(final TreeExpansionEvent event) {
       insertNode((JTree) event.getSource(),
                  (MutableTreeNode) event.getPath().getLastPathComponent());
    public void insertNode(JTree tree, MutableTreeNode parent) {
        Date date = new Date();
        MutableTreeNode child = new DefaultMutableTreeNode(date.toString());
        int index = parent.getChildCount();
        parent.insert(child,index);
        ((DefaultTreeModel) tree.getModel())
                .nodesWereInserted(parent,new int[]{index});
    }then it works as you desire. You can (and should) of course use the DefaultTreeModel's own insert method.
    DefaultTreeModel#insertNodeInto(MutableTreeNode,MutableTreeNode, int)

  • Parent key 1393696 not found when adding child 1393727.

    By posting, I received this :
    An error in the system has occurred. Please contact the system administrator if the problem persists.
    type: java.lang.IllegalArgumentException
    java.lang.IllegalArgumentException: Parent key 1393696 not found when adding child 1393726.
    at com.jivesoftware.util.LongTree.addChild(LongTree.java:99)
    at com.jivesoftware.forum.database.DbTreeWalker.addChild(DbTreeWalker.java:233)
    at com.jivesoftware.forum.database.DbForumThread.addMessage(DbForumThread.java:617)
    at com.jivesoftware.forum.proxy.ForumThreadProxy.addMessage(ForumThreadProxy.java:145)
    at com.jivesoftware.forum.action.PostAction.createMessage(PostAction.java:1083)
    at com.jivesoftware.forum.action.PostAction.execute(PostAction.java:946)
    at com.jivesoftware.forum.action.PostAction.doPost(PostAction.java:666)
    at sun.reflect.GeneratedMethodAccessor110.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at com.opensymphony.xwork.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:300)
    at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:166)
    at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
    at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
    at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
    at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
    at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
    at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
    at com.jivesoftware.forum.action.JiveExceptionInterceptor.intercept(JiveExceptionInterceptor.java:63)
    at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
    at com.jivesoftware.base.action.JiveObjectLoaderInterceptor.intercept(JiveObjectLoaderInterceptor.java:56)
    at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
    at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
    at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
    at oracle.wocapps.forum.action.OracleLocaleInterceptor.intercept(OracleLocaleInterceptor.java:74)
    at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
    at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
    at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
    at com.opensymphony.webwork.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:71)
    at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
    at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
    at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
    at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
    at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
    at com.opensymphony.xwork.DefaultActionProxy.execute(DefaultActionProxy.java:116)
    at com.opensymphony.webwork.dispatcher.ServletDispatcher.serviceAction(ServletDispatcher.java:272)
    at com.jivesoftware.base.util.JiveWebWorkServlet.service(JiveWebWorkServlet.java:62)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
    at com.jivesoftware.util.SetResponseCharacterEncodingFilter.doFilter(SetResponseCharacterEncodingFilter.java:53)
    at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
    at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
    at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
    at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17)
    at com.jivesoftware.util.SetRequestCharacterEncodingFilter.doFilter(SetRequestCharacterEncodingFilter.java:48)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:627)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
    at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
    at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:299)
    at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:187)
    at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
    at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
    at java.lang.Thread.run(Thread.java:595)

    Check the adapter that is attached to the child table , compile it again and try adding .
    BTW which connector you are using and paste the error trace from log files
    Thanks
    Suren

  • Adding a panel to an open GUI with a background image

    Dear java programmers,
    I want to add a JPanel with some components on an open(visible) GUI whenever a button is clicked. That JPanel carries a button, a progress bar, a label, and a textarea inside a scrollpane. Whenever the button of the panel is clicked a program starts working, and the progress and output of that program is reflected on the progress bar and textfield respectively. I 'put the code to generate and add the panel in a so called "Progress" class, which is different from the GUI class that contains the code to create and display the main gui.
    My gui also has a background image to make is look fancy, which is added by the following way:
    GUI mygui = new GUI();
    mygui.getContentPane().add(new ImagePanel(new ImageIcon("/home/thomas/Documents/external_placement/Report/presentation4_transp.png").getImage()));
    My problem is that the background image is hiding the panel (whenever added) and only when the cursor passes above the button inside the panel it becomes visible (just the button). However when I click the button and the program starts I can see everything inside the panel.
    Is there an efficient way of making the panel visible at once?
    thanks in advance,
    Tom

    Ok now that I'm certain about how to use code tags I'll try to make myself clear.
    First of all I made it work by removing the ImagePanel , adding the JPanel and re-adding ImagePanel, all from within the Progress.class. But I'm not sure if this is the right way.
    Below I'll make an attempt to provide some SSCCE--code. First of all the classes I'm using are 2, the GUI.class which contains all the components of the gui, and the Progress.class which has the additional panel and adds it to the gui whenever the "submit" button is clicked.
    The code from GUI.class which is relevant to this question is:
    public class GUI extends javax.swing.JFrame{
    //the following are declared as "protected" because they are also used elsewhere
                protected static GUI mygui = new GUI();
                protected static ImagePanel backgroundImagePanel = new ImagePanel(new ImageIcon("/home/thomas/Documents/external_placement/Report/presentation4_transp.png").getImage());
                /* The constructor */
                public GUI() {
            initComponents(); //this method initializes all the components, puts the in a JTabbedPane and packs them the JFrame
            setLayout(new BorderLayout());
        /* the eventlistener of the "submit" button */
        private void submitButtonActionPerformed(java.awt.event.ActionEvent evt) {
            ProgressBarTest pbt = new ProgressBarTest(mygui);
            pbt.StartProgress();
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    mygui.getContentPane().add(backgroundImagePanel);
                    mygui.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                    mygui.pack();
                    mygui.setVisible(true);
    } And then I have my Progress.class:
    public class Progress implements ActionListener, Runnable {
    //the following are declared as "private" because they are also used elsewhere inside the class
        private static javax.swing.JProgressBar progressBar = new JProgressBar(0, 100);
        private static javax.swing.JTextArea progressTextArea = new javax.swing.JTextArea(5,20);
        private static ProgressBarTest _this;
        {color:#0000ff}private static GUI mygui;{color}
        /* the constructor */
        public Progress(GUI gui){
            _this = this;
            {color:#0000ff}mygui = gui;{color}
        private static void createAndShowPanel(){
            javax.swing.JScrollPane progressScrollPane = new JScrollPane(progressTextArea);
            javax.swing.JLabel progressLabel = new JLabel("Progress");
            javax.swing.JButton progressButton = new JButton("Do something");
            progressButton.addActionListener(_this);
            javax.swing.JPanel progressPanel = new JPanel();
            javax.swing.GroupLayout progressPanelLayout = new javax.swing.GroupLayout(progressPanel);
            progressPanel.setLayout(progressPanelLayout);
            progressPanelLayout.setAutoCreateGaps(true);
            progressPanelLayout.setAutoCreateContainerGaps(true);
            progressPanelLayout.setHorizontalGroup(
                    progressPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(progressPanelLayout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(progressPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(progressScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 872, Short.MAX_VALUE)
                    .addComponent(progressBar, javax.swing.GroupLayout.DEFAULT_SIZE, 872, Short.MAX_VALUE)
                    .addComponent(progressLabel)
                    .addComponent(progressButton, javax.swing.GroupLayout.Alignment.TRAILING))
                    .addContainerGap())
            progressPanelLayout.setVerticalGroup(
                    progressPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, progressPanelLayout.createSequentialGroup()
                    .addContainerGap(25, Short.MAX_VALUE)
                    .addComponent(progressButton)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(progressLabel)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(19, 19, 19)
                    .addComponent(progressScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap())
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout({color:#0000ff}mygui.getContentPane(){color});
            {color:#0000ff}mygui.getContentPane().setLayout(layout);{color}
            layout.setHorizontalGroup(
                    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(progressPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent{color:#0000ff}(mygui.jTabbedPane1{color}, javax.swing.GroupLayout.PREFERRED_SIZE, 496, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(100, Short.MAX_VALUE))
            layout.setVerticalGroup(
                    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent({color:#0000ff}mygui.jTabbedPane1{color}, javax.swing.GroupLayout.PREFERRED_SIZE, 362, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(progressPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap())
           {color:#0000ff} mygui.getContentPane().remove(mygui.backgroundImagePanel);
            mygui.getContentPane().add(progressPanel, BorderLayout.SOUTH);
            mygui.getContentPane().add(mygui.backgroundImagePanel);
            mygui.pack();{color}
        public static void StartProgress(){
            ProgressBarTest t = new ProgressBarTest({color:#0000ff}mygui{color});
            new Thread(t).start();
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowPanel();
        public void actionPerformed(ActionEvent ae){
    // signal the worker thread to get crackin
            synchronized(this){notifyAll();}
    // worker thread
        public void run(){
            while(true){
    // wait for the signal from the GUI
                try{synchronized(this){wait();}} catch (InterruptedException e){}
                Dock dock = new Dock();
                int chainArrayLength = dock.PrepareDockEnvironment();
    // start a long-running process -this is a task performed by "Dock.class"
                for (int i = 0; i <= 100; i++){
                    progressBar.setValue(i*100/chainArrayLength);
                    progressTextArea.append("Docking chain No "i".\n");
                    System.out.println("actionPerformed sets progressBar value to: "+i);
                    dock.StartDocking(i);
    }Please notice how I use the GUI object (named "mygui") inside the Progress.class to retrieve components from the main gui (particularly the jTabbedPane1), align them with the additional panel (progressPanel) and add them to the main gui again. I tried to color blue the lines where the GUI instance is used but I'm not sure if they will be visible.
    My questions are:
    1. Is this the right way to add a new panel to a jFrame from an external class? Do I add jTabedPane twice in the above code?
    2. Is this the most efficient way of making the additional panel visible at once, meaning by removing the ImagePanel (backgroundImagePanel) adding the panel (progressPanel) and finally adding again the ImagePanel (backgroundImagePanel)?
    Hope I was perspicuous.
    Tom

  • How to Maximize/M​inimize Child panels

    Is it possible to have maximize and minimize for child panels ? I would like a panel to be able to maximize to the size of the canvas area of the parent panel.

    You can resize the child panel and move it as you see fit with SetPanelAttribute. However, for a child panel that is not a top-level window, there is no notion of minimize and maximize. This is an option for top-level windows that has a built in OS functionality.
    Best Regards,
    Chris Matthews
    Measurement Studio Support Manager

  • Child panel in parent panel- strange top value

    Hi!
    I want to write application where I have menu with buttons. Depending on the button pressed the buttons should hide and another design bring on front.
    I don't have any ideas except make that on different panels. I made one parent panel, and a few child panels. When I click button the panel with buttons hides and I'm displaing another panel with width and height equal to parent panel. I can't understand why I have to always have value equal to 30 in top property of child panel. Left property is set o zero and it's displaing OK. When I set 0 to top property the child panel is partially hidden in parent window.
    Why the top property have to be always set to 30 to display exactly panel in panel? I tried to switch on and off titlebar, but it seems taht is no problem. Anyone can explain me that behaviour? Maybe any other ideas to make that kind of application? I don't want to use tabs.

    I'm attaching some pictures so that there's no confusion over what I'm talking about. I'm using the userint/panels.cws, but I modified childPanel1 to be the exact height of the parent panel as you can see in this picture taken from the UI Editor:
    If I don't programmatically set the top of the panel and auto-center vertically is not set to true, then I get this when the panel is loaded. You can see that the panel is being cut off because it loads inside the parent panel using the top value set in the UIEditor.
    If I set the child panel to auto-center vertically it looks like this. You can see that the child panel's title bar is partially obscured due to the auto-centering, and the splitter at the bottom of the child panel is not visible.
    If I then programmatically set the top and left to (0,0) I get this. The frame of the child panel (including the title bar) is hidden, but you can see that everything on the panel is visible:
    If I programmatically set the top to 30 it looks like this. The title bar is visible but you can see that the control at the bottom of the panel is now no longer visible:
    I'm assuming that you're seeing the behavior in the 4th screen shot when you set the top to 0 and something similar to the 5th screen shot when you set the child panel top to 30. I'm guessing that due to the font being used on your machine, the thickness of the child panel title bar is actually 30 so it doesn't stand out quite as much as mine.
    When setting the position of a panel inside another panel, the frame (which includes the titlebar) is ignored, so that (0,0) cooresponds to the very first pixel that is actually visible in the panel. I'm guessing that what you want to do is either:
    A) Disable the titlebar in the child panel and set the frame thickness to 0, or
    B) If you need the titlebar of the child panel to visible, change the height of the of the child panel to be = (height of parent panel - 30).
    Kevin B.
    National Instruments

  • Adding a panel to a frame

    Hi! All,
    I'm new to java and i have a little problem here. I have created a frame and i want to put two panels inside it. well, i managed to put the first one, but i'm having problems with the second one. I want this second one to be added when I click on a button.
    The button that I will click is the new JButton i have defined. it is called draw. I really do not know what the problem is. I will apprecite any help. Below is my code.
    // My Code.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    import java.util.*;
    public class Main extends JFrame {
    //all components I'll need
    public JButton draw;
    public JButton addFormula;
    public JButton modelCheck;
    /** Creates a new instance of Main */
    public Main () {
    super("Graphical Model Checker for Knowledge");
    //content pane is the main panel where i'll put everything
    JPanel contentPane = new JPanel();
    draw = new JButton("Draw");
    draw.addActionListener(
    new ActionListener() {         
    public void actionPerformed(ActionEvent event) {
    if(event.getActionComman().equals"Draw")) {               
    JPanel drawing = new JPanel();
    drawing.setBackground(Color.BLUE);
    drawing.setSize(100, 100);
    drawing.setLayout(new FlowLayout
    FlowLayout.CENTER));
    add("North", drawing);
    drawing.setVisible(true);
    contentPane.add(draw);
    addFormula = new JButton("Add Formula");
    contentPane.add(addFormula);
    modelCheck = new JButton("Model Check");
    contentPane.add(modelCheck);
    Canvas canvas = new Canvas();
    canvas.setSize(40, 40);
    canvas.setBackground(Color.white);
    contentPane.add(canvas);
    repaint();
    //add panel to the frame
    add("South", contentPane);
    //colours for window
    contentPane.setBackground(Color.yellow);
    //set layout manager
    contentPane.setLayout(new FlowLayout(FlowLayout.LEFT));
    addWindowListener(new CloseWindow());
    pack();
    setVisible(true);
    String [] fileItems = {"Open", "Save", "Rename"};
    String [] editItems = {"Copy", "Cut", "Paste"};
    //instantiate a menu bar object
    JMenuBar bar = new JMenuBar();
    JMenu file = new JMenu("File");
    for (int index=0; index != fileItems.length; index++)
    file.add(fileItems[index]);
    bar.add(file);
    setJMenuBar(bar);
    JMenu edit = new JMenu("Edit Graph");
    for (int index=0; index != editItems.length; index++)
    edit.add(editItems[index]);
    bar.add(edit);
    setJMenuBar(bar);
    public static void main(String args []) {
    JFrame window = new Main();
    }

    Don't forget to use the "Code Formatting Tags",
    see http://forum.java.sun.com/help.jspa?sec=formatting,
    so the posted code retains its original formatting.
    add("North", drawing); The "North" means nothing when adding a component to a panel using a FlowLayout. You should just be using:
    add( drawing );After you add the component to the container you need to use:
    frame.validate();

  • Issue adding Child member to the outline in 11.1.2.2

    Hi ,
    We have any Issue with adding the member to the Outline. Details mentioned below.
    Server locked up when i was updating the outline. I was erasing lower level structure.. This has been a chronic problem..
    http://gvw3086-v.atlanta.hp.com:9000/easconsole/console.html
    Need this server reset asap.. this is holding up important forecast work. Many people are depending on this getting done.
    However to make it work you have to change the name of an existing member.. then add to the data base outline.. which disappear when you put it in.. save it. close and reopen and the structure add will be present. Do not copy, and delete siblings.. this will cause the server to lock up.
    We had this issue before and what I have done is
    just add the Child Outline and when we saved it it’s not saving  the cursor keeps on browsing and  rotating and it will not save. So in order to save  just rename some other child member and save it then it saves. And when we close and reopen the outline we can see the child Outline was added. And again rename the other child member what we renamed to its original name.
    The above one is just a temporary fix what we did but can any one help me on Permanent Fix for this.
    Regards,
    Naveen

    Hi Naveen,
      I think this issue is related to JRE version. As per support matrix for 11.1.2.2, JRE version version should be 1.6_29+.  (that does not mean Java 7 is supported)
      Check whats the Java/JRE version you have on the system from which you are accessing EAS link.
      If its Java 7, uinstall it & install supported 1.6 version.
    Hope this resolves the issue.
    Thanks,
    Santy.

  • CUA client doesn't know any profile/role anymore after adding child system

    Hi,
    I did set up a CUA client on our Solman system. The client is client 500 which has been copied over from 000 via the SAP_CUST profile.
    In this client 500 I did create some users with the SAP_ALL profile, so no problem here.
    After adding a child system to the CUA, it seems that if I want to create a new user in the CUA client 500 it doesn't know any role/profile anymore which is standard available in this client.
    In PFCG I can find a lot of standard roles, but when adding one via SU01 I do get the error that it doesn't exist. The same goes for the profile SAP_ALL.
    Just to be clear, adding profiles or roles from child systems is not a problem, just adding roles or profiles for the CUA client itself doesn't seems to work anymore.
    I had this problem on a 7.0 solman system and now also on a 7.01.
    Did anyone had the same problem?
    Thanks,
    Gregory

    Hello Georges,
    I have exactly the same issue.
    I have created a new CUA. I have copie 001 client to 333 client, using SAP_ALL profile.
    Now, from CUA client (333), I cannot add any roles or profiles to my user.
    I have created an RFC D1CCLNT333, but it does not resolved the problem.
    Did you do anything else to fix your issue ?
    Thanks
    Best regards
    CP2009

  • Adding custom panels to Business Process Workspace

    Hi,
    is it possible to add a custom panel to the Business Process Workspace? By custom I mean a jsp/jsf/jsff/taskflow/etc that i design.
    Is that possible. And if yes can somenoe point me to documentation or exemples?
    Thanks in advance,
    Diogo Henriques

    Hi Ruben,
    thanks for your response, but i'm still having problems.
    First the workspace.properties didn't have that property, so i tried adding it but the workspace stop responding só I had to revert the alteration (on a side note, I altered the file in the .ear on the server and then updated the .ear through the deployments list, is there other way to alter it like a properties page?).
    While looking for a solution to my problem I started seeing references to Oracle Webcenter and Process Spaces. Do I have to install them to be able to do the kind of costumizations I want?
    Thanks,
    Diogo Henriques

  • Adding dynamic panels

    My application needs to dynamically decide how many components will be present in the panel depending on the clauses. For each clause, I have designed a seperate panel,(its design is fixed) . But the number of clause panels to be included in the main panel is dynamic. How do I add the panels to the main panel for display?
    I was successful in adding a single panel to the main panel. For this I had to define the layout of the panel again and set its horizontal and vertical group. But how do I add a list of components. If I add a for loop within the layout.setHorizontalGroup() or layout.setVerticalGroup(), it does not work. Also panel.addLayoutComponent() did not work. Can anyone please tell me how will I add the components dynamically.

    Its still not working.
    In my application I have some user defined panels. The component I need to add to the main panel is a user defined panel.
    The code is as follows, where panelBetween is a user-defined panel in the package com.HelperTool
    com.HelperTools.panelBetween between1 = new com.HelperTools.panelBetween();
                between1.jCheckBoxBetweenCondition.setText("Where userid between");
                jPanelMain.add(between1);
                jPanelMain.revalidate();
                jPanelMain.repaint();

  • Error after adding Child node

    Hi Experts,
    I have created a Data object by importing as "BAPI Wrapper" . It had a Parent node and a child node. Now i added one more child node.
    But if i am activating this node it is giving below error.
    Object not adequately specifiedError
    Regards,
    Abhishek

    Hi Dhana,
    I have deleted the child node and added these attributes in header so now i can activate this header structure but when i tried to activate BA after mapping , then it says
    Invalid field mapping
    But i have counter checked everything is fine even when i checked my BA with "Error check" button it didn`t give any error. Any idea how to sort it out.
    Regards,
    Abhishek

Maybe you are looking for