How select (focus) button bydefault.

Hello

Please tell me how select (focus) button bydefault.

onDisplay() instance method of your screen, run the following code:

yourButtonField.setFocus ();

Tags: BlackBerry Developers

Similar Questions

  • How to make the non selectable radio button field

    I want to UN selectable radio button field average user will be not be able to select. How can I achieve this. Please help me for this.

    You could remove them from the screen, or do unfocusable or make unmodifiable.  The choice will depend on what you're trying to reach.

  • How to load the second list meter if I have something in the first list of select/focus?

    How to load the second list meter if I have something in the first list of select/focus?

    public class spintest extends BaseScreen implements {FocusChangeListener}

    final String [stateList] = {"New York", "Washington"};
    final String [] NYcities = {'Manhattan', 'Queens', 'Brooklyn', 'Bronx'};
    final String [] WashCities = {"Redmond", "Kent", "Seattle", "Bellevue"};

    public SpinTest() {}
    SpinBoxFieldManager spinBoxMgr = new SpinBoxFieldManager();

    SpinBoxField spinBoxStates = new TextSpinBoxField (stateList);
    spinBoxStates.setFocusListener (this);

    SpinBoxField spinBoxCities = new TextSpinBoxField (NYcities);

    spinBoxMgr.add (spinBoxStates);
    spinBoxMgr.add (spinBoxCities);

    Add (spinBoxMgr);
    }

    ' Public Sub focusChanged (field field, int context) {}
    If (spinBoxStates == field) {}
    Salt string = (String) spinBoxStates.get (spinBoxStates.getSelectedIndex ());
    If (sel.equals ("New York")) {}

    I have to load all the cities of New York in the second wheel if I select 'New York' in the first wheel

    }
    else {if (sel.equals ("Washington"))

    I have to load all the cities of Washington in the second wheel if I select 'Washington' in the first wheel

    }

    }

    Simply call the TextSpinBoxField.setChoices method, transmitting your new list of choices.

  • focus button problem

    Hi friends,

    I want information on

    When I select a button and I am pressing this button after pressing it is in a State of liberation in this State, that I want to change the button color.

    That's my problem how to do this type of event.

    Please tell me if you now.

    It is urgent for me

    Nice link.

    You might also find something useful here:

    http://supportforums.BlackBerry.com/T5/Java-development/implement-advanced-buttons-fields-and-manage...

  • Left mouse click selects the button but does not execute the action of the button (for example close)

    HI - this seems to be a problem with Windows rather than the mouse, so any help would be greatly appreciated!

    First of all - I have a trackball M570. Works fine connected to another Windows 7 machine.

    But on a single machine including windows 7... I can use the left click for most, but in some applications, when I click a button it not actually click the button. Yes, he selects the button but it does not perform the button action. I also see the issue in the boxes, I can't put a tick in the boxes. Or at least I just figured someway by combining fast random space bar presses and presses mouse, but it is obviously not right. Couldn't find anything useful in google, so I thought I would try here in hope!

    Thank you for the pointers !

    Cheers, Jim.

    HI - Finally - I found a solution.

    First of all - the following solution worked for me, but there are possible solutions mentioned on the thread I linked in my previous email.

    The mouse is a Logitech wireless, with the SetPoint software installed. I also had a Microsoft wired keyboard and just in case that was the problem, I replaced it and - YES! All good new - in fact explains some other issues, I was less concerned. The problem with the keyboard was somehow screwing of the mouse.

    Since then I have been reduced to a media volume on the keyboard button, no idea how to solve this problem, and the replacement keyboard was free, so just get rid of the old. Note: I could use the old keyboard when I downloaded the Microsoft Mouse and keyboard Center, installed and disabled the offending button.

    Thank you, maybe my solution might help some people out there.

    Jim.

  • How to validate button Save

    Hello

    How to validate button 'save '? Requirement is at the advanced table I have lov fields 'Application name' and 'name of responsibility. " If I choose the two lov then only it will save the records.else, it will show a message "enter values in 2 fields. I use code code below.



    If (PageContext.GetParameter ('Save')! = null)
    {

    RequestAccessDetailsVOImpl vo = am.getRequestAccessDetailsVO1 ();
    Line row = vo.first ();
    String p_appl_name = null;
    String p_resp_name = null;

    for (int i = 0; i < vo.getRowCount (); i ++)
    {
    p_appl_name = Row.GetAttribute ("ApplicationName"). ToString();
    p_resp_name = Row.GetAttribute ("ResponsibilityName"). ToString();
    p_username = PageContext.GetUserName (). ToString();
    System.out.println ("application name is" + p_appl_name);
    System.out.println ("name of responsibility is" + p_resp_name);

    }
    Row = VO. Next();

    If (((p_appl_name)! = null) & & ((p_resp_name)! = null))
    {
    System.out.println ("Working");
    am.getOADBTransaction () .commit ();
    System.out.println("6");
    throw new OAException ("successfully", OAException.INFORMATION Records);
    }
    on the other
    {
    throw new OAException ("Enter the two fields", OAException.INFORMATION);
    }

    }



    IAM get 'Application name' and values "name of responsibility." If I select the two values it works well, but if the option not all lov is showing below error.



    Details of the exception.

    oracle.apps.fnd.framework.OAException: java.lang.NullPointerException
    at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:888)
    at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(OAPageErrorHandler.java:1145)
    at oracle.apps.fnd.framework.webui.OAPageErrorHandler.processErrors(OAPageErrorHandler.java:1408)
    at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2637)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1659)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:497)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:418)
    in OA. jspService(OA.jsp:40)
    at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
    at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
    at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
    at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
    to EDU.oswego.cs.dl.util.concurrent.PooledExecutor$ Worker.run (PooledExecutor.java:803)
    at java.lang.Thread.run(Thread.java:534)
    # # 0 in detail
    java.lang.NullPointerException
    at wnsgs.oracle.apps.sysadmin.requestforaccess.webui.RequestAccessDetailsCO.processFormRequest(RequestAccessDetailsCO.java:155)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:799)
    at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
    at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1118)
    at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:995)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:961)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:816)
    at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
    at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:995)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:961)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:816)
    at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
    at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363)
    at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2633)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1659)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:497)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:418)
    in OA. jspService(OA.jsp:40)
    at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
    at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
    at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
    at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
    to EDU.oswego.cs.dl.util.concurrent.PooledExecutor$ Worker.run (PooledExecutor.java:803)
    at java.lang.Thread.run(Thread.java:534)
    java.lang.NullPointerException
    at wnsgs.oracle.apps.sysadmin.requestforaccess.webui.RequestAccessDetailsCO.processFormRequest(RequestAccessDetailsCO.java:155)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:799)
    at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
    at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1118)
    at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:995)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:961)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:816)
    at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
    at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:995)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:961)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:816)
    at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
    at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363)
    at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2633)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1659)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:497)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:418)
    in OA. jspService(OA.jsp:40)
    at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
    at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
    at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
    at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
    to EDU.oswego.cs.dl.util.concurrent.PooledExecutor$ Worker.run (PooledExecutor.java:803)
    at java.lang.Thread.run(Thread.java:534)




    Can someone help me how to solve this error.

    Thank you
    NGO

    p_appl_name = Row.GetAttribute ("ApplicationName"). ToString();

    The statement generates error if row.getAttribute("ApplicationName") returns null as he tries to toString() to null.
    So it correctly handles to null values.

    p_appl_name = (String) row. GetAttribute ("ApplicationName");
    p_resp_name = (String) row. GetAttribute ("ResponsibilityName");

    It should work... If you are still having problem... very unlikely... in this scenario, you use only
    Object p_appl_name = row.getAttribute ("ApplicationName");
    Object p_resp_name = row.getAttribute ("ResponsibilityName");

    If you use over construction of the object then you will need to convert the objects to strings if you view them, but the comparison they work always as is.

    Kind regards
    Stephanie.

  • How to remove buttons in the buttons of the region in the oracle apex?

    How to remove buttons in the buttons of the region in the oracle apex?

    I created unwanted buttons... so I have to remove...
    but I don't know how to do this?

    Hello

    -> Page of the apex towards the region of buttons where the list of buttons.
    -> Click on the button you have to remove.
    -> Click on the button 'Delete' at the top of page.
    -> It ask for confirmation click 'OK' to delete this button

    OR

    -> Page of the apex towards the region of buttons where the list of buttons.
    -> Click the "Change all" and go to the tab "delete several buttons.
    -> Check the buttons which yo I want to delete.
    -> Click on the button "Delete Botton" for button remove selected

    Kind regards

    Patel Kartik
    ------------------------------------------------------------------------
    http://patelkartik.blogspot.com/
    http://Apex.Oracle.com/pls/Apex/f?p=9904351712:1

  • display of the values of selected option buttons

    Hello

    It is an application that would allow users to go through a step-by-step process to build their product, in this case, it's ice cream.


    Description:

    There are six option buttons, four belonging to a radiobuttongroup and two others belonging to an another radiobuttongroup. In addition, there is a mx:TextArea (including the editable value false).

    This Panel will most likely go into a mx:ViewStack as a "first step" in the process of personalization of the ice cream. The selection of a radiobutton to every radiobuttongroup must be required to move forward (go to the next "step", as in the Panel following in the ViewStack).

    Problem:

    Allowing the user to select an item in each of the two radiobuttongroups and write values of these two selected radiobutton [such as specified by the value of the radiobutton = property 'radioButtonValue'] to the mx:TextArea, on different lines.

    I have been moderately successful in trying to do it, but I didn't know how to write two values in the same text box
    without crushing them each other.

    Misc.

    At first, I tried something to the effect of: ( changed from the 2 flex components Explorer)

    < mx:Script >
    <! [CDATA]

    Import mx.events.ItemClickEvent;

    Event handler function to display the selected button
    in a text box.
    private void handleConeType(event:ItemClickEvent):void
    {
    If (event.currentTarget.selectedValue is "sugarCone")
    {
    iceConeTextBox.text = "Sugar cône";
    }
    on the other
    {
    If (event.currentTarget.selectedValue is "waferCone")
    {
    iceConeTextbox.text = 'Wafer cone. "
    }
    }
    }
    }
    []] >
    < / mx:Script >
    Quite exaggerated to get something to work, I know. It was not very effective, and I sincerely hope that there are better ways to do this.

    I would like if possible avoid using two mx:textareas.

    Example of

    Here is a link to better describe what I'm talking about (Note: View Source is enabled).

    ConeChooser Application


    Thank you!

    You can access the selected radio button value the id of Group of radio button groups, you don't need to check each radio button individually. Then coneType.selectedValue will give you the value of a button radio is selected in the group, and the coneType.selection.label will give you the label of the currently selected option button or null if none is selected.

    Try this code:


    http://www.Adobe.com/2006/mxml '.
    Width = "100%" height = "100%" layout = "absolute" >

    private function updateText (): void {}
    var totalSelected:uint = 0;
    var cone: String = "";
    var size: String = "";
    If (coneType.selectedValue! = null) {}
    Cone = coneType.selection.label;
    totalSelected ++;
    }
    If (coneSize.selectedValue! = null) {}
    size = coneSize.selection.label;
    totalSelected ++;
    }
    iceConeTextBox.text = '\r', cone + size;
    If (totalSelected == 2) {}
    next_btn.enabled = true; to go to the next view in the viewstack
    }
    }
    ]]>

    horizontalCenter = red "0.5" = "0.5" layout = "absolute" >

    text = "Select your cone." y = "10" height = "44" fontSize = "25" horizontalCenter = "0" / >



    label = "Sugar Cone" width = "150" x = "2" y = "62" / >

    label = "Waffle Cone' width = '150' x '2' = y ="88"/ >

    label = 'Wafer cône' width = '150' x '2' = y = "114" / >

    label = "Chocolate dipped Wafer cone" width = "201" x = "2" y = "140" / >






    Vygo

  • By selecting the buttons "through" other objects

    This makes me crazy... especially because I'm sure it'll turn out to be something incredibly simple...

    I created a few 'pop ups' using a smartshape, legend text, an image and a button and them grouped.  The groups are hidden when the entrance to the slide, they are displayed by selecting the corresponding button on the page, and are hidden by the button in the group.

    The problem is that when I have these groups 'show' on the page that I have them set up so that they cover the buttons on the page... so the learner needs re - hide the group before showing another.  But it seems that when I try to select the button within the group to hide this group, instead it is by selecting the button in the same place, but 'below' of the group.  I checked all my orders, three times, and all the button functions are correctly configured.  In addition, groups are placed above the buttons of the page on the timeline.

    I've only tested using the option "Preview"... I have not published to see if the same thing happens in the final product.

    Any ideas on what I'm missing?

    Thank you.

    Jay

    Never have two interactive objects in the same place at the same time is

    my bike. At least, you must disable the buttons under those that are

    active.

    On February 25, 2016 12:55, "[email protected]" [email protected]>

  • How the Logoff button generated by JHs?

    Hello

    How the Logoff button generated by JHs? I mean I guess the session must be invalidated to logoff user, but I don't know where JHs call invalidate() method.

    See you soon,.

    Will do

    Hi will do, it cancels the session in oracle.jheadstart.controller.jsf.AuthenticationFilter in the doFilter method when logoutURL (defined in the web.xml file) corresponds to the target URL.

    Stephen J.

  • How to add buttons in the script, and then click on run different codes?

    If we run the script, then it should display ok, cancel button 6 button. If we click on button1 coding with button1 dangerousness must be running and so on.

    Button1

    Button2

    Button3

    Button4

    button5

    Button6

    OK Cancel.

    Marie rosine

    // DialogSimpleButton.jsx
    // http://forums.adobe.com/thread/1327372?tstart=0
    // how to add buttons in script, which on click run different codes?
    
    // regards pixxxelschubser
    
    function SimpleDialog() {
    
    var w = new Window('dialog', '');
    this.windowRef = w;
    w.orientation = "column";
    
    btn1 = w.add('button',undefined,'Button 1');
    btn2 = w.add('button',undefined,'Button 2');
    btn3 = w.add('button',undefined,'Button 3');
    btn4 = w.add('button',undefined,'Button 4');
    btnOK = w.add('button',undefined,'OK');
    btnCancel = w.add('button',undefined,'Cancel');
    
    btn1.onClick = function() {alert("Button 1");};
    btn2.onClick = function() {alert("Button 2");};
    btn3.onClick = function() {alert("Button 3");};
    btn4.onClick = function() {alert("Button 4");};
    
    defaultElement = btnOK;
    cancelElement = btnCancel;
    btnOK.active = true;
    
    btnOK.onClick = function() {
        stuff = "your stuff";
        w.close();
        }
    
    w.show();
    }
    
    var stuff = null;
    SimpleDialog ();
    if (stuff) alert(stuff);
    
  • How to focus the TextInput field

    Hello

    How to focus with the TextInput field. I tried with userIDTxtIt.setFocus ();  The update is available for text entry. but when I enter the TextInput field value as "Through", the keyboard is not available here. so I tried with userIDTxtIt.dispatchEvent (new MouseEvent (MouseEvent.DOUBLE_CLICK));

    key board still focus is not available for text entry.

    Kind regards

    Thiru

    I see, this is a browser security restriction that prevents the flash drive

    get it straight, you might overcome only by using javascript.

  • How to add buttons/text to the component right when the selection is made from the left pane

    Hello

    I am new to the JAVA swing development.

    I am creating an application where in the pane on the left, there is a tree Menu and in the right pane, I have a few buttons. In view of the options in the left pane, I should be able to add more buttons and or the text to the right pane.

    How to achieve this? If you guys have any example code, please post or suggest ways to accomplish.

    Thanks in advance.
    user2325986

    It seems that you declare leftPane, rightPane and different main_Frame and have too much static and final elements. Look at the code below. I put GridBagLayout to the framework for a better look.

    I don't know what you mean when you say that you only want to right panel and you want to add. Also, I think you'd be better off using CardLayout to right panel as stated jduprez

    When you want to display using code {_code_} code here {_code_} (code in parentheses without underscores) tags

    Here is a working example of what you had:

    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    import javax.swing.tree.*;
    
    public class Main
    {
        public static void main(String[] args)
        {
            main_Frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            main_Frame.setVisible(true);
        }
    
        public static TestFrame main_Frame = new TestFrame();
    }
    
    class TestFrame extends JFrame
    {
        public TestFrame()
        {
            setTitle("Test Frame");
            setSize(500, 500);
            setLayout(new GridBagLayout());
    
            leftGBC = new GridBagConstraints();
            leftGBC.gridx = 0;
            leftGBC.gridy = 0;
            leftGBC.fill = leftGBC.BOTH;
            leftGBC.weightx = 10;
            leftGBC.weighty = 100;
    
            rightGBC = new GridBagConstraints();
            rightGBC.gridx = 1;
            rightGBC.gridy = 0;
            rightGBC.fill = rightGBC.BOTH;
            rightGBC.weightx = 100;
            rightGBC.weighty = 100;
    
            leftPanel = new JPanel();
            leftPane = new JScrollPane(leftPanel);
            leftPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
            leftPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    
            rightPanel = new JPanel();
            rightPane = new JScrollPane(rightPanel);
            rightPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
            rightPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    
            DefaultMutableTreeNode root = new DefaultMutableTreeNode("main_Tree");
            DefaultMutableTreeNode Branch1 = new DefaultMutableTreeNode("Branch1");
            DefaultMutableTreeNode Leaf1 = new DefaultMutableTreeNode("Leaf1");
            root.add(Branch1);
            Branch1.add(Leaf1);
            DefaultMutableTreeNode Branch2 = new DefaultMutableTreeNode("Branch2");
            DefaultMutableTreeNode Leaf2 = new DefaultMutableTreeNode("Leaf2");
            root.add(Branch2);
            Branch2.add(Leaf2);
            JTree tree = new JTree(root);
            tree.setRootVisible(true);
            tree.setShowsRootHandles(true);
            tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
    
            tree.addTreeSelectionListener(new TreeSelectionListener()
            {
                public void valueChanged(TreeSelectionEvent se)
                {
                    JTree tree = (JTree) se.getSource();
                    DefaultMutableTreeNode node = (DefaultMutableTreeNode)tree.getLastSelectedPathComponent();
                    if (node == null) return;
                    String nodeInfo = node.toString();
    
                    if (nodeInfo.equals("Leaf1"))
                    {
                        rightPanel = new JPanel();
                        rightPanel.add(label);
                        Main.main_Frame.remove(rightPane);
                        rightPane = new JScrollPane(rightPanel);
                        rightPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
                        rightPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
                        Main.main_Frame.add(rightPane, rightGBC);
                        Main.main_Frame.validate();
                        Main.main_Frame.repaint();
                    }
    
                    if (nodeInfo.equals("Leaf2"))
                    {
                        rightPanel = new JPanel();
                        rightPanel.add(Jbt2);
                        Main.main_Frame.remove(rightPane);
                        rightPane = new JScrollPane(rightPanel);
                        rightPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
                        rightPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
                        Main.main_Frame.add(rightPane, rightGBC);
                        Main.main_Frame.validate();
                        Main.main_Frame.repaint();
                    }
                }
            });
    
            DefaultTreeCellRenderer renderer = (DefaultTreeCellRenderer) tree.getCellRenderer();
            tree.setRowHeight(30);
    
            renderer.setLeafIcon(new ImageIcon("blue-ball.gif"));
            renderer.setOpenIcon(new ImageIcon("red-ball.gif"));
            renderer.setClosedIcon(new ImageIcon("yellow-ball.gif"));
            renderer.setFont(new Font("Monospaced",Font.BOLD|Font.ITALIC,15));
            renderer.setTextNonSelectionColor(Color.blue);
            renderer.setTextSelectionColor(Color.white);
            renderer.setBackgroundNonSelectionColor(Color.white);
            renderer.setBackgroundSelectionColor(Color.gray);
            renderer.setBorderSelectionColor(Color.lightGray);
    
            leftPanel.add(tree);
    
            add(leftPane, leftGBC);
            add(rightPane, rightGBC);
        }
    
        private JPanel leftPanel;
        private JPanel rightPanel;
        private JScrollPane leftPane;
        private JScrollPane rightPane;
        private GridBagConstraints leftGBC;
        private GridBagConstraints rightGBC;
    
        private JButton Jbt1 = new JButton("Button1");
        private JButton Jbt2 = new JButton("Button2");
    
        private JLabel label = new JLabel("Enter your message below");
        private JTextArea jta = new JTextArea(10,15);
    
        private JButton Jbt3 = new JButton("Button3");
        private JButton Jbt4 = new JButton("Button4");
    }
    
  • How to get the caption of the selected option button?

    I am building a dynamic form using javascript in Adobe livecycle designer, X.  I have a group of radio buttons, optGroup, with several individual radio buttons. Later in the form, I want to refer to selection that made the user with the caption of the button selected in the option group.  I tried to use resolveNode (optGroup.selectedMember () .name + ".") caption.value. #text') .value, but this only works if the first button in the group is selected.  Otherwise, selectedMember seems to be null and the code does not work.  Any ideas?

    Thanks for your help!

    BigO

    Hello

    You can do this. I just thought it would be easier to clear values "says.

    On the basis that you have a unique name for the exclusion of radio button group, so this should work:

    this.rawValue = RadioButtonList.selectedMember().caption.value.text.value;
    

    Hope that helps,

    Niall

  • How to select radio buttons

    Hi all

    I create 5 radio buttonss.
    assign a group of radio buttons to all buttonss of radio.

    whenever I am clicking on the first buttonnn of radio
    After selecting the first radio buttonn

    automaticallyy the last option button is selectedd.

    I don't want to create the last radio buttonn

    radio button, I chose this option button is selected
    remaining all deselected r

    for these radio buttonss

    I create a page layout to format cell under a flowlayout.

Maybe you are looking for