GUI elements visible/ invisible

I need various different comboboxes to appear as the user steps through making choices.
I am new to Swing and unsure whether I can make comboboxes visible, or whether I should have them on different JPanels and make these visible/invisible.
Am a little confused 'cos I read in a book that only one element can be contained in a specific container region, so can I have several JPanels in the one region of the container at the same time?
I am using border layout.
If someone could please explain I'd sure appreciate it!

There are many layouts availabled in Swing, BorderLayout, BoxLayout, GridBagLayout, CardLayout etc etc. Each of them have their own pros and cons. For instant, BorderLayout can only contain one element in a specific container region, like you said. It has 5 regions, North, West, East, West, and Center. Following link can give you more details about this layout.
http://java.sun.com/docs/books/tutorial/uiswing/layout/using.html
Yes, you can make comboboxes visible or invisible.
JComboBox.setVisible(true) or JComboBox.setVisible(false)
You can do this to any other components as well, like JTextField, JLabel, JButton etc etc.
cheers.

Similar Messages

  • Web dynpro UI element visibility

    Hi
    My situation is this.
    I have a view on which I want to display certain fields to the user depending on whether a particular value is present in a database table.
    In the Context I have attributes of type WDUI_VISIBILITY which are mapped to the relevant UI elements in the layout that I want to set to visible or not when the view loads.
    In the WDDOINIT method I have declared local variables like so: DATA lv_visible TYPE wd_this->element_properties-visible.
    I then perform the database check which I can see is fine in debugging and assign values to my local variables:
    IF lv_unfal NE 'X'.
           lv_visible = 02.
          lv_hod_visible = 01.
         ELSE.
           lv_visible = 01.
          lv_hod_visible = 02.
    And then assign those values to the context element.
         lo_el_properties->set_attribute( name = 'VISIBLE' value = lv_visible ).
        lo_el_properties->set_attribute( name = 'HOD_VISIBLE' value = lv_hod_visible ).
        lo_el_properties->set_attribute( name = 'HOD' value = lv_hod_vis ).
    However on loading the view not all of the UI elements are being made visible/invisible as I would expect/hope! I am missing something here? I've used this concept before and it worked ok. Is is something to do with the WDDOINIT method?
    As always very grateful for any suggestions.
    Thanks
    Jon

    Hi Rama
    Can you elaborate on how by default the the ui elements are not visible please?
    I've double checked all the assignments and I have bound the visibility attribute to all required UI element's Visible Property.
    There are no other methods with code that is overwriting the INIT method. One of the elements involved is a checkbox which has an onToggle event. I'm not interacting or setting it on loading the view but might that have an effect?
    Cheers
    Jon

  • GUI element question

    Hey guys. I was wondering, is it possible to create this GUI element with Scripting?
    I could create EditText element, but I'd like to use, if possible, this more elegant way for user to input values.
    I am talking about 120 / 84 / 0 elements in this GUI (screenshot from Character palette)
    Is it doable?

    Yeah those sliding edit texts are cute, but unfortately they are not part of ScriptUI.
    As David said, you can stack 2 texts, but that will only have aesthetic effects.
    It could be useful to store more digits in the edit texts and display less in the static one for nicer UI (like native sliders do), but  this is something one simply never need when scripting...
    var w = new Window("palette");
    var tt =w.add("group{orientation: 'stack',\
                                    staticT: StaticText{text: '0.0', characters: 8, justify: 'left', visible: true},\
                                    editT: EditText{text: '0.0', characters: 8, justify: 'right', visible: false}\
    tt.staticT.onActivate = function(){this.visible=false; this.parent.editT.visible=true;};
    tt.editT.onChange=tt.editT.onDeactivate=function(){
        var x=parseFloat(this.text) || 0.0;
        this.text = x.toFixed(3);
        this.parent.staticT.text = x.toFixed(1);
        this.visible=false;
        this.parent.staticT.visible=true;
    w.center();
    w.show();
    When there is no element to give focus to (like in this example) it is hard to get the static text back if you finally don't change its value...
    Xavier

  • Firefox gui element capture plug in keeps causing Firefox to crash and it won't open certain windows. Any idea why?

    I disabled extensions per Firefox instructions and discovered that 'firefox gui element capture plug in 1.0' is the one causing my problems. Problems being Firefox either crashes or refuses to open an additional window, and then crashes.

    I am not sure why this started happening, however please update to version 32.0.3 when its available.
    The places we can troubleshoot is in the Applications menu under preferences.
    *[[Set how Firefox handles different types of files]]
    If you set it to pdf.js viewer as default does it not show up?

  • Access - Another Newbie Visible/Invisible Field Q

    With help from Maurice, I now have two fields and associated labels that become visible/invisible dependent on the selection/status of a checkbox.  The visibility is controlled in the AfterUpdate property of the check box.  See previous "field
    visibility" post.
    What I am now looking to do is have the visibility of those fields change as I navigate between records.  So if the checkbox is unchecked for a particular record, then the fields are not visible when this record is displayed in my form.
    Can someone tell me in which event this test should be applied?
    I'm thinking this should be a form event, but I don't see a change record event as such.
    Thanks
    Phil

    Hi Phil,
    You can accomplish this by using the 'on current' event of the form. That way when you navigate to another record you can trigger an event. Be aware though that this is a costly event because it will fire every time you go to another record.
    You can use the value of the checkbox as your trigger. Something like if me.checkbox=0 then me.label.visible=true or false.
    Let us know if that helps
    Maurice
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer. Thank You
    The Office Corner

  • Visible/invisible subform based on choices from 2 dropdowns

    Does anyone have an example of a form with subforms being visible/invisible based on the answers of 2 dropdowns.
    thanks for sharing

    Hi Jagan,
    It is probablly just how you set up the script.
    For starters, for Yes/No choices I think you would be better to use radio buttons instead of checkbox objects. So for example you would have four different radio button exclusion groups, each with a Yes and No radio button. Then in the Object > Binding palette, you would set the Yes value to 1 and the No value to 0.
    This way you can sum the four radio button exclusion groups and if the total value is >=1 then change the presence of the text field and highlighting to suit.
    There are some examples here that might help:
    Scoring options: http://assure.ly/uiKS6f.
    Tracking interaction (checkboxes): http://assure.ly/xDbtbx.
    Hope that helps,
    Niall

  • Setting GUI elements not displaying and SwingWorkers....

    I have a prototype JMS application where a JMS message handler class wraps a GUI application class. Updates are made from the wrapper class to the HMI via a public method on the GUI which then sets the numerous GUI elements. The element values are set but the display is not updated. From what I have read this is a common situation where within the GUI class the updating method should use a SwingWorker to carry out the work and to coordinate the threads. Given that this approach is not working would anyone have any suggestions as to how I can resolve this.
    Thanks
    C

    You can use SwingUtilities.invokeLater(...) to update the state of a GUI component.

  • Make region/Task-Flow visible/invisible inside the page created in composer mode.

    Environent_
    JDeveloper 11.1.1.6.0
    Webcenter Sites version : 11g R1.
    Problem statement_
    Below example is to demonstrate the usecase to make region visible/invisible inside the page created in composer mode.
    The problem with this case is the 'Show Component' property does not automatically evaluate its expression even after using the contextual event.
    We want the region to be refreshed at run-time just like it works with design time pages using Refresh, RefreshCondition attributes in pageDef.
    My Usecase_
    I have two task flows dragged in Webcenter Customized Page.
    First contains Employee list and Second  contains selected employee's manager name.
    By default when page loads second task-flow/Dragged-Box  should be hidden.
    When I select employee from first box, then immediately second box should be appeared with manager name.
    In the case when If Employee does not have manager, second box should be disappeared. Whole page should not be refreshed only the second box should be refreshed and hide.
    Regards,
    Niraj

    Hi Jiri,
    Thanks for your prompt reply..
    While referencing the taskflow in any page will create a region and makes entry in pageDef for that page.
    In the PageDef of that page I am using Refresh and RefreshCondition attributes of the taskflow tag in order to refresh the taskflow based on certain condition or parameter change.
    I want to achieve the same in run-time environment using composer mode. where I have the control over page but do not have pageDef (visually where I can go and add the attributes Refresh and RefreshCondition manually)
    I would be obliged if someone can help on this.
    Thanks
    Regards,
    Niraj

  • Making Subform Instances Visible/Invisible

    Hello,
          I am trying to loop through the Subform Instances of the form and trying to make them visible/invisible on the click of a Check Box. The script seem to run just fine but the values nothing happens to the subforms. The script is written on the CLICK event of check box and is as below:-
    ----- HAP_DOCUMENT.APR.HAP_DOCUMENT.Positions.DATA.CHECK_BOX::click: - (JavaScript, both) ----------
    var
    nCount = APR.HAP_DOCUMENT.T_ELEMENTS.DATA.instanceManager.count;
    //var plan_value = this.parent.PLANS.rawValue;
    var
    plan_value = this.parent.parent.parent.Storage_Form.PLANS.rawValue;
    for (var nItem = 0; nItem < nCount; nItem++) { // Begin Loop T_ELEMENTS after the Instance is created
    var sub_Tele = "HAP_DOCUMENT.T_ELEMENTS.DATA["+ nItem +"]";
    var tName = "HAP_DOCUMENT.T_ELEMENTS.DATA["+ nItem +"].T_COLL_CELL.DATA";
    var sCount = xfa.resolveNode(tName).instanceManager.count;
    for (var sItem = 0; sItem < sCount; sItem++) { // Second Loop on T_COLL_CELL
    var fName = "HAP_DOCUMENT.T_ELEMENTS.DATA["+ nItem +"].T_COLL_CELL.DATA["+ sItem +"].T_FIELD.DATA";
    var tCount = xfa.resolveNode(fName).instanceManager.count;
    for (aItem = 0; aItem < tCount; aItem++){ // Third Loop on T_FIELD
    var gName = "HAP_DOCUMENT.T_ELEMENTS.DATA["+ nItem +"].T_COLL_CELL.DATA["+ sItem +"].T_FIELD.DATA["+ aItem +"].simpleField.VALUE_STRING";
    var lName = "HAP_DOCUMENT.T_ELEMENTS.DATA["+ nItem +"].T_COLL_CELL.DATA["+ sItem +"].T_FIELD.DATA["+ aItem +"].simpleField.CAPTION";
    var subName = "HAP_DOCUMENT.T_ELEMENTS.DATA["+ nItem +"].T_COLL_CELL.DATA["+ sItem +"].T_FIELD.DATA["+ aItem +"]";
    var aVal = xfa.resolveNode(gName).rawValue;
    var bVal = xfa.resolveNode(lName).rawValue;
    var subVal = xfa.resolveNode(subName).presence;
    if (bVal == "Position Number"){
    if (aVal == plan_value) {
    if ( this.rawValue == 1) {xfa.resolveNode(subName).presence
    = "visible";}
    else {xfa.resolveNode(subName).presence
    = "hidden"; }
    Is there any other way of addressing the properties of the Subform Instances? Could any please help me as to why there is no effect on the subforms?
    Regards,
    Shishir.P

    Is the form saved as dynamic? Are you getting any errors in the javascript console?
    Paul

  • Position GUI element in runtime

    Hi All
    I would like to positioning popup window relativ to a GUI element (InputField). How can I read the element position?? That is possible, the generic value helper are positioned relativ to linked element. I would like pisitioning my popup window similiary but i dont know how

    Hi,
    you can try following:
    IWDWindowInfo _windowInfo = wdComponentAPI.getComponentInfo().findInWindows("<WINDOW_NAME>");
    IWDWindowManager manager = wdComponentAPI.getWindowManager();
    IWDWindow _window = manager.createWindow(_windowInfo, true);
    ((IWindow)_window).setWindowPositionControl( "<CONTROL_ID>" );
    <CONTROL_ID> - "<COMPONENT_ID>.<VIEW_NAME>.<UI_CONTROL_ID>" (for example "PFCBCNPF.POSearchCriteriaCV.SearchButton")
    To get it you need to view HTML sources of your generated view in browser, for example "<a ... id="PFCBCNPF.POSearchCriteriaCV.SearchButton"...>"
    pay attention that it is NOT documented feature (setWindowPositionControl method) and you are using it at your own risk.
    Regrads, Maxim R.

  • Make a Transparent container visible invisible

    helllo all,
    how can I make a Transparent container visible invisible depending to an attribute,
    can anyone lead me to resolve this ?
    thank you all?

    Hi,
    Create a attribute ( LV_VISIBLE ) type of boolean in context, then bind that attribute in the properties of the TC
    TC->properties->visble property, bind the attribute in visible property of the TC.
    Then when u want to visible that inside of on action write below code.
    Declare a node :data:  n_node type ref to if_wd_context_node.
    then node assign to that created ( LV_CISIBLE )attribute nade ( E/G : ln_node = wd_context->get_child_node( name = ' node' ) )
    ln_node->set_attribute( exporting name = `LV_VISIBLE` value = abap_true ). "for visible of the TC.
    ln_node->set_attribute( exporting name = `LV_VISIBLE` value = abap_false ). "for invisible of the TC.
    Regards
    Srini.

  • How to make a UI Element visible or invisible

    Hi,
    I have a dropdown and three input fields in my screen.
    Depending on the value in the drop down only one or two or three input fields can be made visibile or invisible.
    Kindly help me how to make a field invisible?
    Thanks in advance.
    Regards
    Shanthi

    Hi Shanthi,
    1. You will have to create custom Object type or subobject type depending on your requirement. Custom Object type can be created in SPRO-> Cross component -> UI Framework -> Framework definition -> define object type.
    2. Go to configuration tab and create 3 different configurations of your view using different object type/subobject type. First Config will display all the three fields, second would display 2 of 3 and third config to display only one input field.
    3. Go to Get_P_xxx method of your dropdown field and trigger server round trip (An event) to ensure that entire view is loaded every time you select value in dropdown.
    4. Redefine DO_CONFIG_DETERMINATION method from your _IMPL class and here read values in your dropdown field. On the basis of value selected, you can trigger different configurations by using code:
      me->set_config_keys( iv_object_type          = <lv_object_type>
                           iv_object_sub_type      = <lv_subtype>
                           iv_propagate_2_children = abap_true ).
    Hope this helps.
    Regards,
    Bhushan

  • How to read the configuration for SAP GUI elements in Plant Maintenance module from SPRO and leverage the same in NWBC for HTML.

    Dear Members,
    Greetings for the day!
    I am working on NWBC for HTML in Plant Maintenance module.
    We have configured some changes in SPRO for customizing the UI elements( like visibility, mandatory ) like tabs and fields in transactions like IW21( Create Notification).
    As of now separate parallel configuration needs to be carried out in NWBC for HTML in PM module to achieve the same UI features for creating notifications and this is time consuming.
    Is there any way to read the configuration done in SPRO for the SAP GUI's and leverage the same in NWBC for HTML.
    Appreciate your time in responding to this.
    Thanks & Regards,
    Ram.

    >
    <IfModule mod_weblogic.c>
    WebLogicCluster 127.0.0.1:7005,127.0.0.1:7007,127.0.0.1:7003,127.0.0.1:7103,127.0.0.1:7104
    MatchExpression /app1
    </IfModule>
    <Location /weblogic>
    SetHandler weblogic-handler
    WebLogicCluster 127.0.0.1:7003,127.0.0.1:7005,127.0.0.1:7007,127.0.0.1:7103,127.0.0.1:7104
    DebugConfigInfo ON
    PathTrim /weblogic
    </Location>
    <IfModule mod_weblogic.c>
    WebLogicCluster 127.0.0.1:7003,127.0.0.1:7005,127.0.0.1:7007
    MatchExpression /app2
    </IfModule>
    <Location /weblogic>
    SetHandler weblogic-handler
    WebLogicCluster 127.0.0.1:7003,127.0.0.1:7005,127.0.0.1:7007
    DebugConfigInfo ON
    PathTrim /weblogic
    </Location>
    >
    This configuration is weird little bit. There is MatchExpression /app1 and MatchExpression /app2 and at the same time two <Location /weblogic> sections. Are you sure you understand what that configuration stands for?
    Try something like this ...
    <Location /app1>
    SetHandler weblogic-handler
    WebLogicCluster 127.0.0.1:7003,127.0.0.1:7005,127.0.0.1:7007,127.0.0.1:7103,127.0.0.1:7104
    DebugConfigInfo ON
    </Location>
    <Location /app2>
    SetHandler weblogic-handler
    WebLogicCluster 127.0.0.1:7003,127.0.0.1:7005,127.0.0.1:7007
    DebugConfigInfo ON
    </Location>
    where /app1 and /app2 are contexts of your weblogic applications.
    http://download.oracle.com/docs/cd/E11035_01/wls100/plugins/apache.html
    http://httpd.apache.org/docs/2.0/mod/core.html#location

  • Dynamical View - Visible / Invisible mode

    Hi,
    I've 5 table in a view of a Web Dynpro and 5 button for any table.
    I need to display only a table dipending the button pushed .
    I think to put 5 table on a view in invisible mode.
    I can't place on all the table each other.
    Have you an idea?
    Tnx a lot.
    Domenico.

    Hi,
    Adding to what Anil has said
    The table has property called Visibile bind this to a context attribute of type WDVisibility.
    The property Visible can take three values
    blank : The UI element is not visible on the screen but takes up space.
    none : The UI element is not visible on the screen and takes up no space.
    visible :The UI element is displayed on the screen.
    In the init method set all the tables visibility to none like
    wdContext.currentContextelement.set"Name of attribute"(WDVisibility.None);
    Then as and when you require to see a particular table set the context attribute to visible.
    Hope this helps.
    Regards,
    Vijith

  • Code and GUI Elements Altered When Working Between Windows 8, and = Windows 7

    This is not the usual "My fonts look different" problem we get when running application executables on different PCs.  The bug I am seeling (yes, I'm calling it a bug) is that when I bring up code to work on in Windows 8, several things change, both in the GUI and source panes.
    1. Controls and indicators are scaled differently, moved, and frequently no longer aligned with the grid.
    2. In structures like the timed loop, the parameter text is oversized, and only partially visible.  Changing font settings in Options has no effect.
    3. Floating constants (not wired to anything) can show up in unpredictable places.  Even wired up code seems to move around.
    4. Maybe unrelated, but WIndows 8 sucks.  Sorry, just had to get that out.
    This is a serious problem which affects my productivity, as I cannot work on my code outside of my office, without creating more work for myself when I get back in.  The obvious solution would be to downgrade my laptop to Windows 7, but of course THAT OS no longer exists as far as Microsoft is concered.

    Norbert_B wrote:
    Hm, i have no experience with Windows 8 yet, so i cannot refer to your specific question/remarks.
    But:
    When switching my laptop to a newer one (the old running Win 7 32bit, the new Win7 64bit), i encountered some severe graphics issue with LV as well.
    I found out, that my new laptop was configured to display "text and other items" with 125% (setting can be found in Control Panel>>Appearance and Personalization>>Display.
    After changing this setting back to 100%, most things work fine now in LV.
    Another point is (what i don't understand) that LV chose to preconfigure the three default font-collection (Application, Dialog, System) to be of size 20. My old machine had 15.
    If you have VIs already displaying fonts at this size, you have to select all controls (Ctrl+a) and THEN change font size. Otherwise, it will not affect existing controls.
    hope this helps,
    Norbert
    That is the Windows way of adjusting for displays with higher DPI, since the text can get very small with 150dpi displays rather than the standard 96dpi, Windows was originally designed for. Since the Windows graphic system is still mostly pixel based also for fonts, there is no other easy way to allow making text more readable. This scaling however messes with any graphic system that works on pixels rather than a virtual resolution and is one reason Retina style displays won't be a good option for Windows machines for some time to come.
    The font size change is also because of that. LabVIEW detects at startup that the screen resolution is rather high and tries to correct for this. But together with the Windows screen scaling this makes things look even worse. Unfortunately there is no simple solution for this. Windows has over the time attempted to fix such issues in so many different and often incompatible ways, that there exist simply to many variables to make a program detect all possible  incarnations of user and system adjustable settings and account for them.
    I'm sure there is room for LabVIEW to improve on this, but there is simply no way to make it work seemlessly for all possible configurations.
    A long time ago someone designed a Next cube device that used Display Postscript as graphical output system. This Display Postscript had a true virtual resolution system and made the idea of having graphical output look the same on any kind of display or printer feasable. Unfortunately and despite working together with graphic chip manaufacturers it never made it as such into mainstream hardware. Supposedly partly because the performance was significantly less than other systems and therefore was never considered good enough for the main driving force in graphics developmen (games) but possibly also because the drivers were significantly more complex and there was not that much interest to dig that complexity.
    MacOS X uses some of the concepts of the Next cube but abandoned Display Postscript for a somewhat more traditional approach. But Windows has still a lot to catch up in that area, if they ever do.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

Maybe you are looking for