Dialog title to depend on tab name dynamically....

Hi,
I have an application which has a tab(Phones) and tab has a Jtable with some data.
When i press Lookup button the first tab-Jtable loads .
When i right click on a cell in the table, the corresponding row first coloumn value is shown through a dialog.
Now in the dialog the title is "Shakin", i want the dialog title to be dynamic depending on the tab(name) it is clicked i.e it depends on the tab names (like in this case Phones).
If someone click a cell in table of first tab(Phones) then the dialog title should also be Phones.
In future if i add more tabs then each tab would have dialog and each dialog title would depend on each corresponding tab name.
Can somebody suggest be what to do?
Below is the code....
     package alignment;
* @author K
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.Arrays;
import java.util.Vector;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
import javax.swing.JTable;
import javax.swing.event.TableModelEvent;
import javax.swing.table.DefaultTableModel;
public class TestJava extends JFrame {
     DefaultTableModel mtm;
     JTabbedPane tabbedPane = new JTabbedPane();
     JPanel phones = new JPanel();
     JScrollPane scroller = new JScrollPane();
     JPanel p = new JPanel(new BorderLayout());
     JPanel topPanel = new JPanel();
     JButton lookup = new JButton("Lookup");
     JTable table = new JTable();
     Dbi di;
     String[] columnNames = { "full name", "HP-URL", "address" };
     Vector cnv;
     Vector dbResult;
     public TestJava() {
          setDefaultCloseOperation(EXIT_ON_CLOSE);
          mtm = new DefaultTableModel(columnNames, 2);
          cnv = new Vector<String>(Arrays.asList(columnNames));
          table = new JTable(mtm);
          final JOptionPane pane = new JOptionPane("", JOptionPane.PLAIN_MESSAGE,
                    JOptionPane.INFORMATION_MESSAGE);
          final JDialog d = pane.createDialog(null, "Shakin'!");
          d.setModal(false);
          d.pack();
          table.addMouseListener(new MouseAdapter() {
               public void mouseClicked(MouseEvent me) {
                    if (me.getButton() == me.BUTTON3) {
                         int row = table.rowAtPoint(me.getPoint());
                         Object value1 = table.getValueAt(row, 0);
                         // JOptionPane.showInputDialog(value1,"Value is " + row);
                         pane.setMessage(value1);
                         if (!d.isVisible())
                              d.setVisible(true);
          scroller = new JScrollPane(table);
          topPanel.add(lookup);
          phones.add(scroller);
          tabbedPane.addTab("Phones", phones);
          p.add(topPanel, BorderLayout.NORTH);
          p.add(tabbedPane, BorderLayout.CENTER);
          setContentPane(p);
          pack();
          di = new Dbi();
          lookup.addActionListener(new ActionListener() {
               public void actionPerformed(ActionEvent e) {
                    fetch();
                    table.tableChanged(new TableModelEvent(table.getModel()));
                    if (pane != null) {
                         pane.setMessage("");
                    table.repaint();
     public void fetch() { // time-consuming task should be run
          Thread t = new Thread() { // in a separate thread
               public void run() {
                    dbResult = di.getQueryResult("QUERY!!!!!");
                    mtm.setDataVector(dbResult, cnv);
          t.start(); // actionPerformed() immediately returns, not blocking GUI
     public static void main(String[] args) {
          TestJava frame = new TestJava();
          frame.setVisible(true);
class Dbi { // make it a separate public class
     public Vector<Vector> getQueryResult(String query) {
          Vector<String> v1 = new Vector<String>();
          Vector<String> v2 = new Vector<String>();
          Vector<String> v3 = new Vector<String>();
          Vector<String> v4 = new Vector<String>();
          v1.addAll(Arrays.asList(new String[] { "Tim Marshall",
                    "http://tim.marshall/", "Never never land" }));
          v2.addAll(Arrays.asList(new String[] { "Com Commercial",
                    "http://com.comcom/", "Land of gold" }));
          v3.addAll(Arrays.asList(new String[] { "Love Lovable",
                    "http://love.neverhate/", "Sun lotus state" }));
          v4.addAll(Arrays.asList(new String[] { "War Monger",
                    "http://war.momongers/", "Fire and ice city" }));
          Vector<Vector> v0 = new Vector<Vector>();
          v0.add(v1);
          v0.add(v2);
          v0.add(v3);
          v0.add(v4);
          return v0;
}Thanks

Use a ChangeListener, it fires every time a new tab is selected.

Similar Messages

  • Changing tab name dynamically

    Hi All
    i've four tab pages in a portal page and i want to change the labels of these tab pages dynamically taking data from table.
    for example i've a table named TAB_TITLES with thest columns TAB_ID,TAB_NAME
    there are four rows
    TAB_ID TAB_NAME
    1 Tab-1
    2 Tab-2
    and so on
    i want to read values from this table and put the tab label in oracle portal page having tabs.
    thanks

    So .. ?
    You should have some expression of problem, information of your attempt, question about something or request for help. I do not see anything in this message like this, although it is also posted twice for no reason.
    so help others in assisting you my friend; or otherwise help yourself!

  • Can we change NAME OF TAB and ITEM NAME  dynamically at runtime in forms 6i

    Hi all,
    I have a requirement like
    1) based on organization choosen the TAB NAME AND TAB LABLE name in tab canvas should be changed dynamically. can this happen?
    example: In forms i gave the NAME and LABLE OF TAB (PROPERTY PALLET) as *'TAB_INITIAL'* and *'TAB_INITIAL'* respectively .
    when org_1 is choosen , lable should be changed to 'TAB_ORG_1' .
    when org_2 is choosen , lable should be changed to 'TAB_ORG_2'. can the NAME also be changed dynamically??
    2)Similarly can we change the ITEM NAMES present on this tab based on organization selection?
    Thanks,
    Durga Srinivas

    Hello.
    You can perform this by using:
    set_tab_page_property('Tab_page_name', label,'your_desire_label');
    and for item set_item_property.
    More details on these built-ins and also some example can be found in Forms Builder Help.
    Regards,
    Alex
    If someone's answer is helpful or correct please mark it accordingly.

  • [SOLVED] Reverting Guake terminal tab names back to 'Terminal #'

    The new version of Guake (0.4.3) implemented 'Better Tab Titling'.  This means that instead of a new tab name being 'Terminal #' (where # is an auto incrementing integer), it instead forced the title to be equal to the VTE prompt.
    My issues were that there was no way to set a preference to switch back (as I prefer the simple tab name) and that tab names could/would take a very large amount of space (as it would put my whole username@server:/path/to/where/i/am/at).
    So   I figured out how to fix and thought I'd share in case anyone else would like to switch back:
    NOTE:  I believe python is spacing-sensitive (please correct me if I'm wrong).  All the lines (added/edited) are indented 8 spaces.
    edit /usr/bin/guake
    find: self.selected_tab = None
    after that line, add:
            # holds the number of created tabs. This counter will not be
            # reset to avoid problems of repeated tab names.
            self.tab_counter = 0
    find: def on_terminal_title_changed(self, vte, box):
    after that line add:
            return
    find: Adding a new radio button to the tabbar
    the next line will read:
            label = box.terminal.get_window_title() or _("Terminal")
    change to:
            label = box.terminal.get_window_title() or _('Terminal %s') % self.tab_counter
    find self.tabs.pack_start(bnt, expand=False, padding=1)
    after that line add:
            self.tab_counter += 1
    After editing the file, restart Guake for the change to take effect.
    Beemer

    I have been using Guake for years and I think the tab bar is in the way. I disabled it a very long time ago and didn't look back.
    Here are the shortcuts that I use:
    "~" to toggle it.
    Ctrl+T for a new tab (just like in Firefox, Chromium).
    F1 and F2 for next and previous tab.
    F3 close tab.
    Basically, I don't need more than two tabs at a time; three tops, in very rare cases.
    Hope it helps.

  • Why is the tab name showing the old file type when I try to download a pdf from our wordpress sites?

    We have two wordpress sites. On each site we have uploaded some pdf files that viewers can download. I noticed that when you try to download a pdf file the tab name that appears when you click "Download" is not the same as the filename. For instance: when I try to download a pdf file titled "Weekly Retail Skeptic". In firefox - the tab name will say "Microsoft Word - Note_2013_0523_Skeptic - Note_0523_Skeptic.pdf". It seems like the browser is reading what the file was before it was converted to a pdf.
    I have tried both "print to pdf" in word as well as converting the word document to a pdf document using Acrobat.

    Hello,
    Many site issues can be caused by corrupt cookies or cache. In order to try to fix these problems, the first step is to clear both cookies and the cache.
    Note: ''This will temporarily log you out of all sites you're logged in to.''
    To clear cache and cookies do the following:
    #Go to Firefox > History > Clear recent history or (if no Firefox button is shown) go to Tools > Clear recent history.
    #Under "Time range to clear", select "Everything".
    #Now, click the arrow next to Details to toggle the Details list active.
    #From the details list, check ''Cache'' and ''Cookies'' and uncheck everything else.
    #Now click the ''Clear now'' button.
    Further information can be found in the [[Clear your cache, history and other personal information in Firefox]] article.
    Did this fix your problems? Please report back to us!
    Thank you.

  • Getting tab name or tab id or tab label at runtime

    Hi All,
    I think the answer is "no" but I'm going to ask anyway just in case I missed something.
    I am designing some authorization schemes for my application. The context behind the design is this:
    1. Two-level tabs application.
    2. Access is stored in a table where an assignment between a level 2 tab is assigned to a user (well, it's really assigned to groups of users but that's not that important for this question). The level 2 tab is assigned via a select-list LOV defined as:
    select
    tab_label d,
    tab_id r
    from apex_application_tabs
    where application_id = :APP_ID
    and workspace = :OWNER
    order by 1
    So I store the TAB_ID of the 2nd level tab and it's assigned to groups of users.
    So what I'd like is this at runtime:
    1. For page-level security, I read the Apex data dictionary and pass APP_PAGE_ID to a function that reads the page number. I traverse the tab hierarchy in APEX_APPLICATION_TABS to see if the APP_PAGE_ID resides in TAB_PAGE or TAB_ALSO_CURRENT_FOR_PAGES to get the TAB_ID. Then I check my own assignment table to see if that TAB_ID is accessible to the user. If so, return TRUE, else, return FALSE. This is working wonderfully and isn't a problem...at runtime if I navigate to a page that is on a 2nd level tab and I don't have access to the page, the security scheme errors (correctly).
    2. For tab-level security, I want that at the parent tab level that if the user has access to one or more of the 2nd level child tabs, display the parent tab.
    3. For tab-level security, if the user is on a parent tab (because he/she has access to at least one child tab), only show the child tabs to which they have access.
    Now the problem(s). The thing is that the user sees the tabs before they navigate to them (#2 and #3 I don't have working right now) and I want to hide them if they don't have access.
    For example, let's say my parent tabs are A, B, and C. Child tabs are A1, A2, A3 underneath A. B1, B2, B3 underneath B. C1, C2, and C3 underneath C.
    Let's say everything in A and underneath A (so A1, A2, and A3) are available to anyone who has a login to the application. No problem there.
    Then, let's say most or all users have access to B1 but fewer users have access to B2 and B3. What I want is that if anything from B is available to a user, show parent tab B. If the user clicks on parent tab B, then show B1, B2, and B3 but only show the tabs to which they have access (so if they have access to B1 and B2 but not B3, do not display B3).
    Then, let's say C is a very powerful administrative tab and very few people have access to it. I want to not-show C at all for people who do not have any access to C1, C2, or C3.
    The problem I have at runtime is that I cannot find a way for a tab to pass information about itself when the tab is about to paint (or not-paint). The only variable or substitution string at runtime that I can find to reference about a tab is "CURRENT_PARENT_TAB_TEXT". However this gives me only information about the parent tab's text of the parent tab that has focus right now; each parent tab cannot pass it's own info until I navigate there. I need to get that information w/o navigating to the tab first so that I can determine to show/hide the tab. Does that make sense? In other words, at runtime, I log into the system and let's say I'm not very powerful and should only be on tabs A1, A2, and A3 under A. I log in, I land on A1, and I can see A2 and A3 (good), but also I can see parent tabs B and C poking up there too. CURRENT_PARENT_TAB_TEXT does not resolve to B or C (it currently resolves to A) until I actually try to click on B or C. I need to hide B or C before the user clicks.
    Yes I can do it if I hard-code the name of the tab in a security boolean function, but I would have to have as many authorization schemes as I have tabs. This is why I want just one tab-level scheme where I pass the tab name or ID at runtime dynamically but I can't seem to reference it.
    Over in the template for two-level tabls I see #TAB_LABEL#, #TAB_NAME#, #TAB_ID#, and #TAB_LINK#. These don't seem to be available to PL/SQL to pass at runtime to a PL/SQL function. If they could, this would be my answer.
    Any other options or am I stuck on this one?
    BTW...we are on version 3.2 of Apex and going to version 4 soon. If something is available in 4 for this that helps, I can do it then.
    Ideas? Thanks!

    Hey gti_matt,
    Did you end up getting anywhere with this?
    I'm in the same boat atm...
    Thanks,
    Dan

  • Tab Name - What is going on?!

    Hi there,
    I'm having trouble with changing the tab name, it displays "Charle Fried" instead of "Charles Fried".
    I've tried changing the tab name in the page properties and adding a title prefix but nothing seems to work, any ideas?
    Thanks,
    Charles
    Edit: It only displays the wrong title when using the redirection link.

    You can only use funds in your paypal account balance if you have a verified back up credit card linked to your paypal account as well.

  • Tab name in browsers

    When opening a PDF in the browser, the tab name shows the root or path of the pdf... example...
    http://home.site.com/Blah/Blah/Blah/Document.pdf
    This creates a problem because only "htttp://home.site.com/Bl" will actually be displayed for every tab open... making it very difficult to locate a specific PDF when you have multiple PDFs open.
    Why this doesn't simply display the title of the PDF is beyond me.
    So, is this possible to change? Is this handled outside of Adobe? If so, where and how?
    Thanks.

    Have a look here: http://www.ibm.com/developerworks/cloud/library/cl-workloaddeployer-uniquetabnames/

  • Modify title of drill down tabs

    Hi All,
       Just a quick questions regarding the titles embedded in the drill down tabs. Is it possible to modify the titles? As an example, if I drill down to a level that is grouped by month, I would like the drill down tab to display "Month".
    Thank you in advance.

    There is a solution. You have to use a customized group name field
    Go to Reports->Group Expert.
    Select the Options button for the group.
    Click on the Options tab
    Select the checkbox Customize Group Name Field
    Select the radio button Use A Formula As Group Name
    Click on the fomula button
    Enter whatever you want the tab name to be, as a string. You can customize the tab to say, for instance, Order No. - 5630  by entering "Order No - " + CStr() in the formula editor
    Daniel

  • Pass column names dynamically in report

    Hello experts,
    I am creating an ALV report where i need to pass the column names dynamically. if the current month is March and year is 2009. the column names should be as below
    March 2009 April 2009 May 2009 June 2009 ..............till Feb 2010 (total columns are 12)
    if the current month is June and year is 2010 it shoud be displayed as
    June 2010 July 2010 Aug 2010................till May2011
    I am actually calculating the forecast qty for each month and displaying in a report from the current month.
    How to write field catelog for this requirement?
    Thanks in Advance.
    Rajesh.

    I think in the fieldcat, at the time of declearation, you can alter the field description depending on the present month.
    If present_month = January
    wa_fieldcat-reptext_ddic = 'January'.       " Field description
    elseif present month = February.
    wa_fieldcat-reptext_ddic = 'February'.       " Field description
    on so on.....................
    Kuntal

  • Need example to create File names dynamically using File adapter

    hello,
    I am mapping an IDOC to a flat file using XI and a file adapter. I need to be able to output a file name dynamically depending on the data in the IDOC.  For example if the IDOC has 310 as the company code, the file name should be xyz.310 and if the IDOC has 600 as the company code, the file name created by the file adapter should be xyz.600.  Please some body provide me with an example of the XSLT code that I will have to write in the dispatcher User Exit.
    Any help will be greatly appreciated.

    Nope
    But you could add a dummy row to your source to include column headers and then use options column headers in first row in flat file connection manager.
    So suppose you've three columns column0,coulmn1,column2 and you want to make it as ID,Name,Datethen make source query as
    SELECT 'ID' AS Col1,'Name' AS Col2,'Date' AS Col3, 0 AS ord
    UNION ALL
    SELECT Column1,Column2,Column3,1
    FROM YourTable
    ORDER BY Ord
    then choose  column headers in first row option
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Getting XI business system name Dynamically

    Hi All,
    I am using RFC lookup for one of our project requirment. we will be using one of our inputs as business system which hosts the RFC function module (RFC_READ_TABLE). in our dev it is our XI business system. But when we move these objects to quality or prod, this mapping fails because the name of the XI business system changes. Can anyone suggest me how we can get the xi system name dynamically.
    Best Regards,
    Deepika

    Hi Deepika
    You can use the function "Sender" or "Receiver" (depending upon whether your business system is sender or receiver) which is available under 'Constants' category in Standard funtions of Graphical mapping.
    These functions give the current value of the businees system in the environment where the interface is running.
    Let me knwo if you are still not able to pick it.
    Thanks
    Ram

  • Changing tab name in one component that used in different applications -FPM

    Hi gurus,
    I have an FPM component configuration, which have different tabs.
    This component i have used in different applications.
    I just want to know how can I dynamically change the name of one tab in different applicatins?
    I want to change only the tab name. content in the tab is same.
    For eg. If I open a Bid from Rfx, it should show "Rfx Information" as one tab name. But if i open a bid from Auction, it should show 'Auction Information'.
    Content in this tab is same.
    Is there any way to do that? Or shall I create different component config. for bid to use in Auction application  and another one for RFx application?
    Thanks,
    Poduval

    Hi, 3Sherill3. This may help:
    http://www.macupdate.com/info.php/id/16620

  • Getting the tab name

    Version: 4.1.1.00.23
    Hey,
    I need to capture the tab name when it is clicked. Is there any way to do this??
    I created dynamic breadcrumbs and when the user clicks the tab to enter a page the application items used to contain the values for the breadcrumb path are not being cleared. So when the user clicks a tab to go into the page directly the breadcrumb path is the last entry created in the trail, but it should be the only entry in the breadcrumb path.
    eg: User is on Page 1 and clicks a button bringing them to page 2 and the breadcrumb will be Page 1>Page 2.
    However, if the user clicks a tab to go directly into page 2, the breadcrumb should just be Page 2 and it's showing Page 1 > Page 2 and this is because the application items holding the values are not being cleared.
    Does someone have a solution to this?
    Thanks.
    Parth.

    psampat wrote:
    Version: 4.1.1.00.23
    Hey,
    I need to capture the tab name when it is clicked. Is there any way to do this??
    If it's a standard tab then the value of the built-in substitution string REQUEST is set to the tab name when it is clicked.
    Alternatively, query the APEX_APPLICATION_TABS view using the page ID in a Before Header computation/process in the destination page, something like:
    select
              aat.*
    from
              apex_application_tabs aat
    where
              aat.application_id = :app_id
    and       (   aat.tab_page = :app_page_id
               or instr(
                      ',' || aat.tab_also_current_for_pages || ','
                    , ',' || :app_page_id || ',') > 0)

  • Getting Tab Name or Tab Id

    Hello,
    In my page I have 4 tabs. I would like to get the tab name or tab id to pass to my pl/sql procedure. When user clicks the tab, I am passing certain parameters to the plsql procedure. So is there any way i can uniquely get the tab name or tab id?
    Thanks in advance
    Regards

    well,
    it is still vague for me to understand what do you mean by getting tab name from URL.
    perhaps what you intend to have is a programmatic way of finding tab name from URL.
    for that in 10.1.4 as the query strings do not work that way, so you may use the following API function call and use it to write some custom function. (note that it will work when you will call it from some page on your portal).
    portal30.wwctx_api.get_path_infothis gives typically a result like this depending upon the page address/location (and provided that you are on a tab of a multi-tab page):
    /!PORTAL30.wwpob_page.show/SHARED/U/PAGE_GRP/PAGE_NAME/TABNAMEhope that helps!
    AMN

Maybe you are looking for

  • HP 6510 AIO Printer

    HP can make my New Year a marvalous one by developing an OCR app that is compatable with the HP 6510 Printer. What is OCR you ask? Well, OCR stands for Optical Charcter Recognition and what that does is; it enables you to scan a form and have the abi

  • How do you autosize column widths in a multicolumn listbox?

    I know that it's possible to autosize row height, but I can't find anything relating to autosizing column widths in a multicolumn listbox. This makes what I'm doing difficult, because I want to be able to have dynamic content and won't know beforehan

  • Help whit action script.

    Hello out there are there any of you out there who can help me get my image display system to work? I have been following advances script from my main site: function onFinish(success_boolean, gallery_obj, xml)     if (success_boolean)         play ()

  • TS3938 PC applications no longer supported how can I open word documents

    How can I open a word document?

  • EFFECT OF CANCELLING INVOICE ALREADY CLEARED IN ACCOUNTING

    Hi Expert I want to know the effect of cancelling an invoice already cleared in accounting. Please note that I did not reset the cleared document before cancelling the invoice. what is the effect and how do i resolve this. Thanks in advance Eki