java

How to draw a curve that passes through three points?

Hi, I'm trying to create a curve that passes through three given points in Java (I'm drawing the curves through a class that extends JPanel). How can I make it? Thanks! ...

Java area class

Please help - I'm new to java. I'm working on a code for class that ask me to write an Area class that calcualtes the following shapes-circles-rectangles-cylinders Area of a circle: Area= (TT)(r^2) where TT is Math.PI and r is the circle radius Area of a Rectangle: Area= (width) * (length) Area of a cylinder: Area= (TT)(r^2)(h) where...

Download sun.net package for J2SE 1.3

I can find the package for JDK6.0 at here http://www.java2s.com/Open-Source/Java-Document/CatalogJava-Document.htm. Can anyone let me know where I can download sun.net package for J2SE 1.3? Thanks, ...

Informative Game Development Tutorials for Java?

I've taken a couple of courses in programming (mainly Java) in my first year at college, and I've been trying to keep up my skills through the summer, so I was thinking of attempting a very basic video game project for the summer, because it would be an equally entertaining and educating way of practicing good program design. So, I was ...

Is there a JToolBar replacement that offers more functionality?

I'm creating a simple Swing application, then I realized that JToolBar doesn't provide much functionality. For example, I want to add multiple dragable toolbars onto one JFrame, but but I can only have one floatable JToolBar per JFrame if I use JToolbar. I know that NetBeans is built with Swing, and the toolbars on NetBeans have more fu...

using DirectoryWalker

I am trying to figure out how to use apache commons io DirectoryWalker. It's pretty easy to understand how to subclass DirectoryWalker. But how do you start executing it on a particular directory? ...

Access restriction on class due to restriction on required library

I get this error message in Eclipse: Access restriction: The type DirectoryWalker is not accessible due to restriction on required library /Library/Java/Extensions/commons-io-1.4.jar what does this mean? There's this other SO question on the same topic but it doesn't seem to apply in this case. I'm not creating a new java class, I'm ...

Java Server application architecture with Swing thin client

I am currently looking to set up a client/server application. I am planning on having the clients written as a Swing thin client. I am not really sure how I should set up the Server side application. The Java Server side application would have the application business logic, database access, etc. I see a lot information on the web abo...

Styles of adding / registering button listeners in OOP (Java, Actionscript, etc)

I've come across 2 different styles when adding button listeners in UI. I use SWT as example. But nonetheless I saw the similar code in J2ME, Flash Actionscript as well. style 1: b1.addSelectionListener(new SelectionListener() { public void widgetSelected(SelectionEvent e) { System.out.println("b1: "); } public void widge...

How do I use more than two colors using and AWT hardware cursor?

I want to use a hardware cursor for a computer game I am making, AWT allows me to do so, and specify an image to use, however it only accepts 2 colours and transparency, which is fairly limiting. I'm fairly certain that it's possible to use a greater colour depth on most current systems, is there any way to achieve that in AWT? What ab...

Newline in JLabel

How can I display a newline in JLabel? For example, if I wanted: Hello World! blahblahblah This is what I have right now: JLabel l = new JLabel("Hello World!\nblahblahblah", SwingConstants.CENTER); This is what is displayed: Hello World!blahblahblah Forgive me if this is a dumb question, I'm just learning some Swing b...

equivalent of memcmp() in Java?

If I have two byte[] arrays, is there a built-in function to compare them ala C's memcmp() ? ...

Are volatile variable 'reads' as fast as normal reads?

I know that writing to a volatile variable flushes it from the memory of all the cpus, however I want to know if reads to a volatile variable are as fast as normal reads? Can volatile variables ever be placed in the cpu cache or is it always fetched from the main memory? ...

rmi NoSuchObjectException

I'm using RMI to pass string from one web app to another web app.Initiating RMI service from the "contextInitialized" method and trying to close the RMI service from "contextDestroyed" method. MessageContextListener class: public class MessageContextListener implements ServletContextListener { public void contextInitialized(Servlet...

Static Analysis tool to detect Internationalization issues

Are there any tools (free/commercial) that can audit an application for internationalization? (or localization-readiness, if you prefer) Primarily interested in: Mulitlingual Implementation tests Examples: * [javascript] alert('Oops wrong choice!'); * [java] String msg = resourcebundle.getString("key.x").concat("4")...

Instantiating a generic class in Java

I know Java's generics are somewhat inferior to .Net's. I have a generic class Foo<T>, and I really need to instantiate a T in Foo using a parameter-less constructor. How can one work around Java's limitation? ...

Java: how to convert HashMap<String, Object> to array

Hi, I need to convert a HashMap<String, Object> to an array; could anyone show me how it's done? ...

How to save web audio streaming to file ( c++ / java )

hello all is there any lib or well known method to save audio web streaming ( web radio , mp3 streaming) to file programmatically ? ...

ThreadPool is to Executor like Polling is to ???

Java's Executor is (as far as I understand it) an abstraction over the ThreadPool concept - something that can accept and carry out (execute) tasks. I'm looking for a similar exception for the Polling concept. I need to continuously poll (dequeue) items out of a specific Queue (which does not implement BlockingQueue), execute them and s...

Yahoo address book reterival

I am trying to retrieve address book contacts through yahoo. After googling a bit, i came up to number of yahoo developer pages and the api i was looking for. However, at the moment I am not in position to give detail about my Web Application URL and BBAuth Success URL while registering for yahoo app-id in order to yahoo app working. Sin...