I'm having trouble with adding and then removing an AjaxSelfUpdatingTimerBehavior in Apache Wicket. The behaviour gets added okay but then as soon as I remove the behavior I get a "Page Expired" come up in the browser very soon, I guess because the removal wasn't clean. My set up is basically a label which starts changing by timer, and...
Usually I come across situations where I have to swallow an exception thrown by the clean up code in the catch/finally block to prevent the original exception being swallowed.
For example:
// Closing a file in Java
public void example1() throws IOException {
boolean exceptionThrown = false;
FileWriter out = new FileWriter(“test...
In the Java Desktop Application template used by Netbeans, a menu bar is created with JMenuBar and JMenuItems.
How can I get that bar displayed at the top, where menu bars are displayed in MacOSX instead of in-window, like in Windows?
...
I have two strings in a java program, which I want to mix in a certain way to form two new strings. To do this I have to pick up some constituent chars from each string and add them to form the new strings. I have a code like this(this.eka and this.toka are the original strings):
String muutettu1 = new String();
String muutettu2 = new S...
I want name of the color which is selected from Color chooser but now it is returning me the R,G,B Values. I want the name of the color for further use.Can anybody help me?
...
public class Test extends Thread{
public void hello(String s){
System.out.println(s);
}
public void run(){
hello("I’mrunning...");
}//endofrun()
public static void main(String [] args){
Test t=new Test();
System.out.println("always first");
t.start();
System.out.println("always second but...
Is it possible to capture the text of say a Edit Box or Label control on a Java Applet?
In a more traditional Win32 program this can be accomplished using FindWindow, FindWindowEx together with things like GetWindowText.
I have investigated with WinSpy but the Java Applet is just one large window with no children.
I am wondering if th...
I need to several some huge files (several gigs) from Java via FTP/HTTP. Is there a ready library (java / command line tool) to facilitate the download? Some obvious requirements are:
Multi-connection download - should be able to open several connections to the server to accelerate the download (like FlashGet/GetRight/...)
Resume a dow...
Hello, everyone!
I have an anonymous inner class inside another class (SomeClass).
Both SomeClass.class.getClasses() and SomeClass.class.getDeclaredClasses() return empty arrays.
I couldn't find some hints on this in Class' Javadocs.
Can anonymous inner classes be retrieved using reflection in some way?
What else are notable differe...
It has been thirteen years between the initial public release of Java 1.0 (1996) and the current stable release 1.6.0_16 (2009).
During those thirteen years the following notable releases have been made:
JDK 1.0 (January, 1996)
JDK 1.1 (February, 1997)
J2SE 1.2 (December, 1998)
J2SE 1.3 (May, 2000)
J2SE 1.4 (February, 2002)
J2SE 5.0 (...
Hello, I want to know that whether we can apply 'multiple' AOP behaviors to our service classes or not?
Lets just say, i do this to my BankServiceImpl class:
@Transactional on top of one of the method, accountTransfer(), and
and some custom <aop> pointcut on the execution of another method someOtherMethod().
Then will Spring be able...
java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Float
Why is this a problem? The numbers that I'm trying to cast are decimals in the domain [-10.0, 10.0]. They start out as Object instances returned using JFormattedTextField.getValue(). But they must be converted to floats.
stack trace:
Exception in thread "AW...
Short question: If I have class that impelemnts FactoryBean interface, how can I get from FactoryBean object itself instead of FactoryBean.getObject()?
Long question: I have to use 3-rd party Spring based library which is hardly use FactoryBean interface. Right now I always must configure 2 beans:
<!-- Case 1-->
<bean id="XYZ" class="F...
I've been trying to code a simple screenshot application using rococoa (java to osx cocoa api library), and managed to get as far as actually taking the screenshot, and then saving it to a file. Unfortunately, once in a while, the application fails with an 'Invalid memory access of location...' error. I'm assuming this is due to somethin...
I'm really confused about transaction propagation in Spring with Hibernate. I use Spring @Transactional annotations on my service layer methods. Some are marked as 'read-only=true'. If one of my read-only service methods calls a method that is not read-only, how can I deal with this?
I'm thinking I can mark all my read-write methods to ...
I have idea that for people who use gtalk especially for developers, how to write a bot that recieve question from one developer and ask other online developers for help based on their programming skills?
Bot added by the user to gtalk and
user will gave his/her skills at
first time
Then if someone ask a
question application will sear...
Is there any free data aware components for java, like good old Jbuilder components?
For example data aware visual grid component where you can add, modify, commit data to database?
...
I'm new to GUI programming, but need to create a multiple window GUI. Does anyone know of any good tutorial online or could you please show a simple code that will launch 2 windows?
...
Is there any way in Java to print to a specific IPP printer? All of the sample code and tutorials I've found focus on how to print a particular type of document, using something like the following:
DocFlavor flavor = DocFlavor.INPUT_STREAM.POSTSCRIPT;
PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
aset.add(MediaSize...
I am looking at the Date documentation and trying to figure out how I can express NOW + 5 seconds. Here's some pseudocode:
import java.util.Date
public class Main {
public static void main(String args[]) {
Date now = new Date();
now.setSeconds(now.getSeconds() + 5);
}
}
...