Layout of components

Hi!
Yesterday I posted an entry about organizing Swing components and adding margins. See: http://forum.java.sun.com/thread.jspa?threadID=699029&messageID=4057473#4057473. I am quite new to these things, so the anwers I got didn't really help me much. Does anyone around here have any ideas?
/P

Here is the code:
* LunarPhases.java is a 1.4 example that requires
* the following files:
*    Angry: Ekman/0.jpg
*    Disgust: Ekman/1.jpg
*    Fear: Ekman/2.jpg
*    Happy: Ekman/3.jpg
*    Sad: Ekman/4.jpg
*    Surprise: Ekman/5.jpg
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.net.URL;
import javax.swing.filechooser.*;
import java.io.*;
public class MonkeyControl implements ActionListener {
    final static int NUM_IMAGES = 6;
    final static int START_INDEX = 3;
    int fileindex = 0;
    //String[] imagefiles = new String[NUM_IMAGES];
    ImageIcon[] images = new ImageIcon[NUM_IMAGES];
    JPanel mainPanel, selectPanel, displayPanel, audioPanel, buttonPanel;
    //JComboBox behaviourChoices = null;
    JFileChooser behaviourChooser = null;
    JButton chooseBehaviourButton = null;
    //JLabel behaviourLabel = null;
    JTextArea behaviourArea= null;
    JLabel behaviourIconLabel = null;
    //JComboBox audioChoices = null;
    JButton submitButton = null;
    JButton stopButton = null;
    JFileChooser audioChooser = null;
    JButton chooseAudioButton = null;
    JLabel audioLabel = null;
    MonkeyClient client = null;
    GridBagConstraints gbc;
    GridBagConstraints gbct;
    public MonkeyControl() {
         //Create MonkeyClient   
         client = new MonkeyClient();
        //Create the phase selection and display panels.
        selectPanel = new JPanel();
        displayPanel = new JPanel();
        audioPanel = new JPanel();
        buttonPanel = new JPanel();
        gbc = new GridBagConstraints();
        gbct = new GridBagConstraints();
        //Add various widgets to the sub panels.
        addWidgets();
        //Create the main panel to contain the two sub panels.
        mainPanel = new JPanel();
        mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.PAGE_AXIS));
        mainPanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
        //Add the select and display panels to the main panel.
        mainPanel.add(selectPanel);
        mainPanel.add(displayPanel);
        mainPanel.add(audioPanel);
        mainPanel.add(buttonPanel);
        audioPanel.setLayout(new BoxLayout(audioPanel, BoxLayout.Y_AXIS));
        //selectPanel.setLayout(new BoxLayout(selectPanel, BoxLayout.Y_AXIS));
        selectPanel.setLayout(new GridBagLayout());
        buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.X_AXIS));
     * Get the images and set up the widgets.
    private void addWidgets() {
        //Get the images and put them into an array of ImageIcons.
        for (int i = 0; i < NUM_IMAGES; i++) {
            images[i] = createImageIcon("/Ekman/" + i + ".jpg");
         * Create a label for displaying the behaviour images and
         * put a border around it.
        behaviourIconLabel = new JLabel();
        behaviourIconLabel.setHorizontalAlignment(JLabel.CENTER);
        behaviourIconLabel.setVerticalAlignment(JLabel.CENTER);
        behaviourIconLabel.setVerticalTextPosition(JLabel.CENTER);
        behaviourIconLabel.setHorizontalTextPosition(JLabel.CENTER);
        behaviourIconLabel.setBorder(BorderFactory.createCompoundBorder(
            BorderFactory.createLoweredBevelBorder(),
            BorderFactory.createEmptyBorder(5,5,5,5)));
        behaviourIconLabel.setBorder(BorderFactory.createCompoundBorder(
            BorderFactory.createEmptyBorder(0,0,10,0),
            behaviourIconLabel.getBorder()));
        //Create a combo box with behaviour choices.
        /*String[] behaviours = { "Anger", "Disgust", "Fear",
                            "Happiness", "Sadness", "Surprise"};
        behaviourChoices = new JComboBox(behaviours);
        behaviourChoices.setSelectedIndex(START_INDEX);*/
        behaviourChooser = new JFileChooser("C:/Documents and Settings/paulina/My Documents/Animatronics on Rachel's Computer (18.85.44.141)/monkey_control/movements");
        chooseBehaviourButton = new JButton("Select behaviour file");
        chooseBehaviourButton.setActionCommand("choose behaviour");
        chooseBehaviourButton.setVerticalAlignment(JButton.CENTER);
        chooseBehaviourButton.setHorizontalAlignment(JButton.CENTER);
        gbc.insets = new Insets(10,10,10,10);  //padding
        gbc.anchor = GridBagConstraints.WEST;
        //behaviourLabel = new JLabel("    Behaviour file");
        behaviourArea = new JTextArea();
        behaviourArea.setEditable(true);
        gbct.insets = new Insets(10,10,10,10);  //padding
        gbct.anchor = GridBagConstraints.EAST;
        //Create a combo box with audio files.
        /*String[] soundclip = { "Ding", "Disgust", "Fear",
                            "Happiness", "Sadness"};
        audioChoices = new JComboBox(soundclip);
        behaviourChoices.setSelectedIndex(START_INDEX);*/
        //Create a file chooser for audio clips
        audioChooser = new JFileChooser("C:/Documents and Settings/paulina/My Documents/Animatronics on Rachel's Computer (18.85.44.141)/monkey_control/sounds");
        chooseAudioButton = new JButton("Select audio file");
        chooseAudioButton.setActionCommand("choose audio");
        //Create label for displaying chosen file
        audioLabel = new JLabel("    Audio file");
        //FileFilter filter = new FileFilter();
        //filter.addExtension("wav");
        //filter.setDescription("Wav audio files");
        //audioChooser.setFileFilter(filter);
        //Create a button for sending the data.
        submitButton = new JButton("Send");
        submitButton.setActionCommand("submit");
        //Create a button for stopping.
        stopButton = new JButton("Stop");
        stopButton.setActionCommand("stop");
        //Display the first image.
        behaviourIconLabel.setIcon(images[START_INDEX]);
        behaviourIconLabel.setText("");
        //Add a border around the select panel.
        selectPanel.setBorder(BorderFactory.createCompoundBorder(
            BorderFactory.createTitledBorder("Select Behaviour"),
            BorderFactory.createEmptyBorder(5,5,5,5)));
        //Add a border around the display panel.
        displayPanel.setBorder(BorderFactory.createCompoundBorder(
            BorderFactory.createTitledBorder("Display Behaviour"),
            BorderFactory.createEmptyBorder(5,5,5,5)));
        //Add a border around the display panel.
        audioPanel.setBorder(BorderFactory.createCompoundBorder(
            BorderFactory.createTitledBorder("Choose Audio Clip"),
            BorderFactory.createEmptyBorder(5,5,5,5)));
//      //Add space around the components.
        behaviourArea.setBorder(BorderFactory.createEmptyBorder(10,5,10,5));
        chooseBehaviourButton.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
        behaviourArea.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
        //Add Swing components
        displayPanel.add(behaviourIconLabel);
        selectPanel.add(chooseBehaviourButton, gbc);
        selectPanel.add(behaviourArea, gbct);
        audioPanel.add(chooseAudioButton);
        audioPanel.add(audioLabel);
        buttonPanel.add(submitButton);
        buttonPanel.add(stopButton);
        //Listen to events from ComboBox and submitButton.
        //behaviourChoices.addActionListener(this);
        submitButton.addActionListener(this);
        stopButton.addActionListener(this);
        chooseAudioButton.addActionListener(this);
        chooseBehaviourButton.addActionListener(this);
        //audioChoices.addActionListener(this);
    public void actionPerformed(ActionEvent event) {
         String behaviour = null;
         //not used
         if ("comboBoxChanged".equals(event.getActionCommand())) {
            //Update the icon to display the new phase.
         //behaviourIconLabel.setIcon(images[behaviourChoices.getSelectedIndex()]);*/
        else if ("choose audio".equals(event.getActionCommand())) {
             int returnVal = audioChooser.showOpenDialog(chooseAudioButton);
            if(returnVal == JFileChooser.APPROVE_OPTION) {
                 audioLabel.setText("    " + audioChooser.getSelectedFile().getName());
        else if ("choose behaviour".equals(event.getActionCommand())) {
             System.out.println("Behaviour: " + (behaviourArea.getText()).trim());
             int returnVal = behaviourChooser.showOpenDialog(chooseBehaviourButton);
            if(returnVal == JFileChooser.APPROVE_OPTION) {
                 behaviour = (behaviourChooser.getSelectedFile().getName());
                 setBehaviourImage(behaviour);
                 behaviourArea.append(behaviour + ";");
        else if("submit".equals(event.getActionCommand())) {
             behaviour = (behaviourArea.getText().trim());
             //syntax: behaviour, audiofile
             try {
                  if (behaviour.endsWith(";")){
                       behaviour = behaviour.substring(0,(behaviour.length()-1));
                       System.out.println("Behaviour: " + behaviour);
                    client.sendData(behaviour, audioLabel.getText().trim());
               } catch (IOException e) {
                    System.err.println(e);
                    //e.printStackTrace()
     else if("stop".equals(event.getActionCommand())){
             try {
             client.sendData("stop", "stop");
             }catch(IOException e){
                  System.err.println(e);
    /** Returns an ImageIcon, or null if the path was invalid. */
    protected static ImageIcon createImageIcon(String path) {
        java.net.URL imageURL = MonkeyControl.class.getResource(path);
        if (imageURL == null) {
            System.err.println("Resource not found: "
                               + path);
            return null;
        } else {
            return new ImageIcon(imageURL);
     * 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 a new instance of MonkeyControl.
        MonkeyControl phases = new MonkeyControl();
        //Create and set up the window.
        JFrame MonkeyControlFrame = new JFrame("Monkey Control");
        MonkeyControlFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        MonkeyControlFrame.setContentPane(phases.mainPanel);
        //Display the window.
        MonkeyControlFrame.pack();
        MonkeyControlFrame.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();
    public void setBehaviourImage(String behaviour) {
         int index = 0;
         //String behaviour = (behaviourArea.getText()).trim();
         System.out.println("beh: " + behaviour);
         if(behaviour.equals(("monkey_angry.txt")))
              index =0;
         else if(behaviour.equals(("monkey_disgusted.txt")))
              index = 1;
         else if(behaviour.equals(("monkey_fearful.txt")))
              index=2;
         else if(behaviour.equals(("monkey_happy.txt")))
              index=3;
         else if(behaviour.equals(("monkey_sad.txt")))
              index=4;
         else if(behaviour.equals(("monkey_surprised.txt")))
              index=5;
         else
              index=5;
         System.out.println("index: " + index);
         behaviourIconLabel.setIcon(images[index]);
}

Similar Messages

  • How to use a table to layout af components?

    i've been trying to figure out how to use a regular table
    to layout some components that are not databound ..
    I couldn't figure out how to use simple html
    Ie: the verbatim tag didn't like having unclosed tags...
    so i couldn't compile
    <f:verbatim>
    <table><tr><td>
    </f:verbatim>
    then my af controls
    i tried using a <af:table value="{1,2}">
    so it could render a row...
    but there is no <TR> equivalent... and it shows the column headings..
    and the presence of the table is too obvious (scroll bar .etc. and have
    to do a ton of css classes to make headers disappear..etc)
    anyway to nicely layout controls?

    Try the h:panelGrid component.
    http://www.jsftoolbox.com/documentation/help/12-TagReference/html/h_panelGrid.html

  • Re: not happy with layout of components

    I have written the front end of a banking application.
    The problem is I am not happy with how the components are positioned.
    Any suggestion?
    I am using gridlayout(7,2)
    6 rows are made up of mainly labels and textfield.
    One row is a panel, which has other components.
    The problem is there is a large gap between the labels and the next component.
    Here is the code:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class BankUI extends JFrame {
    JLabel jlabel1, jlabel2, jlabel3, jlabel4, jlabel5, jlabel6,
    jlabel7, jlabel8, jlabel9, jlabel10;
    JCheckBox jcheckbox1, jcheckbox2;
    JTextField jtextfield1, jtextfield2, jtextfield3, jtextfield4;
    private JComboBox jcombobox1, jcombobox2, jcombobox3;
    private String days[] = { "1","2","3","4","5","6","7","8","9",
    "10","11","12","13","14","15","16","17",
    "18","19","20","21","22","23","24",
    "25","26","27","28","29","30","31"};
    private String month[] = { "January", "February", "March", "April",
    "May", "June", "July", "August", "September",
    "October", "November", "December"};
    private String year[] = { "1970", "1971","1972","1973","1974","1975","1976",
    "1977","1978","1979",
    "1980", "1981","1982","1983","1984","1985","1986",
    "1987","1988","1989",
    "1990", "1991","1992","1993","1994","1995","1996",
    "1997","1998","1999",
    "2000", "2001", "2002", "2003"};
    private JPanel jpanel;
    private Container c;
    private GridLayout gridlayout;
    public BankUI()
    super( "Scruple Bank");
    gridlayout = new GridLayout(7,2);
    c = getContentPane();
    c.setLayout(gridlayout);
    jlabel1 = new JLabel("Surname:");
    jtextfield1 = new JTextField(20);
    c.add(jlabel1);
    c.add(jtextfield1);
    jlabel2 = new JLabel("First name:");
    jtextfield2 = new JTextField(20);
    c.add(jlabel2);
    c.add(jtextfield2);
    jlabel3 = new JLabel("Address:");
    jtextfield3 = new JTextField(20);
    c.add(jlabel3);
    c.add(jtextfield3);
    jlabel4 = new JLabel();
    jtextfield4 = new JTextField(20);
    c.add(jlabel4);
    c.add(jtextfield4);
    jlabel5 = new JLabel("Date of birth:");
    c.add(jlabel5);
    jpanel = new JPanel();
    c.add(jpanel);
    jlabel6 = new JLabel("Day");
    jcombobox1 = new JComboBox(days);
    jcombobox1.setMaximumRowCount(3);
    jpanel.add(jlabel6);
    jpanel.add(jcombobox1);
    jlabel7 = new JLabel("Month");
    jcombobox2 = new JComboBox(month);
    jcombobox2.setMaximumRowCount(3);
    jpanel.add(jlabel7);
    jpanel.add(jcombobox2);
    jlabel8 = new JLabel("Month");
    jcombobox3 = new JComboBox(year);
    jcombobox3.setMaximumRowCount(3);
    jpanel.add(jlabel8);
    jpanel.add(jcombobox3);
    jlabel9 = new JLabel();
    jcheckbox1 = new JCheckBox("Payment Protection");
    c.add(jlabel9);
    c.add(jcheckbox1);
    jlabel10 = new JLabel();
    jcheckbox2 = new JCheckBox("Card Protection");
    c.add(jlabel10);
    c.add(jcheckbox2);
    setSize(750,300);
    show();
    public static void main(String args[])
    BankUI app = new BankUI();
    app.addWindowListener(
    new WindowAdapter() {
    public void windowClosing(WindowEvent e)
    System.exit(0);

    I have an open source layout called AttachLayout that a member of this forum gave to me awhile back. It greatly assisted me and you can check it out here:
    http://www.compaq.com/java/download/attachlayout/
    It's easy and intuitive.
    Let me know if you need more assistance or have difficulty getting the classes.

  • SAP BO Dashboards 4.1 best practice on layout and components

    Dear SCN,
    I have requirement to create a BO 4.1 dashboard with data & Visualization based on a excel sheet which is currently in use as a Mgmt dashboard. The current excel dashboard is having more than 100 KPIs in one view which is readable only if you put in on a slide and view it in full screen by running a slideshow.
    Question 1:
    1. Being the suggested size of the Xcelsius canvas not more than 1024 X 768 so that it is viewable with out scroll bar in BI launchpad or in any browser or in pdf, I am trying to confirm in this forum that the canvas size of 1024 X 768 is the recommended maximum size for the dashboard to get the clear view in any browser/BI launchpad . Pls confirm as it will help me in doing the design for the KPIs and its visualization.
    Question 2:
    1. I am using the BICS connection and accessing the source data from BW. Because the no. of KPIs are more and ranging between 10 cubes and 40 queries as the data is across different modules, I would like to know what is the recommended no. of connections for queries /cubes in dashboard using BICS connectivity which does not affect the performance
    2. For the same dashboard using BICS connection, What is ideal number of components like Charts/Scorecard/Spreadsheet table that is recommended to use to ensure better performance?
    I appreciate your answers which can help the finalization of the dashboard design for this dashboard of data and visualization requirements which is very high when compared to the normal dashboards.
    Thanks and Regards
    Jana

    Hi Suman,
    Thanks for your answers.You answers and links which you have attached are helpful and It answered my questions related to canvas size and Connections.
    I am expecting some benchmark numbers as per the best practices with respect to the No. of components to be used to ensure the better loading of the dashboard. As the increase in number of components increase the size of the dashboard and also it requires more time to load the data for the components, I am looking for the number as per the best practice by considering the below points.
    1. When I say the no. of components, I am not considering the components like label, text box,combo box or list box. I am considering the components which is used for visualization and interactive drill down on top of the visualized charts ( For Eg. Column charts, Pie charts, Gauges ).
    2.I am not going to use more calculations/formulas in my dashboards as the values and structure are almost the same with the BEx query.
    3.Having around 10 to 12 connections.
    4.The data sets are not more than 900 rows totally. For any control, we will be binding only 100 rows at the max as the data for the KPIs are summarized at the year/month level at the BW layer.
    Since the KPIs are more, the Visualizations are more and we can't re-use the Visualization charts for most of the KPIs. Currently I am ending up with ~35 charts/ gauges along with other label and selection controls which I will be using to show 100 KPIs with unique visualization requirements and I am going for the tab-wise layout with more dynamic to accommodate and separate logically.
    Hope these details will give clear picture of why I am looking for the Benchmark on No. of components .
    I appreciate your help!
    Thanks and Regards
    Jana

  • Translate report layouts (Shared Components)

    Hi,
    I create in my application PDF using shared components (Report Queries and Report Layouts) and the BI Publisher. The queries I have deposited in Report Qieries and templates in report layouts. The call is done via the URL (which appears in the report query). Now I have translated my application and see that the titles of my templates are not visible with the xlife file. How can I translate the report layout from the Shared Components.
    Thank you in advance for your support.
    Ines

    Sruthi Tamiri wrote:
    1. Apex version#3.2
    Out of date and unsupported...please consider upgrading.
    2. IE# 6+
    Are you really still trying to support IE6?
    When i clik on that specfic tab which is time causing, in that screen contains
    1. Popup screens
    2. Text items
    3. List items
    We have tried to this option from toad to check which Query is cauisng the problem, but nothing query is running in back end to tarce what could be exact problem
    In toad#9.2 version we have option as Database->Monitor>Session Browser [where we can see which query is running under specfic session]
    To establish exactly where time is being spent, use Debug mode to identify APEX or database issues, and timeline/profiling developer tools in the browser to check for network or JavaScript problems.
    What web server are you using? If you're using EPG check the SHARED_SERVERS configuration.

  • Fixed Layout of Components

    I am creating a platform-independent application that is composed of 7 JPanels and 1 Panel. I need to put all these (J)Panel classes into one Jpanel. My problem is the individual panels are of different sizes. I have tried using GridBoxLayout but cannot let all of the components show. Most of the components are only drawn in reaction to events brought forth by the other components. This means that, initially, the rest of the components are empty. Please help cause i'm kinda desperate. How do I give these components "fixed" sizes. They all tend to shrink when they're empty.
    Appreciate your help. - Noel

    Can use absolute positioning to set things by pixel.
    make it not resizable.
    setResizable(false);
    place frame on screen also using pixels
    setBounds(100,100,500,400);
    will work better on all platforms if you set default things
    like font size and type.
    turn off layout manager
    setLayout(null);
    then use setBounds statements
    Examples:
    panel.setBounds(getInsets().left+230 ,getInsets().top+12,248,65);
    or like:
    panel.setBounds(new Rectangle(10,20,30,40));
    10 = x
    20 = y
    30 = width
    40 = heigth
    I'm sure there are lots more methods to use check out
    API docs on setBounds
    You may also be able to use GridBagLayout
    has x and y weight statements

  • Layouts using components

    This is more of a methodology question. I am trying to decide
    to what granularity to I break my application up into individual
    components. Currently I have two states (state1, state2). The first
    state has one vBox with 3 buttons in it. Eventually state1 will
    have more vBoxes with subforms in each. I currently plan on having
    each vBox be a separate component. Simple enough.
    The second state (state2) has a lineChart, an
    ApplicationControlBar (with and hSlider and a couple of buttons), a
    label, and a subform (with a comboBox, radioGroup, and a submit
    button). I am trying to decide whether the whole state (state2)
    should be one component, or should I break this into several
    components (an ApplicationControlBar component, a lineChart
    component, and a subform component)?
    If I break it into several components then do I call each as
    a child when state2 loads or is it better to create a single
    wrapper [parent] component (such as a vBox) and then load the other
    [child] components into it, then load the parent component from the
    state?
    I am just trying to figure out how much to break up my layout
    Thanks for the suggestions.

    "ntsiii" <[email protected]> wrote in message
    news:ghkl1f$knj$[email protected]..
    > First, I am with Amy in the Viewstack vs States in this
    case. It is a
    > matter
    > of taste, but you will find Viewstack much easire to
    code than States,
    > with
    > fewer problems to deal with, especially for
    significantly different views,
    > I
    > use states to switch between a List and a TextInput, but
    Viewstacl for
    > more
    > complex views.
    >
    > Now, there is not one best answer to your question. The
    first obvious
    > level
    > is to make a component for each child view in the
    viewstack. That is also
    > the
    > most important break.
    >
    > If, within one of those views, there are groups of
    components that you
    > use in
    > many places, break them out into a custom component.
    (reuse)
    >
    > Or, if there is some logical functionality that occurs
    withing an area of
    > code, break it out.(encapsulation)
    >
    > Play this by ear. If you find yourself scrolling through
    page after page
    > of
    > functions, trying to find something, that might be a
    sign that refactoring
    > is
    > needed. If working with your code is comfortable, then
    leave it. (common
    > sense)
    I've found this to be helpful for locating code when it gets
    over 150 lines
    or so:
    http://flexdiary.blogspot.com/2008/12/why-i-love-development-perspective.html

  • Align Components how a panel Form Layout

    hi,
    I have the panel form layout with components, fine perfect, but...
    when I want to put a LOV such an output the text
    the center together the alignment of the components is lost i have the picture :)
    http://img100.imageshack.us/img100/7164/perfectoif.png
    but i want put the output text join component , example:
    http://img525.imageshack.us/img525/4543/asiquiero.png
    the logic solution, i group component with panel group layout but the form i see:
    http://img97.imageshack.us/img97/1096/erroryd.png
    Any idea?? i use jdev 11.1.1.2
    Joaquin
    Edited by: ADFboy on 03-may-2010 10:54
    Edited by: ADFboy on 03-may-2010 11:43

                  <af:panelFormLayout id="pfl1" labelAlignment="start"
                                      maxColumns="2" rows="1">
                    <af:panelGroupLayout id="pgl2" layout="horizontal"
                                         valign="bottom" halign="start"
                                         inlineStyle="text-align:left;">
                      <af:inputListOfValues label="ghdghd ghdghdf"
                                            popupTitle="Search and Result Dialog"
                                            id="ilov2"/>
                      <af:outputText value="outputText2" id="ot2"/>
                    </af:panelGroupLayout>
                    <af:inputListOfValues label="Label 1 fgs d"
                                          popupTitle="Search and Result Dialog"
                                          id="ilov1"/>
                    <af:inputListOfValues label="Label 2"
                                          popupTitle="Search and Result Dialog"
                                          id="ilov4"/>
                    <af:panelGroupLayout id="pgl1" layout="horizontal">
                      <af:inputListOfValues label="dghd ghdhd"
                                            popupTitle="Search and Result Dialog"
                                            id="ilov3"/>
                      <af:outputText value="outputText3" id="ot1"/>
                    </af:panelGroupLayout>
                    <af:inputListOfValues label="Label 3"
                                          popupTitle="Search and Result Dialog"
                                          id="ilov5"/>
                    <af:inputListOfValues label="Label 4"
                                          popupTitle="Search and Result Dialog"
                                          id="ilov6"/>
                    <af:inputListOfValues label="Label 5"
                                          popupTitle="Search and Result Dialog"
                                          id="ilov7"/>
                    <af:inputListOfValues label="Label 6"
                                          popupTitle="Search and Result Dialog"
                                          id="ilov8"/>
                  </af:panelFormLayout>

  • FAQ: How can I make my Flash Catalyst application scale/use a liquid layout?

    Flash Catalyst CS5 currently only supports applications with fixed dimensions. Custom components you create in Catalyst have absolute sizing.
    If you want to experiment with creating resizable applications (liquid layouts) and components in a preview of the next version of Flash Catalyst, codenamed "Panini",  you can find more information here:
    Introducing Adobe Flash Catalyst "Panini"
    Download Adobe Flash Catalyst "Panini"
    Adobe Flash Catalyst "Panini" help
    Keep in mind that Flash Catalyst "Panini" preview is meant for exploration and testing, not real production. If you are doing real production work, here are some options that work with Flash Catalyst CS5 and Flash Builder:
    Liquid Layouts
    If you are building an application that requires relative constraints, you can take the FXP file from Flash Catalyst into Flash Builder, and apply constraints there so that your components resize according to your application dimensions.
    For more info, see this Help topic:
    Using constraint-based layouts in Flash Builder
    SWF Scaling
    If you want your swf to scale, without relative constraints, there's a simple way to make that work in Builder as well. Simply save out your FXP file from Flash Catalyst and import it into Flash Builder. Open up the "Main.mxml" file. Remove the width and height attributes on the Application tag, and add the attribute:
    preinitialize="systemManager.stage.scaleMode='showAll'
    The entire Application tag should look something like:
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                      xmlns:s="library://ns.adobe.com/flex/spark"
                      xmlns:d="http://ns.adobe.com/fxg/2008/dt"
                      xmlns:fc="http://ns.adobe.com/flashcatalyst/2009"
                      xmlns:ATE="http://ns.adobe.com/ate/2009"
                      xmlns:ai="http://ns.adobe.com/ai/2009"
                      xmlns:flm="http://ns.adobe.com/flame/2008"
                      xmlns:lib="assets.graphics.*"
                      xmlns:components="components.*"
                      backgroundColor="#FFFFFF"
                      preloaderChromeColor="#FFFFFF"
                      preinitialize="systemManager.stage.scaleMode='showAll'"
                      >
    There are a couple other scale modes you may want to try, such as "exactFit", which are outlined at the below link:
    Flash Stage Scale Modes
    Finally, you will have to adjust the object embed code in your html page to set the size of your swf.
    Original discussion here

    you can`t. allow your application internet access without the network admin defining an exception for it specifically.
    If you have admin rights use the router`s/proxy`y configuration software to allow an exception.

  • How to create a floating layout using adf

    Hi ,
    I am using Jdeveloper 11g to develop an application.
    I am coming across problems when i am trying to build the look and feel.
    Basically i want to develop as per the following link.
    http://webfusion.kcmo.org/coldfusionapps/ActionCenterRequest/getstatus.cfm
    I have been able to create the layout using adf layouts and components(af:panelStechlayout, af:panelgrouplayout), but the problem i am facing is that i want the entire page to scroll and have a floating layout.
    But in my case, the panels are scrolling, so when i resize the browser or change the resolution, everything appears to be broken in parts.
    Besides to recreate the above layout i have to include everything under the "center" facet, hence using templates is creating issues.
    following is the code i am using(just the structure code), this looks preety simple but i am not able to figure this one out.
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
      <jsp:directive.page contentType="text/html;charset=UTF-8"/>
      <f:view>
        <af:document title="findcase" id="d1">
          <af:form id="f1">
            <af:panelStretchLayout startWidth="100px" endWidth="100px" id="psl2">
              <f:facet name="center">
                <af:panelStretchLayout endWidth="63px" id="psl1"  topHeight="120px" bottomHeight="50px"
                inlineStyle="font: 100% Arial, Helvetica, sans-serif;background: #2A3644;font-size: 13px;margin: 0;padding: 0;text-align: center;color: #000000;"
                                       startWidth="44px">
                  <f:facet name="center">
                   <!-- Header -->
                   <af:panelGroupLayout layout="scroll"
                                         xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
                                         id="pgl3">
                      <af:image source="http://cfdev.kcmo.org/coldfusionapps/templates/images/kcmo_banner.jpg"
                                shortDesc="header" id="i1"
                                inlineStyle="width:960px; height:77.0px;"/>
                      <af:panelGroupLayout id="pgl2" inlineStyle="height:33.0px;">
                        <af:image source="http://webfusion.kcmo.org/coldfusionapps/templates/images/home.jpg"
                                  shortDesc="menu1" id="i2"/>
                        <af:image source="http://webfusion.kcmo.org/coldfusionapps/templates/images/services.jpg"
                                  shortDesc="menu2" id="i3"/>
                        <af:image source="http://webfusion.kcmo.org/coldfusionapps/templates/images/residents.jpg"
                                  shortDesc="menu3" id="i4"/>
                        <af:image source="http://webfusion.kcmo.org/coldfusionapps/templates/images/business.jpg"
                                  shortDesc="menu4" id="i5"/>
                        <af:image source="http://webfusion.kcmo.org/coldfusionapps/templates/images/visitors2.jpg"
                                  shortDesc="menu5" id="i6"/>
                        <af:image source="http://webfusion.kcmo.org/coldfusionapps/templates/images/officials2.jpg"
                                  shortDesc="menu6" id="i7"/>
                        <!--af:panelGroupLayout id="pgl4"-->
                          <af:image source="http://webfusion.kcmo.org/coldfusionapps/templates/images/kcmo_banner_slice.jpg"
                                    shortDesc="searcharea" id="i8"
                                    inlineStyle="background-repeat:repeat; width:355px; height:35.0px;"/>
                        <!--/af:panelGroupLayout-->
                        <af:image source="http://webfusion.kcmo.org/coldfusionapps/templates/images/kcmo_banner_lower.jpg"
                                  shortDesc="banner" id="i9"
                                  inlineStyle="width:960px; height:7.0px;"/>
                      </af:panelGroupLayout>
                     <!-- starting the center section -->
                      <af:panelStretchLayout id="psl3" inlineStyle="width:960px; margin:auto; background-color:White;"
                                             startWidth="232px">
                        <f:facet name="center">
                         <!-- your page content goes here -->
                          <af:outputText value="outputText1" id="ot3"/>
                        </f:facet>
                       <!-- side navigation panel -->
                        <f:facet name="start">
                          <af:panelGroupLayout id="pgl1" inlineStyle="float:left; margin:5px; width:236.0px;background-color:#edf0f5;text-align: center;">
                           <af:goLink text="City Government" id="gl1"
                                   destination="http://www.kcmo.org/CKCMO/Depts/CityManagersOffice/InternshipsandfellowshipswiththeCity/KansasCityGovernment/index.htm"
                                   inlineStyle="font-family:Arial, Helvetica, sans-serif; font-size:10px;     color:#395F76;     font-weight:bold;"/>
                          <br/>
                            <af:goLink text="Codes and Ordinances" id="gl2"
                                       destination="http://cityclerk.kcmo.org/liveweb/common/"
                                       targetFrame="_blank"/>
                          </af:panelGroupLayout>
                        </f:facet>
                        <f:facet name="end"/>
                      </af:panelStretchLayout>
                    </af:panelGroupLayout>
                  </f:facet>
                  <f:facet name="end">
                    <af:outputText value="" id="ot2"/>
                  </f:facet>
                   <f:facet name="start">
                <af:outputText value="" id="ot1"/>
              </f:facet>
                </af:panelStretchLayout>
              </f:facet>
            </af:panelStretchLayout>
          </af:form>
        </af:document>
      </f:view>
    </jsp:root>Any help will be highly appreciated.
    Thanks in advance
    Ash

    Try creating a layout that uses a panelGroup scroll as the top container and use panelBorders inside it.
    Something like this:
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
      <jsp:directive.page contentType="text/html;charset=windows-1252"/>
      <f:view>
        <af:document id="d1">
          <af:form id="f1">
            <af:panelGroupLayout layout="scroll" id="pgl1">
              <af:panelBorderLayout id="pbl1">
                <f:facet name="start"/>
                <f:facet name="bottom"/>
                <f:facet name="end"/>
                <f:facet name="top">
                  <af:panelGroupLayout layout="scroll"
                                       xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
                                       id="pgl3">
                    <af:image source="http://cfdev.kcmo.org/coldfusionapps/templates/images/kcmo_banner.jpg"
                              shortDesc="header" id="i1"
                              inlineStyle="width:960px; height:77.0px;"/>
                    <af:panelGroupLayout id="pgl2" inlineStyle="height:33.0px;">
                      <af:image source="http://webfusion.kcmo.org/coldfusionapps/templates/images/home.jpg"
                                shortDesc="menu1" id="i2"/>
                      <af:image source="http://webfusion.kcmo.org/coldfusionapps/templates/images/services.jpg"
                                shortDesc="menu2" id="i3"/>
                      <af:image source="http://webfusion.kcmo.org/coldfusionapps/templates/images/residents.jpg"
                                shortDesc="menu3" id="i4"/>
                      <af:image source="http://webfusion.kcmo.org/coldfusionapps/templates/images/business.jpg"
                                shortDesc="menu4" id="i5"/>
                      <af:image source="http://webfusion.kcmo.org/coldfusionapps/templates/images/visitors2.jpg"
                                shortDesc="menu5" id="i6"/>
                      <af:image source="http://webfusion.kcmo.org/coldfusionapps/templates/images/officials2.jpg"
                                shortDesc="menu6" id="i7"/>
                      <!--af:panelGroupLayout id="pgl4"-->
                      <af:image source="http://webfusion.kcmo.org/coldfusionapps/templates/images/kcmo_banner_slice.jpg"
                                shortDesc="searcharea" id="i8"
                                inlineStyle="background-repeat:repeat; width:355px; height:35.0px;"/>
                      <!--/af:panelGroupLayout-->
                      <af:image source="http://webfusion.kcmo.org/coldfusionapps/templates/images/kcmo_banner_lower.jpg"
                                shortDesc="banner" id="i9"
                                inlineStyle="width:960px; height:7.0px;"/>
                    </af:panelGroupLayout>
                  </af:panelGroupLayout>
                </f:facet>
                <af:panelBorderLayout id="pbl2">
                  <f:facet name="start">
                    <af:panelGroupLayout id="pgl4" layout="scroll">
                      <af:commandLink text="menu1" id="cl1"/>
                      <af:commandLink text="menu2" id="cl2"/>
                    </af:panelGroupLayout>
                  </f:facet>
                  <f:facet name="bottom"/>
                  <f:facet name="end"/>
                  <f:facet name="top"/>
                  <af:panelFormLayout id="pfl1">
                    <f:facet name="footer"/>
                    <af:inputText label="Label 2" id="it2"/>
                    <af:inputText label="Label 1" id="it1"/>
                  </af:panelFormLayout>
                </af:panelBorderLayout>
              </af:panelBorderLayout>
            </af:panelGroupLayout>
          </af:form>
        </af:document>
      </f:view>
    </jsp:root>

  • How to get a specific layout with the available layout managers?

    Hi
    Not done java GUI's (approximately 5 and a half years) for a while (I havn't even touched java for ages until a few months ago), and I am a little embarrased by how much I have forgotten.
    After tring unsuccessfully several times with TableLayouts and GridBagLayouts to produce this [ [http://i32.tinypic.com/fl94kp.png] ] sort of layout, I have decided I am either being incredibly stupid, or It's a rather difficult thing to do.
    (Sorry about the crudeness of the drawing)
    Please can someone point me on the right track as to what combination of layout managers + components I should be using to achive this, or even be super kind and post a code snippet for it.
    Preferably, I would like to use just the default layout manages / components that come with java, which will allow me to continue working on the GUI in netbeans without it complaining, but I'll use external libraries if absolutely nesecarry.
    Thanks
    A completely unrelated side note, but where the heck have all my past posts and dukes gone. :(
    Edited by: DarthCrap on Aug 2, 2010 5:14 PM

    Yes, A BorderLayout did solve my problems. It appears I was being stupid after all. :)
    @Encephalopathic. Using a gridbaglayout does indeed help with the centering issue for the smaller panel on the right. I had just worked that out myself when you posted. I had been reluctant to try the gridbaglayout for that, because it caused me a load of pain when I tried using it for the original problem.
    Thanks

  • Setting components position..

    i have designed my frame with componets using null layout and the screen resolution as 800 * 600,
    and its working fine, but when i change my screen size say 640 * 480
    the screen size becomes big and the buttons are going well down the screen, so how can i over come this problem...

    That's one of the reasons why you really should consider using a layout manager eg. GridBagLayout, but if you really want to use a null layout you can determine the screen size by using java.awt.Toolkit.getDefaultToolkit().getScreenSize() and layout the components according to that.

  • ListView appearing behind other graphical components in VBox

    I have created a ListView implementation of a ChoiceBox since I have a very long list of items and I don't like the fact that the entire list is displayed when opening the ChoiceBox. I have attached this ListView to a button so that when a user clicks on the button the ListView opens just like a ChoiceBox. My issue, however, is that when the ListView is diplayed it appears behind the other graphical components in my VBox container! I have tried to call "toFront()" on my ListView component however the VBox repositions my ListView component to the bottom of the VBox (which makes sense since toFront merely moves the node to the end of the VBox node list). Obviously this is not the behaviour I want and I don't want to have to convert my VBox to a StackPane (or just a Pane) and layout the components myself since the VBox lays out the components perfectly. It would be nice if there were a "z order" parameter but that doesn't appear to be the case and I have already looked into the "depth" parameter.
    Are there any other ways to bring my ListView to the front without the VBox repositioning this component? How does the ChoiceBox component itself accomplish this? I have also tried to embed the ListView in a PopupControl but the unfortunate side effect of this is that the Popup always appears in front of EVERY window on my screen which is a tad annoying.
    BTW, I think JavaFX is the next best thing to sliced bread! I have written a very large application and this is the only issue that I have run into since it went GA. JavaFX has far exceeded my expectations and the JavaFX team (and Oracle in general) and other developers who have contributed to this project should all be commended for the outstanding work they have done on this!!!

    fermat wrote:
    I have created a ListView implementation of a ChoiceBox since I have a very long list of items and I don't like the fact that the entire list is displayed when opening the ChoiceBox. I have attached this ListView to a button so that when a user clicks on the button the ListView opens just like a ChoiceBox. My issue, however, is that when the ListView is diplayed it appears behind the other graphical components in my VBox container! I have tried to call "toFront()" on my ListView component however the VBox repositions my ListView component to the bottom of the VBox (which makes sense since toFront merely moves the node to the end of the VBox node list). Obviously this is not the behaviour I want and I don't want to have to convert my VBox to a StackPane (or just a Pane) and layout the components myself since the VBox lays out the components perfectly. It would be nice if there were a "z order" parameter but that doesn't appear to be the case and I have already looked into the "depth" parameter.
    Are there any other ways to bring my ListView to the front without the VBox repositioning this component? How does the ChoiceBox component itself accomplish this? I have also tried to embed the ListView in a PopupControl but the unfortunate side effect of this is that the Popup always appears in front of EVERY window on my screen which is a tad annoying.Ya, the PopupControl is the way to go with this. The reason why is that if you use "lightweight" rendering of the drop down (er... popup?) and it extends beyond the end of the window, you will have your list appear clipped. So you have to use a real heavyweight window (the PopupControl) to make sure that if it extends beyond the edge of the window, it displays correctly.
    I believe the UI controls team is planning on adding a proper ComboBox (which, FWIW, we always planned to add) sometime between now and 3.0, but I'm not sure when. The ChoiceBox actually uses a ContextMenu, while ComboBox would use PopupControl, but some of the little details are the same. Here is a code snippet that might be useful from the ChoiceBox skin.
            // When popup is hidden by autohide - the ChoiceBox Showing property needs
            // to be updated. So we listen to when autohide happens. Calling hide()
            // there after causes Showing to be set to false
            popup.setOnAutoHide(new EventHandler<Event>() {
                @Override public void handle(Event event) {
                    ((ChoiceBox)getSkinnable()).hide();
            // fix RT-14469 : When tab shifts ChoiceBox focus to another control,
            // its popup should hide.
            getSkinnable().focusedProperty().addListener(new ChangeListener<Boolean>() {
                @Override public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) {
                    if (!newValue) {
                        ((ChoiceBox)getSkinnable()).hide();
            // TODO remove this id once bug RT-7542 is fixed.
            popup.setId("choice-box-popup-menu");
    BTW, I think JavaFX is the next best thing to sliced bread! I have written a very large application and this is the only issue that I have run into since it went GA. JavaFX has far exceeded my expectations and the JavaFX team (and Oracle in general) and other developers who have contributed to this project should all be commended for the outstanding work they have done on this!!!Dude, thanks for that, you just made my day :-)

  • Layout mirror mystery

    I have a large AIR application written in Flex 3. After updating to Flex 4.0 and 4.01 (using AIR 2.0) some very strange behaviour has occured:
    Some layouts (mostly components based on the Group class) are completely mirrored ! Panels, text, images, buttons are mirrored !
    None of this shows up when viewing in design mode, it only shows up when running the app.
    Many of the apps parts are based on custom templates. So most of the code is similar in many cases. But even in these cases some of the layouts show up just fine, and others are completely mirrored.
    I am unable to find anything in the code that could make this happen.
    In addition to this I also have another problem: I have an image that I can drag a selection on and copy the content. After updating Flex the selection is reversed when dragging. Dragging to the left moves the selection rectangle to the right, and visa versa - as if the whole selection is mirrored in relation to the image.
    I didnt have any of these problems before updating, the whole app worked fine.
    Have anyone of you experienced this strange stuff ? Any known bugs that can cause this ?

    Thanks for your reply Shongrunden.
    I`m afraid none of the fixes worked.
    However, thanks to you and your reply I did some additional tests and I found a fix:
    All the mirroring occured in group subclasses. When replacing the group tags with skinnable container tags it worked as it should.
    I presume there is a bug in the group class causing this strange behaviour (?)

  • How to make components' size constant?

    I have a newbie question for you. How to make the size of components (button, combobox, etc...) constant? I mean they keep the same size as the users change window's size.
    Thanks.
    Sraiper

    You need to use a layout manager that respects the minimum and maximum size of the components and set the minimum and maximum sizes to be the size that you want the component to be. FlowLayout respects minimum and maximum, and so does BoxLayout. BorderLayout and GridLayout don't respect the min or max sizes. You can usually get what you want with a combination of layout managers. If you gave me a better idea of how you want to layout your components, and what you want the resizing behavior to be, then I could give you some more specific recommendations about the layouts you should use.
    Try making some ascii drawings.
    Example:
            small size window              large size window
        |                       |  |                                      |
        | []check     o radio   |  |  []check                             |
        | []check     o radio   |  |  []check                   o radio   |
        |             o radio   |  |                                      |
        |  ___________________  |  |                            o radio   |
        | |_____textfield_____| |  |                                      |
        |  ________   ________  |  |                            o radio   |
        | |_button_| |_button_| |  |                                      |
        |_______________________|  |  __________________________________  |
                                   | |____________textfield_____________| |
                                   |                 ________   ________  |
                                   |                |_button_| |_button_| |
                                   |______________________________________|Make sure you put
    before and
    after your drawings so the forum doesn't mess them up.

Maybe you are looking for

  • Trouble 'putting' dynamic web pages to remote server

    I have a site defined in DWCS5. I have two servers defined, a local testing server on my computer and the remote server at the hosting company. I have no connection problems with either. I can put 'static' web pages from the local testing server to t

  • Hi there. Can someone please help me with copying photos from my old iPad to my new one? Thanks.

    Hi there. Can someone please help me with copying photos from my old iPad to my new ipad2? Thanks.

  • Regarding receiver File Adapter

    Hi, I am doing IDoc to File scenario. After receiving IDoc, I need to send the information as flat file with fixed length columns to Legacy System and to Archive Folder in Local system (XI). For this, I am using Java Mapping. If any field (suppose le

  • Error in sql developer while debugging

    Hi When Iam trying to debug my procedure in sql developer tool I getting this below error. *Connecting to the database Prodcopy Connection. Executing PL/SQL: ALTER SESSION SET PLSQL_DEBUG=TRUE Executing PL/SQL: CALL DBMS_DEBUG_JDWP.CONNECT_TCP( '172.

  • Remapping System Keys

    Hey I'm a left handed Graphic Artist with a MacBook. Its great except for the stupid 'enter' button on the right next to the keyboard. I cant believe Apple decided to make that key 'enter' instead of 'option' for a symmetrical layout friendly to both