Binary search tree and in-order traversal
I am trying to quickly implement a Binary search tree in Java. What is the best class to use that has methods for in-order traversal? (I have heard of TreeMap class. But it looks like the class does …
ClassNotFound exception
public class dummy { public static void main(String[] args) { System.out.println("hello world"); } public void init() { //"dummy2" class defined in a different jar dummy2 d = …
JDBC connection does not run with .jar file, but with eclipse project
I'm really looking at a mystery here. I created a Java program in Eclipse and established a JDBC connection. The code is the following: import java.sql.*; public class login { public static ...
Hiding API keys used in an open source application
I'm currently developing a desktop application based on a 3rd party web API, and have registered for their program and been given two access keys in return. However, if pasting these keys as strings …
How to sort a large text file's data into a multi-dimensional array?
I have a very large data file. It starts off with a big paragraph that I want to ignore or remove from the equation, then it has a year e.g. 1974, then 6 spaces, then a number to represent a month, …
How to check if there is at least: two letters, one number and one special character?
How to check if there is at least: two letters, one number and one special character in java? Here is my code but I dont know if I'm in the right direction. public static boolean validarCodigo(String …
gettext-commons per-request locale in servlet
The gettext-tutorial states that The preferable way to create an I18n object is through the I18nFactory. The factory caches the I18n object internally using the the package name of the provided …
What triggers a Firewall to block a TCP Socket?
I was wondering what would cause a Firewall to block a TCP Java Socket from connecting. What would trigger that? Thanks!
JTextArea not updating dynamically
I have a JTextArea inside a class that I want to update dynamically. Currently it is only displaying the text I append to it after all the processing is done. I have tried to implement the following …
How to safely convert from a Collection of generic types to an array?
For various reasons I want to convert a list to an array, however the Collection contains objects that are themselves generics. I have tried the following four options to get it to compile without …
Health for each enemy
as my game progresses the enemies get stronger. To make the enemies stronger I made a private int called thealth (probably a bad programming choice) and each time the sprite is touched thealth--; ...
Java: ClassNotFoundException
I am getting an error that states, "java.lang.NoClassDefFoundError: usemathobject/Main". I found a thread at The dreaded java.lang.NoClassDefFoundError that deals with this error. It says I need to …
Eclipse Always Re-Indexes Repository in Android
When I'm working in android, at the very bottom-right corner of my Eclipse window, it reads, "Re-indexing repository" whenever I save a file. When this is enabled, Eclipse runs very sluggishly, and it …
Why my JTable isn't showing?
Guys I have a problem with my JTable, my JTable(tblLivro) which contents should be the result(ArrayList) of my query (working) , but when I try to put the rsult in my jtable it just doesn't work, it …
Can i insert a some code in HTML to set android wallpaper
This would be my first post ever on stackoverflow.com I have found many many of the answers to my questions but this one question i cannot figure out. I know that it is possible to invoke few android …
Predict a file hosting url?
I have a program that will type the mediafire URL that you can download it from. The only problem with this situation is that I can't really know the url from which to download the program from until …
How to put data into HashMap<key, Object>
I am a new to programming. I have a program that iterates excel file and put values into hashmap HashMapbut object in a hash map is always has last record. I'll post my code and may be you can tell me …
Accessing a returned value from a different case
Hi It's the 3rd time i'm posting this question on this forum and up to now no one has been capable to enlighten me about this situation. I only pasted the code that matters here and will try to ...
Is serializable inheritable
Is serializable inheritable. Particulary if I have class A implements Serializable{} class B extends A{} Is class B serializable?
How to make numeric comparison when using morphia to perform an $elemMatch query
My document has the following structure: { "scores": [{ "scoreTitle": "environment", "scoreValue": 3, "scoreDescribe": "good" }, { "scoreTitle": "service", "scoreValue": 3, …
Need to print the captured user signature in the specified position in java
We will capture the user signature through the tablet. (We are done that part) Now we need to replace the captured signature with "$Signature" in the below content and send to printer. "The content …
Spring Data JPA - loading parent after explicit child deletion returns collection of children with deleted child
I have Parent->Child bidirectional relationship as follows... class Parent{ @OneToMany(mappedBy="parent", fetch = FetchType.EAGER) Collection<Child> children; } class Child{ ...
Bitmap to Mat gives wrong colors back
So I make a bitmap from a blob with the next code: byte[] blob = contact.getMP(); ByteArrayInputStream inputStream = new ByteArrayInputStream(blob); Bitmap bitmap = ...
Working with SQLServer 2008, stored procedures and WebService
So I'm trying to invoke an stored procedure from a web service but as soon as I add either the "prepareCall" or the "prepareStatement" my WebService stops working. When I test it it shows some big big …
Triads not showing up to fight? (Java Set missing an item)
I have code from two companies asoft and bsoft. I cannot change either. This is a simplified version of my situation which I'm pretty sure has enough information to the find what's causing the ...
Connection refused with Tomcat 7
I have a Tomcat instance running on Jelastic and there are two deployed apps - for '/foo' context and for '/bar' context. During handling request to '/foo' we do a HTTP request to '/bar' (for ...
What's a good-practice replacement of System.out.println?
My application has to output content for the user. Throughout all my classes I've just been using System.out.println, but since the program isn't intended to be run by command line this isn't really …
How to get API_KEY in Android Transliteration
Need help... I am working on transliteration in Android and it requires API_KEY, but as I'm new to Android, I don't know how to get that API_KEY, Can anybody tell me, what I have to do to get that ...
Creating a second applet(window) in processing
Hello guys i am trying to do a code where i can create a second applet in processing by passing on a sensible area. the code works fine except for 1 thing. when it passes over the sensible area it …
readline() doesn't read from socket
s = new Socket(InetAddress.getByName(address), port); Thread.sleep(250); DataOutputStream outToServer = new DataOutputStream(s.getOutputStream()); BufferedReader inFromServer = new ...