Main Topics
Browse All TopicsNote I am completely new to java. I need examples of source code for a simple calculator applet, yes it is an homework assigmnent. I have set the layout for the button of the calculator but I do not know how to make the work. For this...
I have run into a problem that I can't seem to find a solution to.
my users are copying and pasting from MS-Word. My DB is Oracle with its encoding set to "UTF-8".
Using Oracle's thin driver it automatically converts to the DB's default...
I have a program to encrypt and decrypt a file using AES encryption standard.
It works fine within the same class.
Now I want to implement the same in different classes in different machines.
File will be encrypted in one machine and will be...
Dear Expert,
I'm trying to use Jasper Reports for exporting Excel documents (and other too: RTF, XML, CSV).
I've already gotten HTML, PDF and XML to export correctly; I just cant seem to figure this one out.
Please correct the code...
Hello Experts....i am new to android..!!
In My Project I am implementing scribble pad,i have used OnTouchListener event to draw on the canvas,but it is not drawing properly....i am sending my code sample and output screenshot..!!
Thanks..!!
I have added a new column in the database table and am trying to insert a record into the table using my application. The application throws the following exception:
com.ibm.db2.jcc.a.SqlExcep
Hi All,
This should be an easy one, but I'm running out of time and need this asap. I need to download the Microsoft Access ODBC Driver so that I can set up a User DSN that my Java programs can connect too. I was shocked when I went into...
Hi
Since updating to Java, ( 6.31) I keep getting a pop up, even with no applications running at all
"Revocation information for the security certificate for this site is not available. Do you want to proceed"
I view the certificate...
Hi,
I am creating Excel file using org.apache.poi api
Here is the URL
http://www.javaworld.com/j
I wanted my data to display in the spreadsheet exactly like in the above example
I am able...
My question is regarding coding in Java for logout part, I have a code in hand, it return to login page(index.html), but when I click IE "Back" botton it bring me to prevous page. How can I adjust code such that once I click IE "back", IE...
I got this error
Got an exception!
null
Hi,,
Just started in Java and I have to code a Java Applet that displays 2 buttons one to draw a circle and the other to draw a rectangle when pressed. When the Circle button is pressed another box is displayed for the user to enter the radius...
hi guys
I am upgrading my websperhe application server and during the process i get this message
"A suitable JVM could not be found. Please run the program again using option -is:javahome <JAVA HOME DIR>"
and thats what i did, from my...
hi ,
i am roy.
am working on a client application to connect to a secure server.
i have the client certificate for the server & self signed certificate from
issuing authority who issued the certificate to the...
My package is com.mycompany.mypackage - i.e. classes are com.mycompany.MyClass etc. I'd like to log INFO from my package in a dedicated log file, using log4j. I need to use the XML configuration for reasons beyond the scope of this question.
I...
Can i add combobox to the code 1 (since AbstractTableModel is used there).
I know this is possible with DefaultTableModel as shown in code 2
Basically i want to build a JTable with 7 empty rows that is not editable by default (the use can make...
I am trying to find a ReadToEnd function to remove special characters (carriage returns) from a file. Please review code and provide input. Thanks in advance.
Explanation of Code:
1) The attached code reads the contents of the file into a...
Hi
Iam trying to Conver a String(mm/dd/yyyy) to Date
Here is code
DateFormat myDateFormat = new SimpleDateFormat(strFormat
Date myDate = null;
try {
myDate = myDateFormat.parse(strDate
} catch (ParseException e) {
...
I have GeoServer deployed with Tomcat and is setup to be Basic Authentication
I've been having some issues with my java client application successfully authenticating
It appears in the Tomcat log files from the GeoServer entries that 2 Get...
I would like to convert result from request.getParameter("myIn
Hi,
I'm having some problems implementing the examples on the display tag website for creating dynamic links using a table decorator.
I have the following setup:
I have a jsp page that displays my table (data is pulled from a...
I require a login form created in java asking for a username and password. The password can either be hardcoded or coming from a text file.
If the user logins unsuccessfully it displays a msg and the user retries for 3 times after that the app...
Hello
I'm trying to create a message box using this, but when it gets to this line
int answer = JOptionPane.showConfirmDia
the code bombs out, debugger stops and i don't get an...
Hello everyone,
I am using Netbeans 5.0 and I have successfully connected to and populated a MySQL database.
I am trying to display the results in a JTable. I have seen many examples of creating only a JTable in a new JFrame but I would like...
Hi guys,
I am trying to open pdf file in browser Internet Explorer from the Servlet. Instead of opening in the browser, It always starts Acrobat and opens the file there. I think I am setting all parameters (Content Type, Content Length and...
Hi
I have a multi-threaded Java MQSeries application which runs OK most of the time. For throughput reasons, the application can be configured so that many threads can be run to read messages from a remote Queue Manager. Typically, four...
After I downloaded Servlet API from http://java.sun.com/produc
I have 3 related combos on an aspx page. The 3rd combo populates a RadGrid when it is selected. When this happens and the page posts back the combo selections disappear. The data is coming from SQL2005 for the combos and grids. I have 2 scenarios...
Hi there,
I'm playing about with Java and I'm trying to create a JPanel that displays a given image. This image should resize as the panel changes size while maintaining the aspect ratio of the image.
Currently I have the given code for...
Hi everyone,
I'm trying to connect up to a web server(using httpurlconnection) from my application running behind a proxy server. Basically these are the steps I am taking:
1. Make a connection to the page www.sms.ac/login.asp
2. I then read...
I have a friend that is also taking a class and is having a problem with the size of his JButtons. All he wants to do is increase the width of the buttons so the lable can fix inside the button and not have "...." in the button. Here is his code:...
Hello, I am trying to decrypt PGP encrypted file. The file was encrypted using my public key that I generated. I could encrypt and decrypt the files that I created locally using bouncycastle API, but when my client encrypts the file on his side I...
Hi,
I am reading XML in Java using XPATH
When I am reading XML I am getting exception on some of the XMLs which as & in it.
Example is attached
I am able to read all other XMLs perfect but some XMLS are throwing exception below
...
Why doesn't Java take default parameter values?
I don't understand why they would leave this out of the language.
I know you can accomplish the same thing by overloading and calling the main function with default values, but this seems like...
Hi,
please look at the following jsp, which should download and display a PDF in my current browser window:
<myDownload.jsp>
--------------------------
<%@page import="java.io.*" %>
<%
BufferedReader...
hi Experts,
I've installed MQSeries on different client and server machines.
I've got this error while I try to put a message on the queue using the amqsputc sample program:
...
I need to find out what version of MQ running on my server, but I dont see any folders like /usr/mqm or /usr/lpp/mqm, OS is AIX 5.3 L
Hi is urgent here , i m facing some encryption and decryption problem between midlet and tomcat server , i encypted in midlet then send the tomcat server for decryption
But whenever decrypt in tomcat server, it showing...
Hi JBoss/Java Experts,
This is a somewhat long post, for which I apologise, but I want to ensure I have included all pertinent information.
I would like to reliably monitor (and report on) the number of active sessions for a particular web...
Hi I have a JFrame to which I am trying to add an image to it. I'm to to this GUI stuff and I'm not sure how to do it. I want to add the image to the JPanel (the blue area). Can anyone help with this?
I have an XML in the form of
<feedback>
<fb_info>
<fb_id>27006971</fb_id>
</fb_info>
<fb_responses>
<fb_input_approve>
<res_id>123</res_id>
</fb_input_approve>
<fb_response>
...
I have to compare system time stamp with the recorded timestamp and check if the difference is 90 days or more.
My program works....but not in all cases. Here is my piece of code. I am converting in nanoseconds to compare the two timestamps....
Hi.
I need a method to convert milimeter to pixel.
I'm using the iText to generate pdf'docs. When I set the document size I need a com.lowagie.text.Rectangle
The Rectangle takes float width, float height as arguments and I guess it...
I got a problem, my goal is, to modify a Word template with parameters,
and write the response into a new Word file. I tried several things before
and nothing worked...
My last try is based on a sample but throws still errors.
Here is the...
Ok so i am trying to make a simple chess game using java and these are the instructions i got from my proffessor: Purpose:
The purpose of this project is to demonstrate that you can use the object oriented principles of polymorphism,...
Hello,
I'm using this code fragment to test if an object in a Vector is a double before I access it...
bisNumber = true;
try { testDouble = Double.parseDouble ( ( prices.elementAt(3) ) }
...
I am using Java 1.4 in eclipse and I am getting the following errors:
"The project was not built since its build path was incomplete. Cannot find the class file for javax.servlet.http.HttpSer
I have a HPUX server with java 1.5.0.03
I have several java applications running on this server.
The problem is that the java applications use the wrong timezone when logging to a logfile. They use GMT time instead of GMT+8
I have tried...
I have a variable "$V{Late}" in the detail section that looks at date ordered & date received to determine if it was late. If it was late I get a "1" if it was on time I get a "0".
On the page footer I put a variable "$V{ToalLate}" which adds...
I want to install android with eclipse as that is the reason I got eclipse.
http://developer.android.c
I have installed android from the instructions but dont get the same screenshots.
I followed the instructions...
Hi,
I have this hex string, "1EA23", I would like to put this hex string into a byte array...
For example...
String hexString = "1EA23";
byte byteArray[] = new byte[4];
the value of byteArray should be...
byteArray[0] = (byte)0;...
I'm using Spring 3.0.2.RELEASE, Hibernate 3.3.2.GA and JUnit 4.8.1
I have a simple DAO that does NOT use HibernateTemplate, that has a saveOrUpdate method that looks like this:
The sessionFactory is injected and is an instance of...
Our application works fine, but I cannot turn on validator for it - got an exception:
java.lang.IllegalArgumentE
at org.apache.commons.validat
at...
I'm having troubles getting JavaMail to work with authentication, using an outside SMTP-server. The server is not the server of my ISP (the one which connects me to the internet now). I can use this SMTP-server to send mails with Thunderbird, so...
I'm writing an application that uses native code (which I didn't write) which is bundled in several DLLs. I put them into a folder \lib.
At first when I ran the app, it complained that it could not find main.dll (which is the DLL that depends...
I am beginner and I would like to create a connection to ms sql server and I have an Error Message: java.sql.SQLException: No suitable driver found for jdbc:microsoft:sqlserver:/
Hi all,
i am using Struts 2. I have a Map that looks something like this.
Map<String,Object> map=new LinkedHashMap<String,Objec
Suppose key-values are
q1-object1
q2-object2
q3-object3
How do we get the value of say "q1"...
Help Me to resolve this issue:
I am deploying war file in JBOSS server, which is processing Weblogic Queue messages .
I was implemented below code to access and unmarshal xml messages from the Queue...
Hi folks,
We are experiencing a very strange problem when submitting a form in Struts, and we would really like to fix the problem instead of using a patch.
Here is the problem :
1. The user fills the JSP form as usual;
2. The user...
Hi,
I configure data source in struts-config.xml using oracle JDBC driver my prbm is that,i want to use DataSource in my action class , so i did like this
OracleDataSource ds=new OracleDataSource() and try to get connection by using
...
Hi,
Below is the class which sorts the list of strings and integers. I passed the arguments as 115R 1125R 147C 37R 57R 37C and it shows the result as 1125R 115R 147C 37C 37R 57R. But the problem is I want the output as 37C 37R 57R 115R...
Hi!
Have a gui application that is made in netbeans.
Therei have a jtable that have a progressbar, and i am include
the source for this. This progressbar is working JUST FINE.
But now i want to add a new colum to the jTABLE that is a...
I've run into some problems in trying to add or delete items and also listening to item selections for a combo box that is rendered in a JTable cell. I've been able to create the JTable and have a column as JComboBoxes,
but I can't seem to add...
When connecting to using Type 1 JDBC drivers, we do something like below
Class.forName("sun.jdbc.od
conn = DriverManager.getConnectio
But what is ...
I'm trying to run the JSF/AJAX example by Tor Norbye (http://blogs.sun.com/roll
- downloaded and installed the AJAX Textfield component...
I need some assistance returning the query I wrote into a JList. A worthy example might be enough for me to get the task done.
The code below compiles and connects to the database, so the only task left to do is populate the JList with the data.
I have a VARRAY type in oracle.
Type ValueList is Varray(100) of varchar2(4000);
and a procedure like this
procedure proc_name(a number, b varchar2, vlist ValueList, c in out varchar2, d in out number, e in out varchar2);
Both the...
I need new pair of eyes to point out where my mistake is.
This program works to remove the leading and trailing zeros from the given String,
I also want to remove the decimal point if it is on the last position.
for instance, the string is...
Hello,
I execute a SQL statement, but the values of the resulset are diferents. I set the ArrayList as String and I try to extraact the resultset but I just get the Object for example Ljava.lang.Object;@1d31f85
I read like this:...
Hi, I've been trying to create a Java program which takes an algebraic expression in infix notation, translates it into postfix notation, and builds an expression tree (BinaryTree) from it.
Here's an example to demonstrate infix vs. postfix...
I am trying to change a setting with in the Java control panel, that sets the parameter for instance "-Xms160m -Xmx350m -Dsun.java.noddraw=true -Djavaplugin.trace.option=
Hi,
I am new to spring/java and have picked up an existing web project in which i need to add a help page/s. A tech writer in the organization has created the help index using Author-IT which creates a tree-view like searchable help page.
...
I want a function that converts an int to String, with left padding of a specified number of zeros. I know I could do this with a loop, and count characters, but I want a simpler method. I thought there was something like that already in the JDK...
How can I conver an integer variable to a String variable?
int val1 = 34;
String val2 = (String) val1;
Above does not work:
inconvertible types found : int
required: java.lang.String
String val2 = (String) val1;
...
I want to execute a SQL UPDATE using createSQLQuery. However, when I run executeUpate() it gives the exception:
java.lang.RuntimeException
The code is as...
Hi experts,
I am trying to deploy web app in linux server that runs tomcat 6 and apache server and I am having errors. I googled it and removed "jsp-api.jar" and "servlet-api.jar" files under WEB-INF/lib dir, but still having errors.
Any...
dear experts,
anyone have the source code to convert infix to prefix in java by using stack method (linked list). i found a lot is infix to postfix but none infix to prefix. please help. thank you
I want to set some values in the excel sheet using POI. These values must have the required character formatting like bold, italics and underline.
Say, the value that I need to set in some cell in the excel could be something like
...
Hi,
I need help to import certificate in tomcat. My actual certificate expired in January and i have a new Certificate in PFX Format. I follow this steps to renew the certificate but i can´t se the new certificate:
1- Generate the Keystore...
My application is running fine with Java 1.5, Oracle JDBC driver 10i with Oracle 10i database. In this application, there is a part of code which uses getColumnType of ResultSetMetaData function to find out the column type of the particular...
I am trying to use a inputHidden JSF field but I can't figure out how to bind the value of it to a bean property. Here is what I have so far.
<h:form id="formGetForm">
<h:messages/>
<label for="orderId">Order ID: </label><h:inputText...
I need some help implementing the drawPolygon function to connect the star points.
This is what I have gotten so far:
<code>
import javax.swing.*;
import java.awt.*;
public class Texas{
public static void main(String[] args){
...
I want to read the content of a directory in JSP. I have some example code, but can't get it to print, except "NULL".
Hi, As per the below related question and solution in the same I have followed the steps but I am getting run time error while filling the jasper report. Followerd were the steps.
1. I created MainRptBean(name, address), SubRptBean (phone,...
Hi all, I’m trying to get the total number of rows return to a result set, aside from manually counting them using while(rs.next()) {count++}, I can’t find any other way, is there a function that will provide this, because let say I have 15,000...
Hi,
I have a png wrapped in an Image object. I can draw it to screen like:
public void draw(Graphics g)
{
g.drawImage(img, 0, 0, Graphics.TOP | Graphics.LEFT);
}
Now the image is 128 x 160 pixels.
Is there a way...
I am having project with working on weblogic 10.3.But some issues i am implementing weblogic9.2,so i am getting weblogic compatible error, please see the below error code.
I am able to deploy the code but when running code getting error like...
I want to implement a bully election algorithm with seven processes(p1 to p7) communicating.where highest numbered process will be coordinator when it is down.Any of the lower number process can intiate election like p4 but the election is won by...
Hello,
I am working on a Windows target client application that will not have any Oracle client software installed in the system. I am new to using JDBC to connect to Oracle. I am using Java 1.6 (javac 1.6.0_11).
1. What Oracle JDBC...
I have encountered the error java.sql.SQLException: You cannot commit with autocommit set! while commiting the transaction. I am taking the connection via javax.sql.DataSource & I didn't set autocommit to false while taking connection the...
I'm trying to create a web app with Eclipse, but when I create the servlet, I get the error "Cannot be resolved to a type" everywhere. For HttpServletRequest, HttpServletResponse, javax.servlet, etc. What is the problem?
import...
Hi, I'm trying to figure out my homework assignment but i get errors.
THIS IS THE ASSIGNMENT:
Design a payroll class that has fields for an employee's name, ID number, hourly pay rate, and number of hours worked. Write approperiate...
I try to pass param to the url, dinamically, onblur of a form field. I'm trying to get information of device based on it's serial number. I created onblur javascript which triggers dojo event and it works fine, but how to pass this value (serial...
I have a web application, which connects Oracle RAC 11g using hibernate (my configuration is below).
However, no matter what I do, even though the connection URL specifies it, there doesn’t seem to be any load-balancing or failover. When I...
Hi all,
i am new to JDeveloper and J2ee.
i opened an application in Jdeveloper 11, and complie it, it is fine. run it, i got error java.lang.NoClassDefFoundE
what library i missing?
thanks a lot
Hi ,
inside my hibernate.cfg.xml I am mentioning
hibernate.default_schema as schema name (say "testSchema") and it is working with named queries and HQL as expected.But when I am using a native sql query ,say
String queryString= 'select...
I am attempting call a simple webservice through a client, but I continue to get the following exception. I am using JBoss as my application server. Everything compiles in Eclipse (Note I am using java 6).
1. Am I supposed to change the...
Can anyone help where I can get the tutorial or documentation on pega systems?
Experts:
All I can find is code for accessing a thread via its index in an array of threads or the current thread:
Thread.currentThread().int
I am using the ExecutorService to create a pool of threads....
I am trying to create a web service client. I am using Netbeans 6.0.1 and created the client according to the netbeans documentation. Netbeans is using JAX-WS for that purpose.
I am having the exception shown below and I am in need of help.
...
for_yan
893,063
Sage
1,000 points yesterday
ProfileCEHJ
258,666
Guru
1,050 points yesterday
Profilemccarl
93,106
Master
3,000 points yesterday
Profilegirionis
90,218
Master
0 points yesterday
Profiledpearson
86,565
Master
498 points yesterday
Profilechaituu
62,368
Master
0 points yesterday
Profilegudii9
57,252
Master
1,000 points yesterday
Profilesharonseth
47,283
501 points yesterday
Profileksivananth
39,726
0 points yesterday
Profilegordon_vt02
28,625
0 points yesterday
Profilesimonet
27,400
0 points yesterday
Profilemrcoffee365
23,455
0 points yesterday
Profiledravidnsr
20,609
501 points yesterday
Profileobjects
20,284
0 points yesterday
Profileknsp
18,558
0 points yesterday
Profilegurvinder372
18,104
0 points yesterday
Profilesanthanasamy
16,800
0 points yesterday
Profilemplungjan
16,568
0 points yesterday
Profilestmani2005
15,089
1,000 points yesterday
Profileramazanyich
14,200
0 points yesterday
ProfileCPColin
13,836
0 points yesterday
Profilearioh
13,298
0 points yesterday
Profilezzynx
12,280
0 points yesterday
Profilealexey_gusev
12,000
0 points yesterday
ProfileGertone
11,752
0 points yesterday
Profile