java

How to make an Eclipse debug launcher that launches a Class

I'm trying to make an Eclipse launch configuration that I can launch programmatically, kind of building a custom debugger if you like. I've already got an org.eclipse.debug.core.launchConfigurationTypes extension, as well as .core.launchDelegates, .ui.launchConfigurationTabGroups and .core.sourcePathComputers extensions. I've got a bu...

Implementing an Adjacency List for a Flight Map

I have to implement a flight map's adjacency list for a airline service and I'm having a lot of trouble understanding how to implement this. I have the readFlightMap method already. Which reads in the data and then calls upon the method below in my 2nd for loop which handles the adjacency list file: // Inserts information into the fligh...

int and boolean error

I have a method that generates and error that a int was expected but found boolean but when I switch it to a boolean it says the same error but reverse int and boolean. Here is my code: private void compileDeclaration(boolean isGlobal) { if (equals(theToken, "int")) { accept("int"); String ident = theTok...

Programaticly create datasource for JBoss 4.2.x

Would it be possible to programmaticly create a data source in jboss and still have a valid jndi entry for the entity manager to use? Creating the data source is where I am lost, I hope I can use a MBean that runs on stat-up to handle this. This would not be my preferred method, but the application I am working on has a global configur...

Line-Spacing in JTextArea

Hi Geeks, It seems my current JTextArea instance is having line-spcing about 1 or 1.5. Can anybody tell me how to change the line-spacing in JTextArea instance? ...

Remove element from linked list java

HI :) I have a program about linked lists and we're supposed to be able to delete two numbers if they are the same.. and i know how to do it from the start but how do you delete two numbers if they are in the middle of the linked list?? All 3 run together Heres my numbers program import java.util.Scanner; public class Numbers { /...

Where are the request method constants in the Servlet API?

I want to write if (POST.equals(req.getMethod())) instead of if ("POST".equals(req.getMethod())) but I cannot find the constant definitions in the Servlet API (only looked in HttpServletRequest, where I expected them to be). Where are they (I am using lots of libraries, so if someone else defines them, that would also work)? ...

Player at JPanel..........Pls help me

Hi all I want to add a JPanel for playing rtmp streaming.Pls help me.I can play for only http streaming.I do need your help.Thank in advance ...

Unable to Find Specific Libraries in Eclipse Project

I just downloaded a FOSS (Java) project that I am attempting to build on my machine. I imported the project into Eclipse (it did not have its own .project or .classpath file) and let it build. It built almost all the way. However, I am receiving a number of errors where the compiler is "Unable to resolve [X]" where [X] is any number o...

What's an efficient algorithm to make one list equal to another one?

Let's say I have a list A that needs to look exactly like list B. All the objects that B has but A does not have need to be added to A. And all the objects that A has but not B, need to be removed from A. The reason why I need this is because I have an ArrayList of Players that I'm saving to a file. Every time I update an attribute of a...

Java Architecture - Question about ActionListener Conventions

I am making a user interface which shows graphs and manipulates graphs. The class extends JFrame implements ActionListener. The ActionListener then calls different classes to manipulate graphs depending on the action. This worked while the class had few ActionListeners; however, now the class is becoming unmanageable. I know that in the...

Image not displaying in simple applet

Hello all, I'm working with java images for the first time and having a problem viewing them when the applet loads. The code I've posted below is a dramatically pared-down version of the code I'm actually working with, hopefully figuring out why I can't see an image with this code will show me while I have to resize the window to see ima...

(J)Ruby full locales/localisation/cultureInfo support

Hi, Does (J)Ruby support such things like Calendar in Java or CultureInfo in .NET? I want to be able to write code in Ruby similar to this: locale = Locale.new("en-GB") date1 = "30/12/2000".to_date(locale) locale = Locale.new("en-US") date2 = "12/30/2000".to_date(locale) Locale.current = "ru-RU" date2 = "30.12.2000".to_date # uses t...

Getting a list of accessible methods for a given class via reflection

Is there a way to get a list of methods that would be accessible (not necessarily public) by a given class? The code in question will be in a completely different class. Example: public class A { public void methodA1(); protected void methodA2(); void methodA3(); private void methodA4(); } public class B extends A { public v...

How do you uninstall the Scala Eclipse plugin?

I tried to install the Eclipse plugin advertised in the Scala advertised at http://www.scala-lang.org/node/94. I installed it onto my version of the SpringSource Tool Suite 2.2.1 thinking everything would be fine. I'm still using Mac OS 10.4, and thus have not upgraded to Java 6. Lo, and behold, I was wrong. I can't even restart STS an...

Java Inner Text (getTextContents()) Problem

I'm trying to do some parsing in Java and I'm using Cobra HTML Parser to get the HTML into a DOM then I'm using XPath to get the nodes I want. When I get down to the desired level I call node.getTextContents(), but this gives me a string like "\n\n\nValue\n-\nValue\n\n\n" Is there a built in way to get rid of the line breaks? I would ...

What is wrong with runing app in tomcat server???

Recently I created a maven based web project and used tomcat as application server to debug ... But tomcat is frequently dead (pergem error which means out of memery ) after run app from the Project context menu directly. The worst is that It created many idle threads and they are all can not be killed by manually. And tomcat statu...

Java Inheritance

package package.b; class ClassB { public ClassB(BaseClass bc, XMLBase obj1) { } } import package.b.ClassB; class A extends BaseClass { public void function() { TestXML obj1 = new TestXML(); ClassB bObj = new ClassB(this, obj1); } } When I compile the above code, I get an error "cannot find symbol symb...

Suppress deprecated import warning in Java

In Java, if you import a deprecated class: import SomeDeprecatedClass; You get this warning: The type SomeDeprecatedClass is deprecated Is there a way to suppress this warning? ...

Run Java Code Online

Hi, codepad.org allow you to run C,C++,D etc code online but not Java... is there a site that I can use for Java? ...