How to request focus for Panel hiding behind another panel?

Hi guys,
I have two panels(of different sizes) within a JFrame, i have one button (in smaller panel)that does some query in the back end & populates the results in another panel (bigger panel), now assuming that i am in smaller panel, how is that i can bring up the bigger panel that is hiding behind this smaller panel.
I tried using requestFocus method but its not working.
Can anyone help me in this regard?
Thanks & Regards,
Vishal

Thanks for your feedback, but i am not using card layout instead i am using a Grid bag layout, i dont see any method like next() or show() for a instance of GridbagLayout.
Any other alternative?
Thanks & Regards,
Vishal

Similar Messages

  • Problem with requesting focus for a list

    Hi there !
    What would be the right way to request focus for a list component ?
    I can use select() method to select some item from a list, but the list itself still hasn't got a focus until I click it.
    What I'd like to do is to be able to highlight some item from the list by using up and down arrow keys only, without clicking the list first =)

    The list is visible, but still this doesn't work.
    I think that the reason for this may be that I'm running this app on Nokia 9210 Communicator emulator. The emulator itself has had some not-so-minor problems...

  • Requesting focus for JTextField inside JPanel

    I have an application with following containment hierarchy.
    JFrame --> JSplitPane --> JPanel.
    JPanel is itself a seperate class in a seperate file. I want to give focus to one of the JTextfields in JPanel, when the JPanel is intially loaded in the JFrame. I believe that I cannot request focus until the JPanel is constructed. I can set the focus from JFrame (which loads JPanel) but I want to do this from JPanel. Is there any technique to request focus from the JPanel itself (preferably during JPanel construction).
    regards,
    Nirvan.

    I believe that I cannot request focus until the JPanel is constructedYou can't request focus until the frame containing the panel is visible. You can use a WindowListener and handle the windowOpened event.

  • Request focus for message area

    Dear All,
    As my screen is long hence if an error comes we will require to scroll down so I have added a message area UI element and in do modify method of the view i have request focus to my message area but it is not working.  Below is the code which I have written:
    try{
              IWDMessageArea msgarea=(MessageArea)view.getElement("MessageArea");
            msgarea.requestFocus();
            catch(Exception e)
    Is there any other property or changes need to be made.
    Thankyou.
    Regards,
    Santosh

    Hi,
    In would say, create an input field at the top left corner of the screen. Set its width to zero and bind it to a context attribute say Va_ShowMesg of type string. Now insert a MessageArea UI element just below the inputfield to display all the erro message at the top left.
    Now if you request focus for the input field using the following code, the focus will automatically come to the Message Area as well.
    wdThis.wdGetAPI().requestFocus(wdContext.currentContextElement(),wdContext.getNodeInfo().getAttribute(
              wdContext.currentContextElement().VA__SHOW_MESG));
    You can call this code whenever you need to display message to user in the message area and shift focus of the screen to the message displayed.
    Regards,
    Tushar Sinha

  • How to request acknowledgments for Enterprise services

    Hi Experts,
    We are using enterprise services for our outbound interfaces in retail system, how do we request acknowledgements for these messages, is there any setting we need to make???
    we are not using any custom proxy programs, these are SAP standard programs, if anyone done before please let me know

    Hi,
    At this moment I don't think you can do that. I think that the philosophy is that once the service call was succesfull you shoul safely assume it went ok. you could probably create a scenario that once the receiver system generates an ack it is routed back somehow.
    if you want it for an inbound interface (sending towards ecc) I think you need some custom code

  • How to animate an object that goes behind another

    Does anyone know how to go about animating a movie clip that would go behind another movie clip?
    For instance: A stack of photos, that on click, the top photo would animate to the left (or right) and then animate to the back of the stack. My only problem is that i don't understand how to change the order of things, or if this is even possible (as essentially eveything is on layers), the only way i can think of is to have everything on one layer, but then this would interupt the animation of each photo
    Cheers

    I'd use a combination of the setChildIndex() function and AS3 transitions. I would create a top layer see-through (alpha value 0) movieclip. When the user clicks on this top layer, animate "fly" the top pic out using the FLY transition in fl.transitions. Then use setChildIndex() to shuffle the pics however you want.
    A bit about setChildIndex(). The highest number is the pic on top; 0 is on the bottom:
    setChildIndex(TOP-PIC_movieClip,N); /* transparent pic that is always on top */
    setChildIndex(picture2_movieClip,2);
    setChildIndex(picture1_movieClip,1);
    setChildIndex(BOTTOMPIC_movieClip,0); /* blank pic used as placeholder for shuffles */
    Add an onClick event to the transparent layer, which shuffles the setChildIndex() values as the user clicks the top layer pic, thus changing the pic that they see:
    TOP-PIC_movieClip.addEventListener(
      MouseEvent.CLICK,
      function(evt:MouseEvent):void
    Now you have to code a little function that adjusts the setChildIndex VALUES. I don't have time to code it out, but here's some guidelines:
    a. When the user clicks, use setChildIndex() to set the value of the top picture (NOT the transparent layer on top--the top pic) to 0, moving it to the bottom. Remember that we reserved setChildIndex() space 0 for shuffles, so that we don't overwrite anything.
    b. Set up a loop to make the setChildIndex of the Nth clip to the N-1 clip. This rotates the pics into their new positions.
    c. Note that the picture in setChildIndex() space 1 will always be the same as in space 0.
    The AS3 fly transition example:
    http://www.onebyonedesign.com/tutorials/transMgr/scriptTrans.html
    http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/fl/transitions/Fly.html
    setChildIndex() page:
    http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObjectConta iner.html#setChildIndex%28%29
    mouseEvent.CLICK:
    http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/events/MouseEvent.html#CLICK
    Hope this helps!
    Love,
    Boletus edulis

  • How to 'hide' one stroked-only object behind another?

    I'm struggling with something that shouldn't be this difficult!
    I'm laying-out a white-only T-Shirt logo (to go on a dark-green T-shirt)
    For the sake of simplicity, let's say I have two ovals with no fill, just a white stroke.  A small oval overlapping (on-top-of) part of the edge of a larger (underneath) oval.    I
    Any advice on how to 'hide' the line that's 'behind' the top object?
    Thusly: http://i.imgur.com/ZghWTMa.jpg  

    Actually, I'm not completely sure yet.
    Steve's answer assumes screen printing with a single opaque white ink. It won't work if printing to non-opaque composite transfers, or cutting from aplique vinyl, or if you're going to import the two-ellipse artwork for combination with other artwork.
    Since you don't know:
    1. Draw the two circles with a stroke color and a fill color (ex: black Stroke, white fill) on both.
    2. Apply the desired stroke weight.
    3. Object>Path>Outline Stroke.
    4. Pathfinder palette: Merge.
    5. White pointer: Select the two inside regions and delete.
    6. You now have a single Compound Path; no overlapping objects, and actual "holes" where you want the substrate to show through. Apply whatever fill color (white, etc.) you need.
    But bear in mind what has already been stated: White, unless defined as a Spot Color, does not "print." Think in terms of inks, not in terms of "color". In a program like Illustrator, "white" normally means "no ink." And you always have to know what printing method you are designing for.
    JET

  • How can transfer data from a dialog to another panel?

    Will anyone help me?Thanks.
    In our project,When the user need to fill some data into the textfield in a panel,he can simplify this action by click a button,when the button is clicked,then a dialog which contains a table of all the imformation of all customers will show,then the user can select one customer's information from the table,after click a button such as "OK",the selected information will show in corresponding textfiled in another panel.Because the dialog and the panel are two
    different object,so how can I transfer the data selected from the dialog to the panel and show the updated information timely??

    try this program. it exchanges some data between s adialog and a frame.
    akz
    * @version 1.20 01 Sep 1998
    * @author Cay Horstmann
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class DataExchangeTest extends JFrame
    implements ActionListener
    {  public DataExchangeTest()
    {  setTitle("DataExchangeTest");
    setSize(300, 300);
    JMenuBar mbar = new JMenuBar();
    setJMenuBar(mbar);
    JMenu fileMenu = new JMenu("File");
    mbar.add(fileMenu);
    connectItem = new JMenuItem("Connect");
    connectItem.addActionListener(this);
    fileMenu.add(connectItem);
    exitItem = new JMenuItem("Exit");
    exitItem.addActionListener(this);
    fileMenu.add(exitItem);
    public void actionPerformed(ActionEvent evt)
    {  Object source = evt.getSource();
    if (source == connectItem)
    {  ConnectInfo transfer= new ConnectInfo("yourname", "pw");
    if (dialog == null)
    dialog = new ConnectDialog(this);
    if (dialog.showDialog(transfer))
    {  String uname = transfer.username;
    String pwd = transfer.password;
    Container contentPane = getContentPane();
    contentPane.add(new JLabel("username=" + uname + ", password=" + pwd),"South");
    validate();
    else if(source == exitItem)
    System.exit(0);
    public static void main(String[] args)
    {  JFrame f = new DataExchangeTest();
    f.show();
    private ConnectDialog dialog = null;
    private JMenuItem connectItem;
    private JMenuItem exitItem;
    class ConnectInfo
    {  public String username;
    public String password;
    public ConnectInfo(String u, String p)
    { username = u; password = p; }
    class ConnectDialog extends JDialog implements ActionListener
    {  public ConnectDialog(JFrame parent)
    {  super(parent, "Connect", true);
    Container contentPane = getContentPane();
    JPanel p1 = new JPanel();
    p1.setLayout(new GridLayout(2, 2));
    p1.add(new JLabel("User name:"));
    p1.add(username = new JTextField(""));
    p1.add(new JLabel("Password:"));
    p1.add(password = new JPasswordField(""));
    contentPane.add("Center", p1);
    Panel p2 = new Panel();
    okButton = addButton(p2, "Ok");
    cancelButton = addButton(p2, "Cancel");
    contentPane.add("South", p2);
    setSize(240, 120);
         //custom method to create and buttons to a container
    JButton addButton(Container c, String name)
    {  JButton button = new JButton(name);
    button.addActionListener(this);
    c.add(button);
    return button;
    public void actionPerformed(ActionEvent evt)
    {  Object source = evt.getSource();
    if(source == okButton)
    {  ok = true;
    setVisible(false);
    else if (source == cancelButton)
    setVisible(false);
    public boolean showDialog(ConnectInfo transfer)
    {  username.setText(transfer.username);
    password.setText(transfer.password);
    ok = false;
    show();
    if (ok)
    {  transfer.username = username.getText();
    transfer.password = password.getText();
    return ok;
    private JTextField username;
    private JTextField password;
    private boolean ok;
    private JButton okButton;
    private JButton cancelButton;

  • Control tooltip on a panel overlapped by another panel.

    I have asked this question before but I try again.
    Is there any workaround so that the tooltip can be displayed when the location where the tooltip normaly displays is overlapped by another panel ?
    Could I control the position to either left/right instead of below ?
    Solved!
    Go to Solution.

    I'm not sure I completely understand the premise of the question. While it's true that the position of the tooltips cannot be controlled, I'm having a hard time understanding how the tooltips could be overlapped by something else, given that they are floating windows, as Wolfgang pointed out.
    I considered the possibility that you meant "overlapped by another child panel" or "overlapped by another too-level panel". If the tooltip was going to be covered by a child panel, it should definitely display above that panel:
    (In these screenshots, "Text Message" is the control with the tooltip).
    If you meant a top-level panel, then this is a bit trickier to reproduce, since in order for the tooltip to trigger, the panel that holds the control with the tooltip must be the active panel. Therefore, the only way that another top-level panel could overlap that region would be if the other panel was floating. In that case, you have two floating windows. But when I tested it, the tooltip was still on top (I guess because it was created last):
    So, I'm not sure how you were able to cover up a tooltip. Could you maybe post a screenshot, so that I can understand it better?
    Thanks,
    Luis

  • How to set Focus for one component on Dialog

    Hi all.
    I have a problem and need a help
    I have a JDialog
    I add some components on it. Includes button, textfield...
    after i set
         _textField.requestFocus()When Dialog show, it always focus at first component, not at the component i set.
    Please help me.
    Thanks in advance
    Diego

    Perhaps Swings threading ruins your focus request, and trying invokeLater may be worthwhile...
    Note that [requestFocusInwindow()|http://java.sun.com/javase/6/docs/api/javax/swing/JComponent.html#requestFocusInWindow()] is to be preferred over requestFocus according to the API docs.
    Edited by: isocdev_mb on Mar 4, 2010 6:05 AM

  • How to create iView for WDPApplication deployed in another server instance?

    hi experts,
    I am in the Enterprise Portal (Server01), need to create iViews for deployed WDP applications (Server02).
    When creating a new iViews, i can only get WDP applications deployed in Server01 as in [this screen|http://img98.imageshack.us/img98/6361/newiview.png].
    My question is, is it possible for me to create iViews in Server01 for WDP applications deployed in Server02? How??
    Thanks in advance.
    Regards,
    kityein

    Hi,
    You can either go with an [url|http://help.sap.com/saphelp_nw70/helpdata/en/4c/eee2bedf3b4082b14a933e5ee63472/frameset.htm] iView or might want to check with [federating|http://help.sap.com/saphelp_nw70/helpdata/en/67/7e70424edcc553e10000000a1550b0/frameset.htm] your portals.
    Kind Regards,
    Mrityunjay.

  • How to use upgrade for primary number on another number

    The primary phone on our family contract is eligible for an early upgrade now but we want to upgrade the other phone.  Can this be done online or must I go to a Verizon store to do the switch?
    As an aside, I want a smartphone so I can have a single device rather than a phone + Palm Pilot.  I'm not really interested in a data plan, but it is required for a smartphone.  Having read some of the postings, I know I'm not the only one annoyed by the requirement to have a data plan with a smartphone. 

    orchid wrote:
    The primary phone on our family contract is eligible for an early upgrade now but we want to upgrade the other phone.  Can this be done online or must I go to a Verizon store to do the switch? To use your annual upgrade, the easiest way will be to just upgrade as normal online or over the phone.  When the new phone arrives, activate it briefly on the primary line following the instructions included with the phone.  Once it's activated, you will have accepted the terms of your new contract, and you can re-activate the phone that was previously on that line by dialing *228 and selecting option 1 from the old phone.  The new phone will now be available to activate on any Verizon line you would like.
    As an aside, I want a smartphone so I can have a single device rather than a phone + Palm Pilot.  I'm not really interested in a data plan, but it is required for a smartphone.  Having read some of the postings, I know I'm not the only one annoyed by the requirement to have a data plan with a smartphone.  Yes, it is annoying.  There's nothing you can do to get away from it though, so you'll just have to decide if carrying one device is worth the premium of a $15 or $29.99 monthly data fee.

  • How to use PropertyChangeSupport for a bean from another bean

    Hi all,
    I have a bean A that doesnot implements the PropertyChangeListener or have a PropertyChangeSupport as one of its member and I cant change its design. I want to fire an PropertyChangeEvent when a property is changed. I added A to PropertyChangeSupport of another bean B. The problem is that even if the Property of Bean A is changed it doesnot fire a event. Can anybody let me know how to do it?
    Thanks,
    Amit

    You need to wrap bean A inside another bean (B) that
    implements the accessor and mutator methods of Bean A
    and adds property change support in those methods
    where appropriate. You hide the actual instance of
    bean A inside an instance of bean B so no instances of
    bean A are visible to the application.This is OK, unless you don't want to change all places where A is referenced. You could subclass B from A, as long as the accessor and mutator methods are not final. Of course, instantation still has to know about B and you will have to cast to B, or use reflection, to add and remove the listeners.

  • Datagrid focus for cell

    Hi,
    how to set focus for perticuler cell or row in datagide
    using flex 3 .Flex 2 Beta 1:
    var __focusedCell:Object = new Object();
    __focusedCell.itemIndex = 1;
    __focusedCell.columnIndex = 2;
    dg.setFocusedCell(__focusedCell,true);
    Flex 2 Beta 2:
    var __focusedCell:Object = new Object();
    __focusedCell.rowIndex = 1;
    __focusedCell.columnIndex = 2;
    dg.setEditedItemPosition(__focusedCell);
    but this functions
    (dg.setFocusedCell,dg.setEditedItemPosition) are not working in
    flex 3.0. please let me know if any body known this one

    Perhaps you could try:
    myGrid.selectedItem = -1;

  • Focus problems, not sure how to make focus work correctly

    I have a number of dialog boxes and wizards, and just before I call show I request focus for the component I want to be displayed, but nothing happens. I think the show method it JDialog is setting the focus, and that this is the problem.
    I want behavior to work as expected ie.focus to start at top left component and work its way down. Instead it seems to be giving fucos in the order the components were added, or soething like that. Does anyone know if this is indeed the case? I have many widgets which add components in the superclass, so this could cause me problems.
    I do not want to create a focus manager, but if worse comes to worse, I will - this is a problem that is unacceptable to the client.
    Any suggestions or comments?
    btw I am using 1.3.1 and win2k for the OS.

    Hi,
    addWindowListener(new java.awt.event.WindowAdapter() {
    public void windowActivated(java.awt.event.WindowEvent evt) {
    formWindowActivated(evt);
    protected void formWindowActivated(java.awt.event.WindowEvent evt) {
    // Add your handling code here:
    getFocusFor(yourFirstComp );
    private void getFocusFor(final JComponent comp ){
    SwingUtilities.invokeLater(new Runnable() {
              public void run() {
              comp.setRequestFocusEnabled( true );
              comp.requestFocus();
    }

Maybe you are looking for