java

Using JButtons to execute SQL queries with JDBC

I'm writing a simple JAVA GUI to read an SQL query from a JTextFrame and execute it. The connect and execute buttons are both JButtons, but the compiler won't compile my code because I can't append a "throws SQLException" to actionPerformed in my Listener private classes. I tried writing separate methods, but the same problem still per...

two log4j files for EAR with two modules

Hi, I have an EAR that is made up of two modules. Both expose services and share common code. Imagine that the ear has a common.jar shared by a webservices.war and webapp.war. I use log4j to log the activities. I would like to be able to have two log files (webservices.log and webapp.log) capturing the events that are specific to each o...

Adobe Air vs Java for Internet Cafe Time Manager Application.

Hi, I'm planning to do a little project to expand my knowledge in programming. The application I'm trying to build is an Internet Cafe Manager (I Know there are a lot software out there that is similar to what I'm building.). I had chosen this project since it involves connecting to a network, displaying data and time, and has a client ...

Does a published endpoint have a limited number of connections? [Java 1.6.0_16]

I've created a Web Service using import javax.xml.ws.Endpoint and a client that connects to it using Service.create and service.getPort. Now, everything works perfectly fine when only using a small amount of connections... But - if I launch lets say 1000 concurrent connections (Clients) to my Web Services I get the following "sometimes"...

Tic Tac Toe help

I've written a tic tac toe code that fine to a point. I have Alpha-Beta Pruning working also. I've ran across a problem that I need ideas, NOT CODE. How can I choose a move that will win in 4 moves versus a move that will win in 8 moves. The problem I'm having is the branch that returns a optimal score from minimax/AB prunning will possi...

Wait for all threads in an Executor to finish?

I'm implementing a parellel quicksort as programming practice, and after I finished, I read the Java tutorial page on Executors, which sound like they could make my code even faster. Unfortunately, I was relying on join()'s to make sure that the program doesn't continue until everything is sorted. Right now I'm using: public static void...

Username & password string comparison problem

When I enter "abcd" in the passwordField, and use System.out.println(s21) - to check the password - it shows "[C@1372a1a", why? private void submit() { String s1 = userNameField.getText(); char[] s2 = passwordField.getPassword(); String s21 = s2.toString(); if (s1.equals(management.getUsernamesAdmin())&& s21.equals(m...

How can I have multiple SSL certificates for a Java server

I have an in-house HTTP server written in Java; full source code at my disposal. The HTTP server can configure any number of web sites, each of which will have a separate listen socket created with: skt=SSLServerSocketFactory.getDefault().createServerSocket(prt,bcklog,adr); Using a standard key store created with the Java keytool, I c...

Java, Sockets Connections and HTTP Requests/Responses

In an application I need to use Socket connections as well as Http requests/responses in Java, I have done some work with Tomcat but I think it handles only HTTP requests/responses. I was thinking of using Java Networking(java.net.Socket and java.net.ServerSocket), make a jar and run it on the server to handle the sockets and use Apache...

Java Music Player GUI

Hello. I am implementing a GUI using Swing for a Java Music Player. I'd like to know if it is possible to make a time bar like the bar in WinAmp for example that can be moved to jump to a certain position in a song and shows the current position. If possible, how would one go about this? Also, I'm using a JList to display Playlists and ...

Java to Python RSA

I'm trying to encrypt a string from Java to Python, using the library Bouncy Castle J2ME on the client side and Python M2Crypto on the other. Everything is pretty good, I can decrypt it properly, but the padding is the issue. The M2Crypto lib gives me (as far as I can tell) only these Padding schemes: no_padding = 3 pkcs1_padding = 1 s...

Connect two calls via web application.

I need to add a functionality to my java-based web application that will allow users to click on a link and the application will automatically call the user and another party and connect them in a phone call. Does anybody know what would this entail? Thanks ...

How can we make a list editable??

I'm using NetBeans and I want to make my list editable,what should I do ?/ also I work with NetBeans GUI builder. ...

web.xml filter-mapping not forwarding to struts

Hello, I am trying to do something trivial and can't see what I'm missing. I have the following web.xml... <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>*.do</url-pattern...

What is RESTFul Web Services in Java

Well as the title suggest, what is this Restful Web Service thing in Java, What are its benefits over SOAP Web Services, why the hell someone implemented again some other technology? What is the reason to use Restful one instead of SOAP one? For example I will give a service which will be accessible for many clients from high level lang...

how the code behaves different for java and C compiler ?

I have this Code, i ran this on Java and C ,but they give me two different Results What is that makes them to run differently. x=10;y=10;z=10; y-=x--; z-=--x; x-=--x-x--; The Output in java for value of X is : 8 and for C it is 6 How these Two compiler Behaves differently for incremented options.?. ...

How to remove the active title bar of a frame?

I have a JFrame which displays a title bar. Active title bar as it's called in Windows desktop properties. How to remove this bar? ...

Getting java source method name list given an ANTLR java grammar?

Given an ANTLR Java Grammar - what java source code would I write to get a list of method names in a java source listing? eg for the following public class HelloWorld { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub new HelloWorld().printHelloWorld(); ...

Ignoring large files in IntelliJ file search

We have a large file (9mb) in our SVN project structure. Whenever I Ctrl-Shift-F (find-in-files) in IntelliJ and search, I get the popup "large file encountered" asking me if I want to search within this file. Is there a way to permanently disable this popup, either globally or for this specific file? ...

Reusing java source in multiple projects

I'm currently developing for Android using Eclipse. I have a lexicon viewer application (with package name "com.mycompany.myviewer") that I want to reuse multiple times, just changing specific resources such as app name and icons. For example, I have a certain publisher "Publisher1", who publishes the lexicons "Lexicon1" and "Lexicon2". ...