How can I use an invisible method  in TreePath??

Dear Friends:
I hope to use TreePath in following program to create another new TreePath with updated Object.
in following statement:
TreePath newObject = new TreePath(tree.getSelectionPath(),"NewPathHere");
I hope to keep same TreePath, but with new info.
anything wrong??
But it gets error:
The constructor TreePath(TreePath, Object) is not visible
Here the method is protected, I extends this TreePath class,
Why I cannot use this method to create a new TreePath with updated Info??
Regards
sunny
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.tree.*;
import java.awt.*;
public class JTreeTraverse extends TreePath{
  public static void main(String args[]) {
    JFrame fm = new JFrame("JTree Traverse frame");
    String object[] = { "Cricket", "Hokey", "Football" };
    JTree tree = new JTree(object);
    tree.setRootVisible(true);
    TreeModel treemodel = tree.getModel();
    Object TraverseObject = treemodel.getRoot();
    if ((TraverseObject != null) && (TraverseObject instanceof
                 DefaultMutableTreeNode)) {
    TreeSelectionListener treeListener = new TreeSelectionListener() {
      public void valueChanged(TreeSelectionEvent treeSelectionEvent) {
        JTree tree = (JTree) treeSelectionEvent.getSource();
        TreePath object = tree.getSelectionPath();
        System.out.println(object);
        System.out.println(object.getPath());
        TreePath newObject = new TreePath(tree.getSelectionPath(),"NewPathHere");
        System.out.println(object);
        System.out.println(object.getPath());
    tree.addTreeSelectionListener(treeListener);
    JScrollPane scroll = new JScrollPane(tree);
    fm.getContentPane().add(scroll, BorderLayout.CENTER);
    fm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    fm.setSize(200, 200);
    fm.setVisible(true);
}

Dear Friends:
I hope to use TreePath in following program to create another new TreePath with updated Object.
in following statement:
TreePath newObject = new TreePath(tree.getSelectionPath(),"NewPathHere");
I hope to keep same TreePath, but with new info.
anything wrong??
But it gets error:
The constructor TreePath(TreePath, Object) is not visible
Here the method is protected, I extends this TreePath class,
Why I cannot use this method to create a new TreePath with updated Info??
Regards
sunny
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.tree.*;
import java.awt.*;
public class JTreeTraverse extends TreePath{
  public static void main(String args[]) {
    JFrame fm = new JFrame("JTree Traverse frame");
    String object[] = { "Cricket", "Hokey", "Football" };
    JTree tree = new JTree(object);
    tree.setRootVisible(true);
    TreeModel treemodel = tree.getModel();
    Object TraverseObject = treemodel.getRoot();
    if ((TraverseObject != null) && (TraverseObject instanceof
                 DefaultMutableTreeNode)) {
    TreeSelectionListener treeListener = new TreeSelectionListener() {
      public void valueChanged(TreeSelectionEvent treeSelectionEvent) {
        JTree tree = (JTree) treeSelectionEvent.getSource();
        TreePath object = tree.getSelectionPath();
        System.out.println(object);
        System.out.println(object.getPath());
        TreePath newObject = new TreePath(tree.getSelectionPath(),"NewPathHere");
        System.out.println(object);
        System.out.println(object.getPath());
    tree.addTreeSelectionListener(treeListener);
    JScrollPane scroll = new JScrollPane(tree);
    fm.getContentPane().add(scroll, BorderLayout.CENTER);
    fm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    fm.setSize(200, 200);
    fm.setVisible(true);
}

Similar Messages

  • How do i get a list of all Roles defubed under a particular OrganizationalUnit? How can i use LDAPConnection.search method for this?

     

    Sorry for the typographical mistake.
    Please read the question as:"How do i get a list of all Roles defined under a particular OrganizationalUnit? How can i use LDAPConnection.search method for this?"

  • How can i use Catalog in Method Type?

    Dear Experts,
    How can i use Catalog in Method Type?
    I want to use Multiple method type mean require selection option(help from catalog)and also need to entere the result against certain parameters. So how can i do this possible ?
    Except use of additional infrmation field
    Regards,
    Abhishek

    Hi,
    Can i provide selection option F4 help at Method while enteing the result?
    Because for 1 MIC as per buyer method testing different so it will come alternately.
    i.e i have 3 methods which comes altarnative for one MIC
    TST_ISO
    TST_AATC
    TST_ASTM
    So how it is possible???

  • How can I use a COM Method?

    There are a method in a dll.
    And method is a COM Method. I use DLL Export Viewer to look properties.
    I use Form Developer 6.0.

    I dont how a com method is invoked. I assume u r using 6i client server.
    You can use host method to invoke any executable or you might need to try ORA_FFI
    Is this COM method can be converted to an executable?
    How do you call this com method other than forms?
    Rajesh

  • I just made a new account and i placed the account in my ipod but now its asking me submit a payment method which i do not want to place because i do not want to purchase any app that requires money. how can i use my account without giving a payment metho

    now asks me to put in my payment method. i do not wish to place it in because i am not looking forward to purchase any app that needs to be paid for. How can i use my account but not give in my credit card data?

    Create a NEW account/ID using these instructions. Make sure you follow the instructions. Many do not and if you do not you will not get the None option. You must use an email address that you have not used with Apple before. Make sure you specify a birthdate that results in being at least 13 years old
      Creating an iTunes Store, App Store, iBookstore, and Mac App Store account without a credit card
    More details of how:
    http://ipadhelp.com/ipad-help-tips-tricks/how-to-get-free-apps-from-the-app-stor e-without-a-credit-card/

  • How can I use my array in another method.... Or better yet, what's wrong?

    I guess I'll show you what I am trying to do rather and then explain it
    public class arraycalc
    int[] dog;
    public void arraycalc()
    dog = new int[2];
    public void setSize(int size)
    dog[1] = size;
    public int getSize()
    return dog[1];
    This gives me a null pointer exception...
    How can I use my array from other methods?

    You have to make the array static. :)
    Although I must admit, this is rather bad usage. What you want to do is use an object constructor to make this class an object type, and then create the array in your main class using this type, and then call the methods from this class to modify your array. Creating the array inside the other method leads to a whole bunch of other stuff that's ... well, bad. :)
    Another thing: Because you're creating your array inside this class and you want to call your array from another class, you need to make the array static; to make it static, you must make your methods static. And according to my most ingenious computer science teacher, STATIC METHODS SUCK. :D
    So, if you want to stick with your layout, it would look like:
    public class arraycalc
         static int[] dog;
         public static void arraycalc()
              dog = new int[2];
         public static void setSize(int size)
              dog[1] = size;
         public static int getSize()
              return dog[1];
    }But I must warn you, that is absolutely horrible code, and you shouldn't use it. In fact, I don't even know why I posted it.
    You should definitely read up on OOP, as this problem would be better solved by creating a new object type.

  • How can I use Method in the bean

    Hi every one
    please I made a method in for example employees entity "EmployeesImpl"
    the name of method getmax() it return number
    how can I use it at the bean
    for eaxmple when I want to press button give me the value from this method
    sorry Iam still beginner
    thanks in advance

    Thanks sir for your response
    my version
    oracle jdeveloper reales 1 (11,1,1,4,0)
    I use business component
    I make method
    this metod wrote at enitity "EmployeesImpl"
    public Number getMax() throws JboException
    PreparedStatement stat=null;
    ResultSet rs=null;
    try {
    String sql="select max(EMPLOYEE_ID)+1 from EMPLOYEES";
    stat=getDBTransaction().createPreparedStatement(sql, 1);
    rs=stat.executeQuery();
    if (rs.next()) {
    return new Number (rs.getInt(1));
    } catch (Exception e) {
    // TODO: Add catch code
    //e.printStackTrace();
    throw new JboException("error");
    } finally {
    try {
    rs.close();
    stat.close();
    } catch (Exception e) {
    // TODO: Add catch code
    //e.printStackTrace();
    // oracle.jbo.domain.Number
    return new Number (1);
    I made a jsf page
    and I put button at the page
    I want when press the button give me message contain the number which come from previous metod
    thanks my dear

  • How can I use srvctl command line for change "Failover type" and "F method"

    Hi all,
    I am using Oracle One Node (11.2.0.3), and I have a service:
    /u01/11.2.0/grid/bin/srvctl config service -d orcl
    Service name: orcldb
    Service is enabled
    Server pool: orcl
    Cardinality: 1
    Disconnect: false
    Service role: PRIMARY
    Management policy: AUTOMATIC
    DTP transaction: false
    AQ HA notifications: false
    Failover type: NONE
    Failover method: NONE
    TAF failover retries: 0
    TAF failover delay: 0
    Connection Load Balancing Goal: LONG
    Runtime Load Balancing Goal: NONE
    TAF policy specification: BASIC
    Edition:
    Preferred instances: orcl_1
    Available instances:
    I would like to change "Failover type" and "Failover method" to:
    Failover type: SELECT
    Failover method: BASIC
    How can I do that? Is there any graphical tool for it? Or, How can I use srvctl command line for change it?
    Thanks in advance.
    Leonardo.

    user10674190 wrote:
    Hi all,
    I am using Oracle One Node (11.2.0.3), and I have a service:
    /u01/11.2.0/grid/bin/srvctl config service -d orcl
    Service name: orcldb
    Service is enabled
    Server pool: orcl
    Cardinality: 1
    Disconnect: false
    Service role: PRIMARY
    Management policy: AUTOMATIC
    DTP transaction: false
    AQ HA notifications: false
    Failover type: NONE
    Failover method: NONE
    TAF failover retries: 0
    TAF failover delay: 0
    Connection Load Balancing Goal: LONG
    Runtime Load Balancing Goal: NONE
    TAF policy specification: BASIC
    Edition:
    Preferred instances: orcl_1
    Available instances:
    I would like to change "Failover type" and "Failover method" to:
    Failover type: SELECT
    Failover method: BASIC
    How can I do that? Is there any graphical tool for it? Or, How can I use srvctl command line for change it?
    Thanks in advance.
    Leonardo.srvctl modify service -d database_name -s orcldb -q TRUE -m BASIC -P BASIC -e SELECT -z 180 -w 5 -j LONG
    Also see
    11gR2(11.2) RAC TAF Configuration for Admin and Policy Managed Databases [ID 1312749.1]

  • HT201359 How can I use PayPal as my payment method?

    How can I use PayPal as my payment method for my apple account?

    Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • How can I use 2 Apple IDs in Itunes? I have 2 IOS Devices. They each have there own AppleID. What is the proper way to sync both of them to Itunes?

    How can I use 2 Apple IDs in Itunes? I have 2 IOS Devices. They each have there own AppleID. What is the proper way to sync both of them to Itunes? I wanted my teenager's AppleID to be different from mine so that she couldn't charge stuff to my AppleID, therefore I created me another one. Now when I go to Sync either device, it tells me that this IOS device can only be synced with one AppleID. Then I get a message to erase it, not going to do that, lol. If I logout as one ID and login as the other, will it still retain all synced information on the PC from the first IOS device? If I can just log in out of the AppleID, then I have no problem doing that as long as the synced apps, music, etc stays there for both. I am not trying to copy from one to the other, just want to make sure I have a backup for the UhOh times. If logging in and out on the same PC of multiple AppleIDs is acceptible then I need to be able to authorize the PC for both devices. Thanks for the help. I am new to the iOS world.

    "Method Three
    Create a separate iTunes library for each device. Note:It is important that you make a new iTunes Library file. Do not justmake a copy of your existing iTunes Library file. If iTunes is open,quit it.
    This one may work. I searched and searched on the website for something like this, I guess I just didn't search correctly, lol. I will give this a try later. My daughter is not be back for a few weekends, therefore I will have to try the Method 3 when she comes back for the weekend again. "
    I forgot to mention that she has a PC at her house that she also syncs to. Would this cause a problem. I am already getting that pop up saying that the iPod is synced to another library (even though she is signed in with her Apple ID to iTunes) and gives the pop up to Cancel, Erase & Sync, or Transfer Purchases. My question arose because she clicked on "Erase & Sync" by mistake when she plugged the iPod to her PC the first time. When the iPod was purchased and setup, it was synced to my PC first. When she went home, she hooked it up to her PC and then she erased it by accident. I was able to restore all the missing stuff yesterday using my PC. However, even after doing that it still told me the next time I hooked it up last night that the iPod was currently synced with a different library. Hopefully, you can help me understand all this. She wants to sync her iPod and also backup her iPod at both places. Both PCs have been authorised. Thanks

  • How can i use Button in BEx  7.0

    Dear Folks,
    Could you help me please ..
    In BI 7.0, for BEx analyzer i see we can use button, combo box, analysis grid.
    If i have a requirement like this:
    1. I have sales report, where it has information about sales person.
    2. And i want to filter that report with the sales person that i choose from combo box.
    For that requirement, i tried to :
    1. I Create a query to Sales info-provider for displaying sales.
    2. I Create a query to either to MD Sales person / Sales info-provider in order to get Sales persons data.
    3. I assign point no 1 to Analysis Grid.
    4. I assign point no 2 to Combo box.
    My questions are:
    a. Is my techniques correct ??
    b. How can i use button to execute filter into the corresponding report ???
    c. Is there any tutorial regarding this ?? Could you share it to me please ..
    Really need your guidances..
    regards,
    Niel..

    Hi Niel,
    You can use the method you specified.
    In Bex Analyzer you have design mode where you can have the following items Button, Analysis Grid and Combo box.
    To work with the button you need to use the Command Wizard which consists of pre-defined functions, out of those select the one which suits your requirement and supply the parameters. As it is done thorugh a Wizard it would be easy to do.
    Also,
    The Button Name displays the name of the button, which is generated automatically and is unique. This name is used on the BEx Analyzer Design Toolbar menu to refer to a particular instance of the button.
    · Range u2013 Manipulate coordinates for a cell or cells in this field to move or resize the button.
    · Button Text - The text (caption) you want to display on the button. You can use this to describe the command the button executes.
    · Command Range (optional) - Specify a three-column range of cells in the worksheet that contains command parameters. In these cells, you provide the same parameters (Name, Index, and Value) as in the Static Parameters, but in the worksheet these can be variable, changing during
    navigation based on query results or on a value you manually specify.
    Button in Bex analyzer
    Regards,
    Neelesh Jain.

  • HT2534 How can I use "Family Sharing" without giving details of my credit or debit card? I do not want to give my cards data, I have always used iTunes prepaid cards.

    How can I use "Family Sharing" without giving details of my credit or debit card? I do not want to give my cards data, I have always used iTunes prepaid cards.

    Hi Saramos,
    When setting up Family Sharing you must have a credit or debit card as your payment method. See this article for reference -
    Family purchases and payments
    When a family member makes a purchase it will be billed to any gift or store credit that they have first. If none exists it will be billed to you.
    As the family organizer, you may not set your billing method for purchases to anything other than a credit or debit card. If you have a store credit such as from pre-paid cards, it may not be shared with other family members. See this article for reference -
    How iTunes Store purchases are billed
    Thanks for using Apple Support Communities.
    Best,
    Brett L 

  • How can I use "Family Sharing" without giving details of my credit or debit card? I do not want to give my cards data, I have always used iTunes prepaid cards.

    How can I use "Family Sharing" without giving details of my credit or debit card? I do not want to give my cards data, I have always used iTunes prepaid cards.

    Hi Saramos,
    When setting up Family Sharing you must have a credit or debit card as your payment method. See this article for reference -
    Family purchases and payments
    When a family member makes a purchase it will be billed to any gift or store credit that they have first. If none exists it will be billed to you.
    As the family organizer, you may not set your billing method for purchases to anything other than a credit or debit card. If you have a store credit such as from pre-paid cards, it may not be shared with other family members. See this article for reference -
    How iTunes Store purchases are billed
    Thanks for using Apple Support Communities.
    Best,
    Brett L 

  • How can I use my iPod as source for reinstalled iTunes?

    Hello @ all.
    Unfortunately I had to completely reinstall my system (WinXP Pro PC) and lost my media library!
    How can I use my iPod as a source to copy all my songs and settings (incl. covers, aso) to iTunes?
    iPod: 30GBs Video iPod
    iTunes Version: 7.0.2.16
    can u guys help me with that?
    Thanks very much!

    The transfer of purchased content to authorised computers has been introduced with iTunes 7. A paragraph on it has been added to this article: Transfer iTunes Store purchases using iPod
    The transfer of non iTMS content is designed by default to be one way from iTunes to iPod. However there is a manual method of accessing the iPod's hard drive and copying songs back to iTunes on Windows posted in this thread: MacMuse - iPod to iTunes
    If you prefer something more automated then there are a number of third party utilities that you can use to retrieve the music files and playlists from your iPod, this is just a selection. Have a look at the web pages and documentation for these, they are generally quite straightforward. You can read reviews of some of them here: Wired News - Rescue Your Stranded Tunes
    YamiPod Mac and Windows Versions
    iGadget Windows Only
    iPodCopy Mac and Windows Versions
    iPod Access Mac and Windows Versions
    PodUtil Mac and Windows Versions
    iPodCopy Mac and Windows Versions
    PodPlayer Windows Only
    CopyPod Windows Only
    If your iPod is set to update automatically take care when connecting back to your computer and an empty iTunes. You will get a message that your iPod is linked to a different library and asking if you want to link to this one and replace all your songs etc, press "Cancel". Pressing "Erase and Sync" will irretrievably remove all songs from your iPod. Your iPod should appear in the iTunes source list from where you can change the update setting to manual and use your iPod without the risk of accidentally erasing it. Check the "manually manage music and videos" box in Summary then press the Apply button. Don't uncheck Sync Music it will be unchecked by default when you choose the manual setting: Managing content manually on iPod
    Whichever of these retrieval methods you choose, keep your iPod in manual mode until you have reloaded your iTunes and you are happy with your playlists etc then it will be safe to return it auto-sync again. I would also advise that you get yourself an external hard drive and back your stuff up in case you have problems again. External drives are comparatively inexpensive these days and you can get loads of storage for a reasonable outlay.

  • How Can i Use two Different Public IP Addresses no my DMZ with ASA Firewall.

    How To Using Two Different Public IP Address on My DMZ with ASA 5520
    Postado por jorge decimo decimo em 28/Jan/2013 5:51:28
    Hi everyone out there.
    can any one please help me regarding this situation that im looking for a solution
    My old range of public ip address are finished, i mean (the 41.x.x.0 range)
    So now i still need to have in my DMZ another two servers that will bring some new services.
    Remember that those two server, will need to be accessable both from inside and from outside users (Internet users) as well.
    So as i said, my old range of public ip address is finished and we asked the ISP to gives some additional public
    ip address to address the need of the two new servers on DMZ. and the ISP gave us the range of 197.216.1.24/29
    So my quation is, on reall time world (on the equipment) how can i Use two different public ip address on the same DMZ
    on Cisco ASA 5520 v8??
    How my configuration should look like?
    I was told about implementing static nat with Sub Interfaces on both Router and ASA interface
    Can someone please do give me a help with a practical config sample please. i can as well be reached at [email protected]
    attached is my network diagram for a better understanding
    I thank every body in advance
    Jorge

    Hi,
    So looking at your picture you have the original public IP address range configured on the OUTSIDE and its used for NAT for different servers behind the ASA firewall.
    Now you have gotten a new public IP address range from the ISP and want to get it into use.
    How do you want to use this IP address range? You want to configure the public IP addresses directly on the servers or NAT them at the ASA and have private IP addresses on the actual servers (like it seems to be for the current server)?
    To get the routing working naturally the only thing needed between your Router and Firewall would be to have a static route for the new public network range pointing towards your ASA OUTSIDE IP address. The routing between your Router and the ISP core could either be handled with Static Routing or Dynamic Routing.
    So you dont really need to change the interface configuration between the Router and ASA at all. You just need a Static route pointing the new public IP address towards the ASA outside IP address.
    Now when the routing is handled between the ISP - ISP/Your Router - Your Firewall, you can then consider how to use those IP addresses.
    Do you want to use the public IP addresses DIRECTLY on the HOSTS behind the firewall?This would require you to either configure a new physical interface with the new public IP address range OR create a new subinterface with the new public IP addresses range AND then configure the LAN devices correspondingly to the chosen method on the firewall
    Do you want to use the public IP addresses DIRECLTY on the ASA OUTSIDE as NAT IP addresses?This would require for you to only start configuring Static NAT for the new servers between the inside/dmz and outside interface of the ASA. The format would be no different from the previous NAT configuration other than for the different IP addresses ofcourse
    Of the above ways
    The first way is good because the actual hosts will have the public IP addresses. Therefore you wont run into problems with DNS when the LAN users are trying to access the server.
    The second way is the one requiring the least amount of configurations/changes on the ASA. In this case though you might run into problem with DNS (to which I refer above) as the server actually has a private IP address but the public DNS might reply to the LAN hosts with a public IP address and therefore connections from LAN could fail. This is because LAN users cant connect to the servers OUTSIDE NAT IP address (unless you NAT the server to public IP address towards LAN also)
    Hopefully the above was helpfull. Naturally ask more specific questions and I'll answer them. Hopefully I didnt miss something. But please ask more
    I'm currently at Cisco Live! 2013 London so in the "worst case" I might be able to answer on the weekend at earliest.
    - Jouni

Maybe you are looking for

  • Error while creating change request via solman support desk message

    I have configured CHARM and my change req. is working for urgent correction, I have tested the entire workflow. however when i try to create a new change req. via support desk message --> create a change request open I get following error An action w

  • PERFORMANCE BAD WHEN CURSORS ARE USED WITHIN PL/SQL BLOCKS

    There are poor database performance at Oracle 10g For some cursor selects, the performance is under Oracle 10g significant slower than under Oracle 9i.On a test system (Oracle 9) the problem does not reproduce, on the 10g system however always. The s

  • Separating songs on the same album into different sections of the ipod

    i dont know what is wrong. but sometimes when i add songs onto my ipod, it'll separate the songs. for example, if i have a 13 track cd and download in onto my ipod, it'll put tracks 1-7 separate from the rest. im so confused and i dont know whats wro

  • Creating PDF indexes

    This question was posted in response to the following article: http://help.adobe.com/en_US/acrobat/using/WS58a04a822e3e50102bd615109794195ff-7c37.w.html

  • Convert Date to String but maintain a MM/DD/YY format

    I have converted a date field  to a string without a problem.  However, when I use it in a report, the entire date/time from the original date field prints.  How do I get only the MM/DD/YY format to print once I've converted it to a string or how do