java

Java: How could a breakpoint stop an applet from painting without *ever being tripped*?

In eclipse I am writing some code that crawls a specific webpage and downloads an applet, which it then adds to a JFrame and executes. If I run program without adding any breakpoints, it works perfectly. It loads the applet, and it begins running. However, if I add a breakpoint to the applets update(Graphics g) method, it simply stops...

How resource intensive are Listeners in java?

Hello, I'm new to Java Programming but an experienced C++ programmer. I was learning how to program GUIs using swing. I was wondering how resource intensive (runtime as well as memory) are ActionListeners? Is there a general guideline to the total number of listeners that one should create in a particular program? How many until perfo...

java inputstream print to console the content

sock = new Socket("www.google.com", 80); out = new BufferedOutputStream(sock.getOutputStream()); in = new BufferedInputStream(sock.getInputStream()); When i try to do printing out of content inside "in" like below BufferedInputStream bin = new BufferedInputStream(in); int b; while ( ( b = bin.read() ) != -1 ) { ...

Keyboard input on any Java 6 application on OSX Leopard

I get no keyboard feedback on any java application I run with Java 6 (64-bit) on OSX Leopard 10.5.7. It happens with any swing application, or even with eclipse 3.5 64-bit (which is a SWT-cocoa application). Did't find any reference to this problem on the web... ...

What does "Wrap to beginning when end is reached" means?

I've found that tooltip text in jsyntaxpane's find/replace operation. However, I don't understand what that means, or how it should perform. I think it should do a replace, and if it reaches the end of the document it should stop there, it shouldn't go back at the beginning. However, it still goes at the beginning of the document. Has an...

Unable to send mail from java application !

Hi, In my java application I need to send mails to different mail addresses. I am using the next piece of code , but for some reason it doesn't work. enter code here public class main { public static void main(String[] args) { Properties props = new Properties(); props.put("mail.smtp.host", "mail.yahoo.com."); pro...

What is required for building Java Windows Application to access Online MySQL Database

Hello Can anyone list the requirements (i.e. any books, tutorials, libraries etc) to build an application in Java, which could communicate with my MySQL Database which is running on web. I am running an online webstore built in PHP and MySQL. I would like to build a Java Application through which I can (CRUD) Products, Categories, Orde...

how to optimize image in java for performance

Hello all im transeffing image throw tcp/ip and i like to optimize it and still good quality as much as possible what kind of methods or algorithms i can use ? p.s now if i think about it maybe i should ask what is the best and the fast way to send image via tcp/ip ...

Source code of libraries downloaded with ivy

I use ivy with the ivy eclipse plugin to download dependencies. Works great. But how can I attach the source code for those libraries, in order to step into these libraries? ...

Apache Tomcat executing a Java class

Hi, I've coded some algorithms in java and I need to include those algorithm in my web application. I'm using Apache Tomcat and what I need to do is that when, for example, I click on the start button on my web page a java class should be executed. I think this done by using servlets, am I right? If so, do you know where I can find some...

Should I learn Spring 2 or 3?

Spring Framework 3 seems to be right around the corner, but the GA version is 2.5.6. If this is the first time I'm approaching the subject, should I start with the stable version, or should I start with the new version and save myself migration issues? How different is version 3 from version 2? How near is Spring 3? ...

What exactly takes place behind the scenes when you call System.gc()?

Calling System.gc() requests that garbage collection takes place, and isn't guaranteed. The part about it not being guaranteed is interesting to me: can someone explain the exact process that takes place when you make this call? ...

can't get DB Connection using JNDI datasource on JBoss

I'm studying how to build java webapps for JBossAS 5.1.0 and I'm trying to build a very basic jsp web app on JBossAS5 using a JNDI datasource for data access. When trying to open a connection I get this exception: 21:42:52,834 ERROR [STDERR] Cannot get connection: org.jboss.util.NestedSQLException: Unable to get managed connection fo...

<c:import> tag

Hi, I'm trying to import file from the Header.jsp in my file by using import tag url attribute, but I'm getting runtime error--java.io.FileNotFoundException: http://localhost:8081/latest/header.jsp The imported file and the importing file in the same web app(latest). The code of the importing file is: <%@ taglib prefix="c" uri="http:...

Java EE example project

Hello! I am currently in the process of learing about Java EE, EJB3 and . So far I am running a JBoss application server and a Oracle database. I have written a stateful session bean which retrieves data from the database through JPA entities. My goal is to have a simple client speaking to a server by calling methods in a stateful bea...

Should web developers still learn JavaScript?

Now that frameworks like GWT, Morfik etc exist which compile Java client side code into major JavaScript dialects, is it still worth learning JavaScript? ...

Access "this" from Java anonymous class

Given the following code: public interface Selectable { public void select(); } public class Container implements Selectable { public void select() { ... } public void createAnonymousClass() { Selectable s = new Selectable() { public void select() { //see comment below. } }; } } I want to acces...

What is the difference between an ordered and a sorted collection?

Is there any difference between a sorted and an ordered collection? ...

How do I configure JUnit's Source in Eclipse?

I am using Eclipse Galileo for Java EE, and I want to configure JUnit to show me the source code when I try to navigate to its methods. I've tried attaching source to the JUnit library, but the library definition is not editable. I cannot even find where to configure the JUnit library in the preferences. When I open the Add Library wind...

Requirement gathering over banking website

Hi, I'm currently gathering different requirments over banking website development, and one of the part which I want to know deeply is "saving account" . What the internal working do I have to keep in mind for making a website over "saving account" part? Thanks in advance. ...