Changing Focus of JTabbedPanes

Hai Friends,
I am on the way of developing a QUERY ANALYSER. Mean while i got a problem. in my product I am using two JTabbedPanes(1 & 2).
In TabbedPane1 i have a text area (to write the query) and the tabbedpane2 on which two panes( one for dispaying the result on a JTable and other for displaying messages.).
The problem is Ilike to view(change Focus) the message if some error occurs and shift to other pane if some results obtained to JTable.
i couldn't make it possible..
some one help me.....
Tino Simon.

1) Because you are too impatient. Your question in no
more important than anybody elses
2) Because you've already been given the solution.I am extremely SORRY Mr.camickr.
I was in a hurry to finish my module, which cause some troubles in my codes. The solution you've given really works. The problem was lack of my concentration.
Any way THANK YOU very much.
Once more I am begging Pardon.
Tino Simon.
.

Similar Messages

  • Change Focus to Other Application?

    Hi
    I would like to know if there is some way to change the focus to other applications without using Robot to manually change the focus (like the user would do) or using native methods.
    This is because one of my friends has a problem with a program that keeps taking the focus. An application can then be used to bring the focus back to the program he was currently using.
    It would be nice if there was methods for this in standard Java so we don't have to use native methods, and it would be quite a cumbersome to use Robot)
    (I have searched for it, but the only help I could find so far was about changing focus between components within your own application)

    Yes. That is what I wrote, but isn't there a smart way to do it, like using excisting classes to change focus between applications? - Maybe a class which can also iconify the other applications or such?
    I doubt it exists since it would be hard to make platform independant, but I think it's worth to look for.

  • Changing focus - window issues and .chm

    Two questions:
    1) When choosing any mailto: or website link from a .chm, a
    new window opens, as expected, but the TOC changes to "hidden."
    When click anywhere in the Help window, the TOC shows. Going back
    and forth from the message window/website and the help file, you
    will see the behavior. Our QA flagged this as a potential issue.
    Is this the expected behavior? Or, is there a setting to
    prevent it from hiding? (I would like the Contents, Search, and
    Index tabs to show when the .chm is first opened.) However, I don't
    see the purpose of the Show/Hide being activated when changing
    focus.
    2) After opening a message window or web page from a .chm,
    the Help window remains on top of the message window/web page. The
    message window is indeed active for composing (is in focus), but it
    is often necessary to reposition the help window (which is
    annoyingly still on top of the new window) to be able to
    compose--same with being able to see the full web page.
    Again, is this expected? Is there a setting for having true
    focus -- not always having the .chm stay on top but go behind when
    you change focus to compose a message or view a web page that you
    have initiated from the .chm?
    Thank you very much for any tips you can suggest.
    -- Anne Jackson
    Sr. Technical Writer, SunGard
    Ann Arbor, MI

    Anne,
    There is a setting for a window to be "top-most." I may not
    be able to tell you how to get there in RH as I use an old version.
    In the project settings, window definitions, find
    properties/advanced/extended styles and be sure Top-most window is
    deselected.
    If you can't find it in RH, you can add 2 (hex) to the
    NavPaneStyle parameter in the window definition in your .hhp file
    John

  • How to change focus in programmatic way?

    Hi,
    1. how to change focus in programmatic way?
    2. is there any way to define tab index?
    With Regards,
    Wai Phyo

    1). http://docs.oracle.com/cd/E16162_01/apirefs.1112/e17491/tagdoc/af_scrollComponentIntoViewBehavior.html
    2). no

  • JTextfield:  Changing focus, then doing stuff

    So I have 3 JTextFields that are essentially "connected" (I automate tabbing and such back and forth). I have no problem gaining focus, whether it be transferFocusBackward(), or whatever else. My problem is when getting the focus I cannot do anything with it like taking the letter the user typed and insert it into the next field.
    My code that I used is in KeyTyped and I do a
    JTextField fake = new JTextField();
    fake.transferFocus();
    JTextField newFocus = ((JTextField)KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
    newFocus.setText(String.valueOf(event.getKeyChar))
    When I check to see who the focus is on before and after I call transferFocus(), it doesn't change JTextFields (I know because I name them differently and ask their names). Does someone know a better way...that actually changes focus, when it is called, or have any workarounds?

    Nevermind I figured a workaround for it. I set the setFocusCycleRoot to true in the constructor, and then said
    JTextField fake = new JTextField();
    JTextField newFocus = ((JTextField)this.getFocusTraversalPolicy().getComponentBefore(this, fake));
    //I stuck what the user typed at the beginning of the text field...not really sure which is the better way
    newFocus.setText(event.getKeyChar()+newFocus.getText());
    fake.transferFocus();
    The reason it wasn't working is because swing hadn't actually acknowledged that the focus had changed yet...apparently this happens later.
    The reason I had asked was that there was an edge case on the three JTextField, lets say the user types something into the first text field and moves to the next field, then randomly goes back, well, when they press a letter, then they would just jump to the next JTextField, and the letter wouldn't appear...i think that would be more confusing than having the letter appear in the next text field, but meh, we'll see.

  • Activate (or change focus) on ADF Paneltab using javascript

    Hello,
    I am trying to embed an oracle form inside ADF page. I need to activate or change focus on an adf panel tab when I click on a link. I need to use javascript for this as I cannot afford a trip to the server (and hence a backing bean is not an option), as every time the page refreshes the form loses its session. Is there a way to activate/disclose a paneltab using javascript?
    Regards,
    Anirban

    This problem seems to be resolved. We can use javascript as well as a managed bean to do this. I was missing the setDisclosed(true/false) function. The best part is, even without a partial trigger or a partial submit, we can do this without refreshing the page when using a managed bean.
    When using javascript, we can use the below method:
    function f1(event) {
    var v1 = event.getSource();
    v1.setDisclosed(true);
    }

  • Key-changing focus in JLists

    Consider the following JList -
    String[] testData = {"one", "two", "three", "four", "five"};
    JList testList = new JList(testData);When testList has focus, pressing 't' will cause the selection to traverse between items beginning with 't'. This also happens when pressing 'f' or 'o', although the behaviour is somewhat inconsistent in all cases (e.g. it doesn't work all of the time).
    How to disable this behaviour? The API documentation makes no mention of it, so I assume that it is specific to PLAFs (I use Metal by default). The only solution I have found to work thus far is to invoke the following after JList initialisation -
    EventListener[] listeners = testList.getListeners(java.awt.event.KeyListener.class);
    for(int j=0; j<listeners.length; j++) {
      testList.removeKeyListener((java.awt.event.KeyListener) listeners[j]);
    }However, this seems like an absurdly heavy weight solution to such a silly problem. Is there a getter/setter I've not seen? I've already tried tinkering with InputMaps and ActionMaps, but they don't seem to have an effect.
    Cheers,
    Damien.

    I tried using the div tag and changing focus to an transparent screen so that it is seamless to the user.
    That does not work too. When you change focus by burring and then focus on the transparent screen the cursor acts wierd and remain in wait state all the time.
    Any idea what am I doing wrong here?
    V I

  • How to capture the event on changing focus from a JTextField?

    Hi All,
    I have got a problem...
    I want to do something (say some sort of validations/calculations) when I change the focus by pressing tab from a JTextField. But I am not able to do that.
    I tried with DocumentListener (jtf01.getDocument().addDocumentListener(this);). But in that case, it's calling the event everytime I ke-in something in the text field. But that's not what I want. I want to call that event only once, after the value is changed (user can paste a value, or even can key-in).
    Is there any way for this? Is there any method (like onChange() in javascript) that can do this.
    Please Help me...
    Regards,
    Ujjal

    Hi Michael,
    I am attaching my code. Actual code is very large containing 'n' number of components and ActionListeners. I am attaching only the relevant part.
    //more codes
    public class PaintSplitDisplay extends JApplet implements ActionListener
         JFrame jf01;
         JPanel jp01;
         JTextField jtf01, jtf02;
         //more codes
         public void start()
              //more codes
             jtf01 = new JTextField();
              jtf01.setPreferredSize(longField);
              jtf01.setFont(new Font("Courier new",0,12));
              jtf01.setInputVerifier(new InputVerifier(){public boolean verify(JComponent input)
                   //more codes
                   System.out.print("updating");
                   jtf02.setText("updated value");
                   System.out.print("updated");
                   return true;
              //more codes
              jtf02 = new JTextField();
              jtf02.setPreferredSize(mediumField);
              jtf02.setEditable(false);
              jp01.add(jtf02, gbc);
              //more codes
              jf01.add(jp01);
              jf01.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              jf01.setVisible(true);
              //more codes
         public static void main(String args[])
              PaintSplitDisplay psp = new PaintSplitDisplay();
              psp.start();
         public void actionPerformed(ActionEvent ae)
              //more codes
    }As you can see I want to update the second JTextField based on some calculations. That should happen when I change the focus from my frist JTextField. I have called jtf02.setText() method inside InputVerifier. But it's giving error...
    Please suggest...
    Ujjal

  • Changing focus and highlight of text in item

    Hi
    I have a field that is displaying messages on the form and I do not have it set to display only because this mucks up the custom colour settings of the text required.
    A user can navigate into this field but cannot do anything bar highlight the text. I have set up some code with a go_item in the field to take the focus away from this field if a user clicks in it. This works find but when the focus changes to the new field I have set it highlights the text in that field.
    I do not want the text highlighted, just the cursor to appear at the start of the field.
    Is it possible to suppress the text in the new focus field being highlighted when the focus moves to the new field?
    Thanks
    User605593
    Edited by: user605593 on Jan 19, 2009 2:58 AM

    I've moved it to a field that is non-updateable/deleteable so there's no chance of any data being deleted by mistake (because it's highlighted), although it would still be interesting to note how this might be done if you never had any non-updateable/deleteable fields.
    Edited by: user605593 on Jan 19, 2009 3:08 AM

  • Tab not changing focus in a JTextArea

    Hi
    I am writing a little program that at a certain point uses a JTextArea. What bugs me a lot is that the JTextArea keeps focus when I press the Tab button
    I see two solutions to this.
    Either I extend JTextArea into MyJTextArea and override the processKeyEvent method and from there address the processKeyEvent method from JTextComponent class
    so the processKeyEvent method from JTextArea never gets a chance at catching the tab.
    The second solution would be to once again extend the JTextArea class and override the processKeyEvent method, and in the method check whether tab was pressed, and in that case change the focus myself
    I don't know if the first is possible, but the second should work. I'm actually rather curious about the first one. So if anyone can help me out in either addressing the super-superclass of MyJTextArea or in changing the focus manually without creating too much of a fuss, I'd be very, very thankfull
    Thx in advance!
    Pieter

    the previous post it's rigth, you can leave the JTextArea using ctrl+tab, but if you really need pass the focus out of the JTextArea with only press tab you can do something like this     myTextArea.setDocument(new PlainDocument() {
              public void insertString(int offs, String str, AttributeSet a) throws BadLocationException {
                  if (str.equalsIgnoreCase("\t"))
                        FocusManager.getCurrentManager().focusNextComponent(myTextArea);
                   else
                        super.insertString(offs, str, a);
         }); hope this helps
    lalo s.

  • Change focus points in viewfinder

    How do I change the focus points while looking through the view finder and not the live view? I have a rebel T5.
    Thanks!

    Page 95:
    John Hoffman
    Conway, NH
    1D Mark IV, Rebel T5i, Pixma PRO-100, MX472

  • Changing focus when a value is selected in LOV

    Hi,
    I am JDeveloper 11.1.1.6.0.
    I have an LOV with auto-suggest. When the user types some characters and select some item in the list suggested, I want the focus to be on the next editable field.
    Is there any way of doing this without using Javascript?
    Thanks.

    Is there any way of doing this without using Javascript?
    Probably not.
    But maybe you can generate javascript on server side(in value change listener), similar to this: https://blogs.oracle.com/jdevotnharvest/entry/how_to_programmatically_set_focus
    Dario

  • Changing focus line in List View object?

    Hi -
    I have an list view object on my dashboard that displays about 50 lines of data, with the very first line being a total line. You can drill-into the any one item on the list view to see detail in another chart. The content of the list view is updated when the date range is change from current month to previous month.
    My question is this: if I select the 5th line item in the list view then change the date range, the list view retains the focus on the 5th line even after it is updated - so is it possible to force the list view to change the focus to the 1st line everytime the date range changes?
    I am guessing no because I see nothing in the properties of the list view that allows you to control focus.
    Thanks in Advance!

    Melissa,
    No there is no option as such in the component. May be you can use the Reset button component.
    -Anil

  • Create an Applescript to change focus order in browser

    Hey all,
    I'm curious if it is possible to create an Applescript to change the order focus within a browser.
    I have a bulk of data that needs to be entered into a database online.
    The focus order of the website design is not logical hence pressing tab to move from one field to the next results in confusion.
    (It includes buttons in headers, footers and empty fields making this extremely frustrating as I have to continuously use the mouse)
    Google search has not really given me any results, so I was hoping to build one.
    Thanks,
    Cheebs

    I think it is unlikely that you will get far with AppleScript as this normally involves reverse engineering the web page HTML/JavaScript and perhaps having a modified local copy of some or all of it.
    Are you able to paste the URL here without security implications?
    You could try looking at the source HTML of the web page.
    I am not sure if anybody makes a special web page viewer which has more control than a standard browser.

  • Changing Focus on JDialog Button

    Hi,
    I have created a JOptionPane with the optionType of YES_NO_OPTION. I then create a JDialog out of it. So the JDialog honestly does the job and Shows up a Dialog Box with YES and NO button. The Focus is set on YES button...but I want it changed to NO button....does anyone have a Idea how to do it???
    Cheers,
    Manjunath Rane

    NO It does NOT work.
    Instead I have successfully tried out by attaching a WindowListener to the Dialog I create. I then override the windowOpened method and set the requestFocus on NO Button (Getting the Handle of the NO button was a Tough task. I had iterated thru the Panels inside the JDialog to get the instance......does somebody have a Better Solution????)
    Cheers,
    Manjunath Rane

Maybe you are looking for

  • Genius says my numbers don't match and the phone has been tampered with. Can anybody help?

    I have an iPhone4S 64Gb, which I bought from the Apple Store in Covent Garden in December 2011. Recently it developed a problem where it won't shut down (it restarts itself) and the battery life has deteriorated significantly. Having read about this

  • BAPI_ACC_... Pb

    Hello, I've tried : BAPI_ACC_GL_POSTING_POST, BAPI_ACC_DOCUMENT_POST and BAPI_ACC_EMPLOYEE_EXP_POST, in order to post (F-02) some expenses note. In all cases, I don't really know how to fill the DOCUMENTHEADER-OBJ_TYPE : 'BBKPF' ? And I ve always the

  • Template won't save currency

    Gday all, I'm not sure if this is a bug, or if I'm just missing something really obvious. I have a british version of pages09, but I've now moved back to Australia so am invoicing in Oz dollars. I've created an invoice template which has a table in i

  • Regarding SAP Cariear

    Hi freinds,        Currently i m working as a SAP ABAP Condultant......from last 6 months..now i m getting a chance to learn....SAP BW,SAP XI,SAP SD................. pls,tell me which one is better for my future...........i  m very confuse....... Reg

  • Insert picture

    hallow all, I am using oracle 10g version form and i am completed one students details application but now i want to do insert students pictures throw the oracle form. 1.how to insert pictures on database through the oracle form