Center vi in a subpanel

Hello,
I would like to adjust or center my VI which is inserted in my subpanel to have a modular software.
The poor is that my software will adapt automatically with my screen size.
R. Kaszubiak

Press control --> I then a VI properties window will open then remaining I attached in doc file.
Hope this will help
Kudos are always welcome if you got solution to some extent.
I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
Attachments:
Window size.doc ‏105 KB

Similar Messages

  • Its seems impossible to center a fixed size image on a container

    Hi,
    I have a fixed sized JPanel that I want to add to the center of a container. I would like my JPanel's center to be fixed to the center of the container.
    I have tried to use GridBagLayout with a GridbagConstraint like follows:
    GridBagLayout gridbag = new GridBagLayout();
    getContentPane().setLayout(gridbag);
    GridBagConstraints c = new GridBagConstraints();
    c.fill = c.CENTER;
    SubPanel subPanel = new SubPanel();
    gridbag.setConstraints(subPanel, c);
    getContentPane().add(subPanel);
    setSize(400, 500);
    setVisible(true);
    But this results in the upper left corner of my JPanel being put in the center of the container. Does anyone know how to get the center of my JPanel being placed in the center?
    The following two suggestions does not work:
    1) This solution put my panel two the right of the center:
    this.setLayout( new Flowlayout( Flowlayout.CENTER ) );
    this.add( subPanel );
    2) This does only work in the special case that the width of my panel is a third of the width of the container:
    Use GridLayout and set the grids, when you add your panel it Should size the cells equal to your largest component which would be the JPanel, then just add blank JLabels to the other cells and add your subpanel to the center cell.

    this is some sample code. It has not been compiled like this, but there should only be minor problems. if it does not work, just post a message...
    ok, here we go:
    import javax.swing.*;
    import java.awt.*;
    public class CenterLayout implements LayoutManager2 {
    // make sure that only one child is added to the container
    public void addLayoutComponent(Component comp, Object constraints) {
    if( comp.getParent().getComponentCount() > 1 )throw new RuntimeException("only one child allowed for this layout");
    // as big as you want...
    public Dimension maximumLayoutSize(Container target) {
    return new Dimension( Integer.MAX_VALUE, Integer.MAX_VALUE);
    public float getLayoutAlignmentX(Container target) {
    return .5f;
    public float getLayoutAlignmentY(Container target) {
    return .5f;
    public void invalidateLayout(Container target) {
    public void addLayoutComponent(String name, Component comp) {
    addLayoutComponent(comp, name);
    public void removeLayoutComponent(Component comp) {
    // this assumes that the preferred size is the preferred size of the single child plus insets...
    public Dimension preferredLayoutSize(Container parent) {
    Insets insets = parent.getInsets();
    int w = insets.left + insets.right;
    int h = insets.top + insets.bottom;
    if (parent.getComponentCount() > 0 ) {
    Dimension childSize = parent.getComponent(0).getPreferredSize();
    return new Dimension(childSize.width + w, childSize.height + h );
    } else {
    return new Dimension(w,h);
    // this assumes that the minimum size is only the minimum size of the single child. if you want insets
    // considered for minimum size, add them here
    public Dimension minimumLayoutSize(Container parent) {
    if (parent.getComponentCount() > 0 ) {
    return parent.getComponent(0).getMinimumSize();
    } else {
    return new Dimension(0,0);
    // this is the important stuff, calculating childs
    // position. It always sets the child to its
    // preferred size and centers it.
    // there may be better strategies handling the case
    // that the containers dimension are smaller than its
    // childs dimensions. you may peek, if the child may be
    // scaled to fit in considering the minimum size of the child.
    // once started, layoutmanager can be improved with
    // more sophisticated algorithms ever on, go and paly
    // around with it :-)
    public void layoutContainer(Container parent) {
    if( parent.getComponentCount() > 0 ){
    Component child = parent.getComponent(0);
    Insets insets = parent.getInsets();
    Dimension size = parent.getSize();
    size.width = size.width - insets.left - insets.right;
    size.height = size.height - insets.top - insets.bottom;
    // put in child scaling here, if needed
    child.setSize(child.getPreferredSize());
    int x = insets.left + (int) ( (size.width - child.getWidth() )/2);
    int y = insets.top + (int) ( (size.height - child.getHeight() )/2);
    child.setLocation(x,y);
    public static void main(String[] args ) {
    JFrame f = new JFrame();
    f.getContentPane().setLayout(new CenterLayout() );
    f.getContentPane().add( new JButton("hello") );
    f.setSize( 200, 200 );
    f.setVisible(true);
    }

  • Cant get subpanels to show

    Hi i have an application that uses subpanels within a panel. For some reason only one (the northern region panel) is showing up and i cannot figure out why. I have banged my head for hours and cant get it to work . If any one has any suggestions it would be greatly appreciated...thanks in advance!
    import  java.awt.*;
    import  java.awt.event.*;
    import  javax.swing.*;
       A GUI application with a button for which the number
       of clicks is kept track of and displayed
       @author Jared Letendre
       @version 09-18-07
    public class NicerDiceRoller extends GameDie
           creates a NicerDiceRoller frame
           @param args not used here
        public static void main(String args[])
            RollerFrame mainFrame = new RollerFrame();
            mainFrame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );   
            mainFrame.setVisible(true);
       A frame with a panel containing six labels and three buttons
    class RollerFrame extends JFrame
           constructs a RollerFrame frame instance
        public RollerFrame()
            this.setTitle("Dice Roller");
            this.setSize(this.DEFAULT_WIDTH, this.DEFAULT_HEIGHT);
            // add RollerPanel panel to frame
            RollerPanel panel = new RollerPanel();
            this.add(panel);
        // data fields
        private final static int DEFAULT_WIDTH = 400;
        private final static int DEFAULT_HEIGHT = 400;
       A panel with six labels and three buttons, that displays the value of one of three dice
       that are rolled when each button has been clicked. Keeps track of sum of all rolls
    class RollerPanel extends JPanel
           constructs a RollerPanel panel instance
        public RollerPanel()
            this.setLayout(new BorderLayout());
            // create the labels for the northern panel
            JPanel nPanel = new JPanel();
            this.add(nPanel, BorderLayout.NORTH);
            JLabel welcome = new JLabel("Nicer Dice Roller");
            JLabel myName = new JLabel("By: Jared Letendre");
            welcome.setForeground(Color.BLUE);
            nPanel.add(welcome);
            nPanel.add(myName);
            // create the label for the southern panel
            JPanel sPanel = new JPanel();
            rollValue = new JLabel();
            rollValue.setForeground(Color.BLUE);
            this.add(sPanel, BorderLayout.SOUTH);
            sPanel.add(rollValue);
            // create the spacer panels for east and west regions
            JPanel leftPanel = new JPanel();
            JLabel leftSpace = new JLabel("     ");
            this.add(leftPanel, BorderLayout.WEST);
            JPanel rightPanel = new JPanel();
            JLabel rightSpace = new JLabel("     ");
            this.add(rightPanel, BorderLayout.EAST);
            leftPanel.add(leftSpace);
            rightPanel.add(rightSpace);
            // create the labels and buttons for the center panel
            JPanel cPanel = new JPanel();
            cPanel.setLayout(new GridLayout(3, 2, 10, 5));
            this.add(cPanel, BorderLayout.CENTER);
            JButton die1 = new JButton("Roll Dice #1");
            die1.setActionCommand("firstDie");
            die1.setForeground(Color.BLUE);
            die1.setBackground(Color.RED);
            cPanel.add(die1);
            JButton die2 = new JButton("Roll Dice #2");
            die2.setActionCommand("secondDie");
            die2.setForeground(Color.BLUE);
            die2.setBackground(Color.RED);
            cPanel.add(die2);
            JButton die3 = new JButton("Roll Dice #3");
            die3.setActionCommand("thirdDie");
            die3.setForeground(Color.BLUE);
            die3.setBackground(Color.RED);
            cPanel.add(die3);
            rollSum = new JLabel();
            dice1Count = new JLabel();
            dice2Count = new JLabel();
            dice3Count = new JLabel();
            cPanel.add(dice1Count);
            cPanel.add(dice2Count);
            cPanel.add(dice3Count);
            // add labels and button to this panel
            this.add(rollSum);
            // create button action (so dice will be rolled),
            //    and associate that action with corresponding button
            RollerAction action = new RollerAction();
            die1.addActionListener(action);
            die2.addActionListener(action);
            die3.addActionListener(action);
        } // end RollerPanel constructor
           An action listener that rolls a dice based on what button is clicked
        private class RollerAction implements ActionListener
               decides which button was clicked and rolls the corresponding dice
               displays value of that roll
               accumulated the total of the three dice and displays it.
            public void actionPerformed(ActionEvent event)
                if((event.getActionCommand()).equals("firstDie"))
                     dice1.roll();
                     RollerPanel.this.rollValue.setText("Dice 1 rolled a: " + dice1.getTop());
                     temp1 = dice1.getTop();
                     RollerPanel.this.dice1Count.setText("Dice 1 rolled " + dice1.getNumRolls() + " times");
                if((event.getActionCommand()).equals("secondDie"))
                     dice2.roll();
                     RollerPanel.this.rollValue.setText("Dice 2 rolled a: " + dice2.getTop());
                     temp2 = dice2.getTop();
                     RollerPanel.this.dice2Count.setText("Dice 2 rolled " + dice2.getNumRolls() + " times");
                if((event.getActionCommand()).equals("thirdDie"))
                     dice3.roll();
                     RollerPanel.this.rollValue.setText("Dice 3 rolled a: " + dice3.getTop());
                     temp3 = dice3.getTop();
                     RollerPanel.this.dice3Count.setText("Dice 3 rolled " + dice3.getNumRolls() + " times");
                total = temp1 + temp2 + temp3;
                RollerPanel.this.rollSum.setText("Your total roll is: " + total);
        // data fields for RollerPanel
        int total = 0;
        int temp1, temp2, temp3;
        JLabel rollValue;
        JLabel rollSum;
        JLabel dice1Count;
        JLabel dice2Count;
        JLabel dice3Count;
        GameDie dice1 = new GameDie();
        GameDie dice2 = new GameDie();
        GameDie dice3 = new GameDie();
    } // end of class RollerPanelEdited by: jaredL on Oct 6, 2007 12:14 PM

    this line, near end of RollerPanel constructor is the problem
    this.add(rollSum);
    you've set RollerPanel as a BorderLayout, so by not specifying 'where' in the BorderLayout
    rollSum is to go, it defaults to CENTER, effectively knocking out cpanel (the panel with the buttons)

  • Can I play Game Center Games with other family members sharing one Apple ID

    I have several IOS devices sharing the same Apple ID that my sons and wife use. I have set up a game center account using that ID and can find no way that we can play head to head games on those multiple devices against each other using that one Apple ID login, even if I create multiple Nicknames. Am I missing something?

    An Apple ID is just an account that uses an email address and password. It does not have to be tied to iTunes. You can create one here. Create one each for your sons and wife.

  • How do i delete my credit card info from my phone. because it wont let me update or download apps because i only have 50 cents on the card

    how do i delete my credit card info from my phone. because every time i try to update or download apps it wont let me because i only have 50 cents on my card. so i need help now before i smash this ****** *** phone and go with a galaxy s5

    This does not make much sense.
    Please explain.
    Are you getting an error message?  What does it say?

  • When i login on game center it say enter your birth date when i enter it and i perss next the birth day will come again and again what should do

    when i login on game center it say enter your birth date when i enter it and i perss next the birth day will come again and again what should do

    Start a game with Game Center and go from there.

  • How can I enable the center mouse click to open and close tabs in Firefox and Chrome?

    I have a MacBook Pro Model A1261 purchased in 2009. On my other mac at work (and my PC) I can center click to open a link in a new tab while in Chrome or FireFox, and also to close a tab by clicking on it in the tabs at the top. I am using an external USB mouse on my MacBook Pro and when I click the center scroll wheel it brings up the dashboard. I looked in the settings but wasn't able to find a way to change that setting for the center button to open and close tabs in my web browser. Is there a way? Please help!

    You can restore the zoom feature by changing the values of the related prefs on the <b>about:config</b> page.
    * browser.gesture.pinch.in -> <b>cmd_fullZoomReduce</b>
    * browser.gesture.pinch.in.shift -> <b>cmd_fullZoomReset</b>
    * browser.gesture.pinch.out -> <b>cmd_fullZoomEnlarge</b>
    * browser.gesture.pinch.out.shift -> <b>cmd_fullZoomReset</b>
    * browser.gesture.pinch.latched -> <b>false</b>
    *http://kb.mozillazine.org/about:config
    See also:
    *pinchy: https://addons.mozilla.org/firefox/addon/pinchy/

  • GR/IR account not shown in profit center report

    Dear all
    I have created GR/IR accont, when there is transaction use these account the profit center is appear, but why when i run profit center line item report there is no posting from GR/IR and in S_ALR_87009722 report .there is no posting from GR/IR  new Account but the old account is appear?
    in old GR/IR account i dont thick the open item management, but ini new account i have thick open item management.
    Regards
    Adit

    Hi Aditya
    Your question is not clear...
    1. Did you assign new GR/IR account in OBYC - WRX?
    2. Which PCA you use . New GL PCA or Classical PCA?
    3. If you use Classical PCA, then GR/IR line item wont appear in PCA reports.. You need to run T codes 1KE* at period end
    Regards
    Ajay M

  • BW Analysis authorization issue on cost center range

    Hello BIW security experts
    I have a problem where I created an analysis authorization on a cost center range and it looks like the interval is not working. The report is just a list of cost centers (demo to users to prove that analysis authorizations work in order to skip 2 managerial cost centers.
    . Cost centers are numeric. Example:  2000100. In the drop down list they appear as such.
    . I want to have the following cost center range: 1000000 to 1000771, 1000773 to 2000771, 2000773 to 9999999.
    Thereofore 1000772  and 2000772 should not appear in the list.
    . In the analysis authorization I have put the 3 ranges above on 3 separate lines. 'BT' is the operator. The cost centers have been selected from the drop down list.
    Results:  I get only 1 record from the report....  2000772. (which is one I want to exclude..
    Steps tried to debug:
    . When I put a list of cost centers in the analysis authorization on separate line with the 'EQ' operator, then the report works.
    . I tried putting ' ' delimiters since cost center is a char field but it fails.
    . I tried adding leading and trailing zeros to fill up the char(10) but no luck.
    . I tried creating a hierarchy with the interval and put it in the hierachy auth. tab and it does not work either. It gives the same number of records than the first step.
    . A hierarchy with single values work.
    I do not know what else to try..
    Thanks.
    YB.

    Good morning
    Here it is from RSECVAL
    ZCC_TEST     0COSTCENTER                    I       BT        1000000                                                      1000771
    ZCC_TEST     0COSTCENTER                    I       BT        1000773                                                      2000771
    ZCC_TEST     0COSTCENTER                    I       BT        2000773                                                      9999999
    ZCC_TEST     0COSTCENTER                    I       EQ        #
    ZCC_TEST     0COSTCENTER                    I       EQ        :
    ZCC_TEST     0INFOPROV                         I       CP        *
    ZCC_TEST     0TCAACTVT                        I       EQ        03
    ZCC_TEST     0TCAIPROV                         I       CP        *
    ZCC_TEST     0TCAKYFNM                       I       CP        *
    Thank you for your help.

  • How can i display Waveform chart in a subpanel using Vi templates.

    Hi All
    I am new to Labview hence need  some help. I am trying to develop an application which reads some data from a Wireless Sensor Network (WSN). The WSN consists of base station connected to the USB port which recieves data from other sensor nodes.  The data comes in a certain format.  Node name, temperature reading, humidity reading etc. I want to read the data from the serial port and  based on the Node name, i want to display the information for each node in s separate window or subpanel etc. So if a new node is detected then a new window is created for that node. Since all the nodes have the same sensors on board i only need a one template. I can read the data using the serial port, parse the data to detect which node it is and also what the sensor readings are. I have created a template VI for the sensor node. I am having problems in displaying the template VIs in a subpanel. I can succesfully display a Waveform graph in the subpanel but i am having problems in displaying a waveform chart in the subpanel. I can see the actual waveform chart in the subpanel, but i cannot see the plot. Would be greatful if someone could point out what i am doing wrong here.
    Many Thanks
    Raza
    Solved!
    Go to Solution.
    Attachments:
    template_graph.vi ‏16 KB
    graph_template.vit ‏11 KB

    Hi All
    I think i have solved the problem. It seems like i was running the Vi in a loop. I have taken the Run Vi outside the while lopp and this works fine. Also i need to close the reference at the end.
    Raza

  • How do I add tap to tweet to my notification center on my macbook pro?

    My friend has the same MacBook Pro as me and she has the 'tap to tweet' option in her notification center while I don't. How do I add it?

    Welcome to Apple Support Communities
    Open System Preferences > Mail, Contacts and Calendars, press the + button and add the Twitter account. Then, Tap to Tweet will appear on the Notification Center. This only works with Mountain Lion and later

  • How can I replace an older save file with a new one on game center?

    Greetings,
    I have been trying to change an older game saved file that I have created with my old Ipad with the new one that I have created on my new Ipad, both game files are played under my apple ID but I have no idea how to replace my older one with the new one.
    The new file is superior to the old one so I wish to add the new saved file to my game center.
    The game I am playing is Clash of Clans both file are created on apple products.
    Let me know if there is a sulotion for that case.
    Regards

    Make sure the site folder created by iWeb is named exactly the same as the site folder currently on the server.
    OT

  • How can I transfer my old dragonvale island into my new game center account?

    I restored my ipod, but now I had to make a new game center account. Since Dragonvale used my old GC account, it forgot my island and generated a new one. I dont wanna have to start over again. Help me! (dont say to start over)

    You said you restored your iPod. Did you restore from backup? If yu did then yur game progress and Game Center stuff should have beeb restored.

  • Game Center Multiple Users

    I have 2 iPads and 2 iPhones.  They are all under under the same Apple ID but are used by different people in my household.  I signed into Game Center on the first device and created a user profile.  When is launch Game Center on the second device, it signs in using the the same profile I created on the first device and I don't see an option to add another profile (which was possible before iOS7).  Did they change that?  Is it possible to add multiple Game Center profiles under the same Apple ID?  If so how?
    I want to be able to create multile profiles so my family members can play each other.
    Thanks.

    You can't. Game Center is a system of leaderboards and achievements, not a data storage service.

  • How do I create a new Work Center for the transaction launcher and links

    Hi
    The requirement here is for me to find out if I can create a new Work Center that will contain up to 6 assignment blocks and each block having either links to websites and BW reports, or triggers to R/3 applications via the transaction launcher.
    Can I do this purely through customising or do I need to create a new view using BSPs? If I can do it through customising please could I have a few pointers to what component I would need to use/copy?
    Regards
    Declan

    Hi Robert,
    Thanks again for taking the time to reply.
    Just so I understand, if I want to show a work center I need to link it to a component / view? I think this was the original query - do I need a developer to create the view that contains the 6 blocks with their links to reports, transactions and websites? I think when I talk about blocks I mean 1 viewset containing 6 views. There is no SAP standard view that would suit my requirements is there? Even if the work center had 8 views, I can always hide the two views in configuration.
    After the developer has created the view, I then reference that component in the target Id in the define logical links section of my work center.
    If my understanding is right, then it follows that it is not possible to create a user specific work center without some development.
    Is this correct?
    Cheers
    Declan

Maybe you are looking for