java

Simple java input problem

Hi, I'm new to java and having problems with getting input. This is my code which seems to get the first input as required, but then skips the next two "read" function calls? Any suggestions? // open up standard input BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int battMax, battMin, numN...

Jframe without frame border, maximum button, minimum button and frame icon

I would like to create a without frame border, maximum button, minimum button and frame icon. Pls guide me to do that! ...

transactionmanager using same datasource

(connected to db call abc)--->datasource1 ---> LocalSessionFactoryBean --->transactionManager1 (connected to db call abc)--->datasource1----->AnnotationSessionFactoryBean -->transactionManager2 the reason i have 2 sessionfactory is because one is used by 3rd party osworkflow library and latter use by my application since both are co...

How to find a good/optimal dictionary for zlib 'setDictionary' when processing a given set of data?

I have a (huge) set of similar data files. The set is constantly growing. The size of a single file is about 10K. Each file must be compressed on its own. The compression is done with the zlib library, which is used by the java.util.zip.Deflater class. When passing a dictionary to the deflate algorithm by setDictionary, I can improve the...

Compiling a java program into an exe

I've just made a simple program with eclipse and I want to compile it into an exe file, but can't seem to found out how to do it simply. Any suggestions? ...

C++ Equivalent of %ld in Java for String.format()

For instance, "%11.2lf" in C++ becomes "%11.2f" in Java. How about for long format? ...

Java: How to display an XML file in a JTree

Hi, I would like to have a way to display the contents of an XML file in a JTree. I have already accomplished this using DOM, by implementing a custom TreeModel (and TreeCellRenderer). However it is very clunky (much workaround-ery and hackery) and rather rough around the edges. Is anyone aware of a way to get a JTree to display the co...

Need derived class for java generics declaration

I've run into a sticky problem that I can't seem to solve with java generics. This is a bit complicated, but I couldn't think of a simpler scenario to illustrate the problem... Here goes: I have a Processor class that requires a Context. There are different types of Context; most processors just need any abstract Context, but others ...

CORBA: Trouble while attempting to configure and run OpenORB

Hi all, I am writing a simulator for a CORBA client, that is I am simulating a CORBA server. A requirement of the CORBA server is that it register a certain object with the CORBA NameService. I have somehow stumbled across OpenORB. I have downloaded all its binary zip archives and have extracted them all to a single directory- %TCOO...

Java/C# equivalent to the Design and Evolution of C++?

I am seeking for books that describe the design of Java/C# programming language.How the language designers thought when they were designing these two languages?What tradeoffs did they make? thanks. ...

can anybody elaborate single threded model in webapp ?

Hi When do we need single threded model in webapp while designing web application in java. ...

Java: Ways to parse XML in E4X?

Hi, I was wondering if there was a way to parse XML using E4X, or something similar to E4X. Does such a framework / library exist? Thanks! ...

does Microsoft JVM support writing cookies in Applets?

I know that sun's can handle that through JSObject but is there some way for Microsoft JVM? I tried using JSObject with Microsoft but's it's unable to write/read any cookies. it returns "undefined" instead. any help appreciated. ...

switch from log4j to logback

I have this code with log4j, I don't use any kind of configuration files static Logger logger = Logger.getLogger(Application.class); ... Appender ap = new NTEventLogAppender(); SimpleLayout layout = new SimpleLayout(); Appender fp = null; try { fp = new FileAppender(layout, "output.txt"); } catch (IOException e) { ...

Problem in Java GUI

Before reading about my problem, first look at this GUI Diagram. There are three bars at the top as follows: one having buttons "pictorial view", "textual view" etc. second having buttons "processes", "organisation" etc. third having buttons "application to processes" etc. After that two information bars are there. After that a can...

java: How do I stop a thread that waits for long periods

i hava a program connect to server through xot (x25 over tcp/ip) protocol. i have a thread to connect, send recv data with server using xot library. public class MyThread extends Thread{ public MyThread() { } @Override public void run(){ // init sock ... // connect to server sock.conne...

can anybody tell me whats happenning here?

byte[] b1 = null; byte[] b2 = null; System.out.println(b1 + b2); // 1 System.out.println("" + b1 + b2); // 2 if i uncomment 1 its giving compilation error. if i uncomment 2 its printing nullnull; so whats happening here? ...

stuck with understanding 2 for loops

i am using this site as a resource http://www.perlmonks.org/?node_id=573138 I am trying to understand about O notation and it gives two examples of searching two arrays for the same element. First example has O(n^2) as does the second, however the second has an enhancement to it so it runs quicker but still maintains the same O notation...

Maven - Can I reference profile id in profile definition?

In pom.xml I have set o profiles like this: <profile> <id>profileId1</id> <build> <filters> <filter>src/main/filters/profileId1.properties</filter> </filters> // rest of the profile </profile> <profile> <id>profileId2</id> <build> <filters> <filter>src/main/filters/profileId2.prop...

is object class is also exteding any class?

We know that in java all classes extends Object. but Object itself is a class in java. so is this class also extends by itself or any other class? ...