Java legal stuff-  modifications to the standard library

I have been programming with Java for about a few months now. I find Java to be a wonderful language. Now I am wondering am I allowed to make a modification to the standard library and use that modification in my programs? Refering to Sun Java SDK. I am just wondering.

Thank you for the code, never tought about usign reflection. I tend to stay away from reflection as much as I can. Btw: very nicely done.
We have a really silly task to in Java as part of the lab excersizes for the lessons in programming. We have to make a program that simulates the motion of balls in a panel, the trick is that the balls ofcourse bounce off the enges of the panel but they also collide and bounce of each other. Ok, no problem, soo I did the task with just one Timer. It workd very well. But the assistant didnt accept my solution. Since it was written in the description of the excersize that each ball must be moved by a thread. How stupid is that! Soo I didnt have any good idea on how to achive that. But I do think that a Barrier is the best way to go in this unfortunate circumastance. If you have a better idea please I will be very interested. I mean what I do is I create a barrier and then each ball has
while(true){
move()
barrier.await()
in the run method. That means each out of n balls will move and then wait. When all the balls will move then I will do collision detection, redraw the panel and pause the frame for about 30 ms thus achivieng the illusion of having about 30 fps and then repeting the process. Soo the Barrier pattern I think should do good in this case. Well I have just been programming for a few months in Java soo I really can only speculate. Now the tricky part is that what if I add a new ball? What I want is simply to increment the nr of parties that the barrier has to n + 1. That will not cause any problems. If I were to decrement there might be some problems. But I dont want to create a new CyclicBarrier everytime a new Ball is created. Soo one way I think might work is to get the source of the CyclicBarrier and add an incrementParties method. Again I am a very inexperienced java beginner soo ....

Similar Messages

  • Ok, I have two itunes library account one for the PC and one for my Mac, I have my first iphone on my PC, but i just upgrade and I would like to use my new iphone on my Mac but all of my apps and other stuff is in the first library.. How do I put my apps

    ok, I have two itunes librarys account, one for my PC and one for my Mac, I use the PC for my iphone, but I upgrade my iphone and all my apps and
    stuff is on the first itunes library. How do I put the apps from one iphone to the otherusing two dirffernt itunes library? please help..

    Drrhythm2 wrote:
    What's the best solution for this? I
    Copy the entire /Music/iTunes/ folder from her old compouter to /Music/ in her account on this new computer.

  • Business Process Monitoring - Modification of the standard alert mechnisms

    Hi All,
    Am using Solution Manager 7.0 BPMON and the alert mechanisms used is the email notification from BPM_NOTIF.
    Would like to know if the email format can be modified Some e.g of the modification which I am looking at
    1) The subject as of now is the standard the Solution name. Can the sbuject be modified to suit what kind of alert this is.
    2) In the body there a couple of details which may not be used and some other details may need to be added for e.g for a dialog performance monitor the user  id which has hit the threshold is not visible in the alert hence can this be added to the email alert?
    Thanks.
    Rgds,
    Letchu

    Hello,
    with ST400 SPS23 and hence ST-SER 701_2010_1 it is directly possible to influence subject and body of an email in BPMon. Additionally you can use other BAdIs to further enrich your notifications or trigger "real" auto-reactions. Please refer to the following SDN blog /people/johannes.fleig/blog/2010/06/02/create-your-own-auto-reaction-messages-in-business-process-monitoring-via-badi-exit
    Best Regards
    Volker

  • Adding a brush to the "standard" library

    We rarely use 'custom' brushes, normally just using the standard ones that come with CS6 for photo-retouching.
    We'd like to take a custom brush that is saved into another library, and copy it into the standard brush library, so we don't have to switch libraries to use that brush. Is there any way to accomplish this?
    Neil

    Well this is definitely a day for aging reminiscing!  Janee was just about the most helpful, and definitely the nicest, poster to the Usenet Photoshop groups. This would have been the mid 90s in the days of the first Windows versions of Photoshop.  I swapped a couple of emails with her not so long ago — mainly just say thanks for all the help back then, and glad that she is still around and doing her thing.
    I wouldn’t mind betting that myjanee.com was the first ever Photoshop tutorial site on the Internet, and it is wonderful to see how it has stood the test of time.   So anyone else here used to post to the Usenet Photoshop groups?

  • Linux and Java are 64 bit. The native library is 32 bit. Any workaround?

    Folks,
    I am trying to run some java cipher/decipher programs that rely on native code (code which connects through the network to an HSM box).
    The issue is that theboth Linux kernel and JVM are 64 bit. But the native library seems to be 32 bit. I get the following message when trying to run the sample:
    Exception in thread "main" java.lang.UnsatisfiedLinkError: jcryptoki (/opt/Eracom/lib/libjcryptoki.so: wrong ELF class: ELFCLASS32)
    at java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:981)
    at java.lang.ClassLoader.loadLibraryWithClassLoader(ClassLoader.java:950)
    at java.lang.System.loadLibrary(System.java:453)
    at jprov.cryptoki.Cryptoki.<clinit>(Cryptoki.java:38)
    at java.lang.J9VMInternals.initializeImpl(Native Method)
    at java.lang.J9VMInternals.initialize(J9VMInternals.java:194)
    at au.com.eracom.crypto.provider.ERACOMProvider.<clinit>(ERACOMProvider.java:329)
    at java.lang.J9VMInternals.initializeImpl(Native Method)
    at java.lang.J9VMInternals.initialize(J9VMInternals.java:194)
    at SHA512Generator.main(SHA512Generator.java:10)Is there any workaround or should I contact my HSM vendor and ask for a 64 bit version of this native library?

    Is there any workaround or should I contact my HSM vendor and ask for a 64 bit version of this native library?That would certainly be the best step so it should certainly be the first one.

  • Modifications in the standard ESS WD abap application

    Hi
    I have a requirement in the travel request of ESS application which is webdynpro abap.
    When i select create travel request and in the first screen give the travel details and after clicking on review button at the bottom it is navigated to other screen in which we find Final action section where there are two radio buttons 1) Save 2)Save and send for Approval .
    Now my requirement is we have two remove those two radio buttons completely and place the static save and save and send for approval buttons at the bottom.
    For these static buttons i have to perform action where i found  in the standard application  it is not directly calling standard methods at the controller level but it is performing action based on the dynamic text of the " forward" button on action navigate-> start navigation ..........so how can we perform the similar action with the static buttons in created in FITE_REVIEW component .
    Thanks in advance.

    Have you checked the feeder class and see if you can perform the changes there.

  • How to restore standard library object

    Dear All,
    We have a standard library object 1VK(Absorption costing) deleted from one of our client in Development system.  Please suggest how do we restore this standard library back once again into that client.
    Thanks,
    Raj

    Hello Markus,
    The standard Library 1VK (Cost Centers: Absorption Costing)  which is used in report creations usually done by FI consultants has been deleted in one of our Dev client. We were able to trace out the user. Now we want this std library 1vk to be imported or retrieved once again in the same Dev client.
    Thanks,
    Raj

  • Modifying the standard doclet

    Hi,
    I have a requirement of adding a link in the header section of javadocs, that necessitates a modification to the standard doclet.
    The problem is elementary - how do I get started? I could not locate the com.sun.tools.doclets package in the jsdk 1.4.1_02. Even after decompressing the source files in the jsdk, the directory structure i get does not have "tools". Is this package downloadable separately? If yes, please guide me to the location.
    Then once, when I am through making the changes, where do I place the modified class files?
    Any help will be great for me.
    Thanks and regards
    Manu

    Hi Jamie,
    Thank you for your reply: I found the site and downloaded the file:
    j2sdk-1_4_0-src-scsl.zip
    But I could not find the doclet classes in them... Perhaps I am not looking at the correct place?
    I also downloaded another set of source files, j2sdk-sec-1_4_1-src-scsl.zip, and also expanded the source files zip, src.zip, that is bundled with the JSDK. These also did not have the doclet classes.
    It seems a simple problem and I am surprised how difficult I am finding it to locate the files! :-)
    Regards,
    Manu

  • How do I enable the Java Accessibilty Stuff?

    Hi. I'm trying to make my application accessible via a screen reader to impaired users. Unfortunately, I'm not having any success whatsoever. If I didnt know Java had accessibility stuff built-in, I would assume that it was just not compatible at all with screen reader technology.
    How do I enable the Java accessibility stuff so that UI components are accessible to a screen reader; they can be iterated over and get sensible names and/or descriptions of them?
    I wrote a simple application, attached below, which just makes a demo UI from which I can start learning the basics of the accessibility stuff. Out of the box, the UI is completely opaque to a screen reader (I'm using the VoiceOver utility bundled with Mac OS X, which does ok with normal applications).
    I tried setting things focusable to no avail, voice over cant cycle through the UI component using the normal keyboard short cuts, and nothing is spoken when I tab between components, despite some things having natural labels, like a menu, and some things, like the button, where i've set the accessible name and description on the accessible context of the component.
    Obviously, I'm doing something wrong or I just don't understand how the accessibility stuff works.
    Could someone please shed some light on this so that I can make my application accessible to a screen reader?
    Thanks.
        private static void try508Example() {
            JFrame aFrame = new JFrame();
            JMenuBar aMenuBar = new JMenuBar();
            JMenu aMenu = new JMenu("Test");
            aMenu.setMnemonic(KeyEvent.VK_T);
            JMenuItem aItem1 = new JMenuItem("Test Item 1");
            aItem1.setFocusable(true);
            aItem1.getAccessibleContext().setAccessibleName("Test Item 1");
            aItem1.getAccessibleContext().setAccessibleDescription("Test Item 1 Description");
            JMenuItem aItem2 = new JMenuItem("Test Item 2");
            JMenuItem aItem3 = new JMenuItem("Test Item 3");
            aMenu.add(aItem1);
            aMenu.add(aItem2);
            aMenu.add(aItem3);
            aMenuBar.add(aMenu);
            aFrame.setJMenuBar(aMenuBar);
            JTabbedPane aTabPanel = new JTabbedPane();
            aTabPanel.setFocusable(true);
            JTextArea aTab1Comp = new JTextArea();
            JScrollPane aTab2Comp = new JScrollPane(new JTree());
            aTabPanel.addTab("Tab1", aTab1Comp);
            aTabPanel.addTab("Tab2", aTab2Comp);
            JTree aTree = new JTree();
            aTree.setFocusable(true);
            JLabel aLabel = new JLabel("some label");
            aLabel.setLabelFor(aTree);
            aLabel.setFocusable(true);
            JScrollPane aScrollList = new JScrollPane(new JList());
            aScrollList.setFocusable(true);
            JButton aBtn = new JButton("Button");
            aBtn.setFocusable(true);
            aBtn.getAccessibleContext().setAccessibleName("Button Name");
            aBtn.getAccessibleContext().setAccessibleDescription("Button Description");
            JPanel aContent = new JPanel(new BorderLayout());
            aContent.add(aTabPanel);
            aContent.add(aBtn, BorderLayout.NORTH);
            aContent.add(aScrollList, BorderLayout.EAST);
            aContent.add(aTree, BorderLayout.WEST);
            aContent.add(aLabel, BorderLayout.SOUTH);
            aFrame.setContentPane(aContent);
            aFrame.setSize(640, 480);
            aFrame.setVisible(true);
            aFrame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        }

    Ok, so a very curious issue. If I comment out adding the menu bar to the window, ie comment out this line:
    aFrame.setJMenuBar(aMenuBar);
    The screen reader reads me back everything just like I would expect. I comment the line back in, and nothing, the application is completely invisible to the screen reader.
    Anyone have any idea what this is about?

  • How  to get the java code of the standard functions

    How  to get the java code of the standard functions in xi
    Example , hoh get the java code for a node function - removeContext.

    hi
    Click on the Standard Function.
    Hold Ctrl+Shift
    right click on the standard function to view the context menu. You will see options to view the source code by exporting
    regards
    krishna

  • Where are the standard java packages io,util etc found in JRE

    hello,
    can u guys tell me where the standard java packages io,util found in the JRE.
    is it the rt.jar file??
    as i need to set the path in my applicaion to it coz, my application after running generates a .java file and then compiles it and creates a .class file on the local machine every time it is run.

    You want the <JRE Home>\bin directory as your path if you use the JRE to run the class. Eyeball the SDK bin directory, find the same directory in the JRE structure, and set your PATH to it.

  • Is the standard C++ library provided in Solaris 9 thread-safe?

    Hi,
    I cannot find any documentation anywhere that says that the standard C++ library in Solaris 9 (provided by Rogue Wave) is thread safe.
    I have seen evidence that makes me think it is not - however, I was wondering if anyone could provide any insight. If they are not, where could I obtain the libraries that are thread safe?
    The libraries of interest are:
    /lib/sparcv9/libCstd.so.1 &
    /lib/sparcv9/libCrun.so.1
    Thankyou in advance.

    Whether the library is thread safe depends on what you mean by thread safety. Except for the 8 standard iostream objects (std::cin, std::cout, etc.), simultaneous accesses from multiple threads to all objects of standard library types must be synchronized by the user. E.g., it's not safe to read or write the same container object (e.g., std::vector, or std::string) from multiple threads at the same time. The C++ localization library imposes some additional restrictions because of its interactions with the global C locale.

  • Using the Standard Template Library with 5.0 using 4.2 compatibility mode

    Has anyone used the Standard Template Library with the 5.0 release of the complier using the -compat=4 flag ?

    It's not your system, unfortunately. It's iTunes 5.0. I have XP, a brand new drive and Nero. I can burn all sorts of CDs, just none from iTunes.
    I have gotten several emails from Apple regarding this issue, none of which helped. The last response I got said they were working on my problem. Right now, the best solution that I can come up with, although I'm not sure how to do it, is back up your songs as a data CD, uninstall 5.0 and reinstall version 4.9.
    If you go back a few days (or maybe a week) in the discussions, someone posted a link for 4.9. If you can do this and successfully install 4.9 you will have no problem burning CDs. I just haven't had any luck burning my songs as data. I have 4.9 on an older computer and can burn CDs for days. So all I have to do is get my songs to the old PC and I'll be in business.

  • Where do I indicate I have read the legal stuff?

    When I read the legal stuff for Adobe Flash player updates, I cannot find where to indicate I have read it.  Therefore, I can't go any further in installing the update!  Help!

    Indicate that you read the license agreement in the following installer page:
    [From Tim]
    Thanks for the reply.  REsolution was not a problem.  I found it, but it was not in the place or the sequence I would have suspected.  Now I know.  Live and learn, I always say.
    Tim
    +++++

  • Deactivate the standard document library feature

    Hey,
    I have created a custom document library definition. It works fine.
    Is it possible to deactivate the standard document library when I activate the feature with the custom document library definition?
    Thanks for your help
    Stefan 

    Hi,
    According to your description, my understanding is that you want to deactivate the document library definition when activate the custom document library feature.
    In the
    SPListTemplate class , there is no remove or delete method, so it could not be achieved in FeatureDeactivating event.
    As a workaround, if you want to force user to use the custom document library template, you can hide the OOTB document library template in the add app layout page using Jquery. It is located at the path below:
    C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\LAYOUTS\AddAnApp.aspx
    You can add the Jquery code under the PlaceHolderMain tag to achieve it. The document library template is a first li element under ul element.
    Here is a code snippet for your reference:
    <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
    <script>
    $( document ).ready(function() {
    $( "#scrollDiv ul li" ).first().hide();
    </script>
    Here are some detailed code demo for your reference:
    Jquery find the first li
    Jquery hide funtion
    Thanks
    Best Regards
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

Maybe you are looking for

  • PL/SQL procedure -- log files?

    Say when i execute a PL/SQL procedure using SQL* Plus. Is there a place where these executions are stored/logged? Any trace files? And, when a Java program calls my stored procedure, is there a place these transactions are stored, just to check what

  • Classes & Package

    Hi I have a class (say Z) in a package (say X.Y) . Z uses another class (say A) which doesn't have a package structure at all. I have been compiling Z as "avac X/Y/Z.java".Can anyone suggest an other way of compiling this without creating a package s

  • Cannot create information center web archive for tomcat 7

    I'm upgrading the help of a commercial product from tomcat 5 to tomcat 7 and am not able to get help deployed as a war, which was working previously. I have followed the directions here: http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.pla

  • Why I changed the battery of my macpro but it didn't turn on?

    My battery died and changed the battery at apple Genius Bar but it didn't turn on and they are saying I will back up my data and pictures so they can restore it. The problem is how can we back it up when I it doesn't turn on.?? I spend 140$ for batte

  • SuperDrive (DVD±RW/CD-RW)??? please help

    the macbook i am getting soon has a SuperDrive (DVD±RW/CD-RW) erm i dont relly know what this means and would be very thankfull to anyone who can help. does it mean i can put 2 discs in the disk slot? help me!