Is it possible in Java (SE, not J2EE) to detect whether cookies are enabled in the default browser?
This isn't a client/server application. It's simply a desktop application that happens to interact with the default browser.
I'm using the standard logger from java.util.logging and by default the console output is directed to the error stream (i.e. same as System.err.println). How do I change the console output to the output stream (i.e. same as System.out.println)
Hi,
I have just started with the ebay Finding API and Feedback API and I need to deploy a basic API implementation on GAE/J.
The problems are:
How do we start with the local dev environment of the ebay SDK?
There is no Java tutorial for the Finding API and feedback.
GAE/J + ebay APIs won't cause any complexity right?
I am looking for head start in the right direction,I am using Eclipse + GAE plugin.
This might sound stupid, but why doesn't the Java compiler warn about the expression in the following if statement:
String a = "something";
if(a == "something"){
System.out.println("a is equal to something");
}else{
System.out.println("a is not equal to something");
}
I realize why the expression is untrue, but AFAIK, a can never be equal to the String literal "something". The compiler should realize this and at least warn me that I'm an idiot who is coding way to late at night.
I just had a test on java and we had to give the definition of
1) Static:
2) IOExcepion:
What I said for static was...a static method is used to define a method as a class method. And I got it wrong so I asked my teacher and he said he wants the actually definition of static not a static method, class or variable just static. Can someone tell me the definition of this and for IOException please Thanks.
I currently use Textmate for most of my editing, but am taking a Java course and am wondering if there's a better editor out there, especially one that might have some form of intellisense or active debugging.
Is it somehow possible to hook keypress event in background application on Symbian running smartphone? And is it possible to create any background application with Java ME?
Is there a way (and if so how?) to access plugged-in resources on my computer with java? Like the microphone, the speakers and the computer monitor? I'm not talking about mainboard, cpu, etc. this is reserved for C.
Is there a way to kill a child thread after some specified time limit in Java?
Edit: Also this particular thread may be blocked in its worst case (Thread is used to wait for a file modification and blocks until this event occurs), so im not sure that interrupt() will be successful?
I need to use the logic contained in some java classes. I found JNI, but that project seems not updated recently.
Is there a way to use it in a Delphi native application? I use Delphi 2009.
I am reading about SURBLs (known spam hosts), for purpose of classifying spam, as a batch process. Main access method seems to be via DNS lookups. I was wondering what's the usual way to do such lookups from Java code. Since this is a batch process with no strict performance requirements, I think most important feature would just be simplicity.
Is it possible to initialise an array in Java using the 'advanced' for loop?
e.g.
Integer[ ] numbers = new Integer[20];
int counter = 0;
for ( Integer i : numbers )
{
i = counter++;
}
for ( Integer i : numbers )
{
System.out.println(i);
}
This prints all nulls, why is that?
From what time I've spent with threads in Java, I've found these two ways to write threads.
public class ThreadA implements Runnable {
public void run() {
//Code
}
}
//with a "new Thread(threadA).start()" call
public class ThreadB extends Thread {
public ThreadB() {
super("ThreadB");
}
public void run() {
//Code
}
}
//with a "threadB.start()" call
Is there any significant difference in these two blocks of code?
Im trying to implement and realtime audio streaming swing desktop app . trying to get bytes of audio using java.net classes and then feeding it to play .
Just trying blind punches undersea water thinking the water tank will crack :((
help or any suggestion ?
I have a big program in Java that uses multithreading. In some cases, the program starts using 100% of three cores of my eight core system. In normal use, the program use all cores at 1-2%. How can I find the class that's overloading cores?
Hi,
While I was working on my project, I got a requirement that, I need to get the system user documents folder( like "My documents for windows and Documents for Linux). I need to get it for all the operating system. How can I do this. I can get the user root directory by using System.getProperty(user.home). I need solution for this requirement using Java. Any one please help me.
I am trying to dislplay a kannda character in a Java app.
String fonts[] = ge.getAvailableFontFamilyNames();
This shows that there is a font family by name "BRH Kannada"
Font f = new Font("BRH Kannada", Font.PLAIN, 20);
and then I do
button.setFont(f);
now when i set the button text, i have to ideally get the text on button to use the BRH kannada font.
However, what and how should i give the string as?
Rgds,
AJ
Please advise me the difference between two ways of declaration of java constructor
public class A{
private static A instance = new A();
public static A getInstance() { return instance;
}
public static void main(String[] args) {
A a= A.getInstance();
}
}
AND
public class B{
public B(){};
public static void main(String[] args) {
B b= new B();
}
}
Thanks
My Java.app broadcasts a packet on the network as soon as it starts up. Everytime I start this app, the MAC asks me do I want to allow network connections blah..blah.. Can I use info.plist or something to allow network access to this app and not bother the user who has trustingly downloaded and installed my app.
Thanks
Hi
I'm new to java.
I'm trying to use some dynamically loaded classes in my application.
The application doesn't know classes , Just it try to load a class by name that its name came from input.
It doesn't know class (So I can't use casting) but just needs to call some methods of that class (every class should have that methods).
I thought about interfaces but I don't know how.
How can I call those methods?
Thanks
Is it to possible to capitalize the letters in a Textfield as they are being typed by the user in Java?
E.g. The user would type 'hello' and 'HELLO' would appear in the Textfield.
(Odd request and I don't like the idea either.)
I've just made a program with Eclipse that takes a really long time to execute. It's taking even longer because it's loading my CPU to 25% only (I'm assuming that is because I'm using a quad-core and the program is only using one core). Is there any way to make the program use all 4 cores to max it out? Java is supposed to be natively multi-threaded, so I don't understand why it would only use 25%.
Do you know a good guide for Java, such as "dive into python" for python?
If I searched google I expect I would find tons of random guides, but trying them all until I found a good one could take ages... that's why I am asking: do you already know one in particular? one you KNOW is good?
I already know C, PHP and a bit of Python, if that matters.