32,199 Topics

Member Avatar for
Member Avatar for Venks

Hai Friends, How to access multiple result sets in java? iam using getMoreResults, but iam able to access only half of data from second table... is there any way to access. please help me for this problem

Member Avatar for jeremfg
0
147
Member Avatar for 47pirates

I've a bill which looks like ![untitled31](/attachments/large/2/untitled31.JPG "untitled31") this is the paper which i use in printer and i want to print the appropriate value in the correct position of that paper. As in the place of date i want to print date and in the place of Rate, Amount …

Member Avatar for JamesCherrill
0
133
Member Avatar for rahul.ch

Two doubts: 1. Placing run() inside main() generates "illegal start of expression error"? So why can't run() be placed inside main()? 2.With the above code I am getting the output as A C D B. Why B comes last is because of join(). But what I'm unable to understand is …

Member Avatar for rahul.ch
-1
226
Member Avatar for amin.sohal

Hi, Here I face one problem in java application. I am working on one project, developed in java 1.4 & 1.5 swing, jboss, applet on netbeans 3.6. But I got an error when I try to debuge or execute in netbeans "IO EXCEPTION WHILE READING: Localhost". Project is successfully build. …

Member Avatar for rubberman
0
92
Member Avatar for rahul.ch

I have a question in SCJP text book by Kathy Sierra and Bert Bates in Development chapter. Q. Given the default classpath: /foo And the directory structure: foo | test | xcom |--A.class |--B.java And these two files as mentioned in the code snippet section. Amongst the choice, 1. javac …

Member Avatar for stephen84s
0
315
Member Avatar for rahul.ch

General rules is that: 1) A private method cannot be overridden. 2) Subclass method should be a lower access modifier than a overridden superclass method. But the output of the program is "I am Son". Why? Is it because of the rule 2 the output comes? If that's the case …

Member Avatar for JamesCherrill
0
204
Member Avatar for rahul.ch

Hey guys, I'm a starter so I had a doubt related to placement of a static variable. On line 5, for "static int d=5" compiler issues "illegal start of expression". But when I place it outside main() as Instance variable it works and prints "Hello 5". Why this thing? public …

Member Avatar for rahul.ch
0
200
Member Avatar for Viped

Hi again. I am trying to make code that set all black pixels to white. But my code does nothing. Why is that? package net.viped; import java.awt.image.BufferedImage; public class ImageManipulation { public ImageManipulation() { } public BufferedImage setTransparent(BufferedImage image) { for (int x = 0; x < image.getWidth(); x++) { …

Member Avatar for Viped
0
324
Member Avatar for aabj1989

import java.util.Scanner; public class waterbill8 { public static void main(String[] args) { Scanner reader = new Scanner(System.in); double value1 = 5.00; double value2 = 0.82; double value3 = 0.65; double value4 = 0.42; double value5 = 15.00; double value6 = 1.47; String read1 = null; char I, R; int num1, …

Member Avatar for hszforu
0
148
Member Avatar for Bladtman242

Hi, for a school project (exam actually), we've written a ternary trie for text-completion. We fill it with about 400.000 lines of text (13 MB in total, as UTF-8). Now, java represents characters in UTF-16 i believe. So thats 26 MB, + another 26 for saving the complete strings in …

Member Avatar for Bladtman242
0
212
Member Avatar for eves007

So I wrote this code for generating a maze, when I run it i get ArratOutOfBoundException. sometimes it gives me the error after generating the maze once but sometimes I generate couple time then it crashes. I feel like my error is in the while loop but can't find it. …

Member Avatar for stultuske
0
129
Member Avatar for skiabox

I am trying to overlay a moving average over a OHLC chart but I get no results. Any ideas on what am I doing wrong ? private static OHLCDataset createPriceDataset(String filename) { //the following data is taken from http://finance.yahoo.com/ //for demo purposes... OHLCSeries s1 = new OHLCSeries(filename); try { BufferedReader …

Member Avatar for skiabox
0
249
Member Avatar for B204

Following are the server-client programs,,,, in this client can send files and server have to save it,,,,,i want to add progressbar.....plz help me out!!! client:- import java.net.*; import java.io.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; class ftpclient extends JFrame implements ActionListener { JButton b1,b2; JTextField t1; ftpclient() { b1 =new …

Member Avatar for JamesCherrill
0
395
Member Avatar for antipala21
Member Avatar for B204

i have created a chat program and i want to add smiley to it......i know how to add smiley in a program,but my logic works for single smiley in a message.......want logic for multiple smiley in prgm,,,, int zi=msg.indexOf(':'); if(zi!=-1) { try{ st1=msg.substring(msg.indexOf(':'),msg.indexOf(':')+2); String msg_start=msg.substring(1,msg.indexOf(':')); int msg_end_index=msg.indexOf(':')+3; if(msg_end_index>msg.length()) msg_end=""; else …

Member Avatar for stultuske
0
215
Member Avatar for yazz110

Hi Everyone, Starting to write **3D images** using** JOGL **and I can't seem to find any **recent information** and help about **JOGL** and creation. I noticed that most of the terms have changed and it doesn't work. Any **recommendations** on what I could read to help update me and keep …

Member Avatar for yazz110
0
251
Member Avatar for trishtren

Hello, Iv been trying to work through some issues on binary output recently. But im having problems understanding the conversion process in java when using two's complement. I dont understand why System.out.println(Integer.toBinaryString(-11700)); Prints out 11111111111111111101001001001100. Shoudlnt -11700 only be 15 bits long? When i calculate it by hand and invert …

Member Avatar for JamesCherrill
0
164
Member Avatar for 47pirates

I'm trying to print the necessary values in the predefined document for an example, in a Bill name in the left side and date on top right. I already had that documents with empty name and dates . how can i print the name and date to corresponding location in …

Member Avatar for 47pirates
0
142
Member Avatar for bettybarnes

Hello guys, I'm trying to make a list of students grade using array. My question is, how am I going to do this? **OUTPUT:** Lea 94 Morgan 85 Jenny 92 Harold 75 I've tried a bit to program, please do check my code. public class StudentScoreArray { public static void …

Member Avatar for Vs5193
0
97
Member Avatar for Viped

Hi, could some one look over my code I by myself dont get where the flaw is. It should paint 1 cube at a time but now it runs all the code through and paints all at once. package net.viped; import java.awt.Color; import java.awt.Graphics; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import javax.swing.JFrame; …

Member Avatar for JamesCherrill
0
956
Member Avatar for hszforu

I think the following code should print 26 but it's printing 62 instead. public class gjh { public static void main(String[] args) { int x = 2; x += ++x * ++x * ++x; System.out.println(x); } } So how is this possible?

Member Avatar for hszforu
0
107
Member Avatar for shammons1

All, I'm very new to java having done most of my scripting in Javascript and a little bit in other types of programs. I'm basically trying to obtain a script variable and compare it against a condition and return some println messages. Here is my code: String agentType[] = request.getParameterValues("Agent …

Member Avatar for JamesCherrill
0
1K
Member Avatar for godzab
Member Avatar for GlenRogers

In my applcation I have a JText field for entering a phone number. Is it possible to make it only accept numerical characters? Or should i wite a method to alert the user if they enter any other characters into it? Thanks

Member Avatar for GlenRogers
0
128
Member Avatar for karthick2388

Bold Text Here ** java.io.ByteArrayOutputStream fos = new java.io.ByteArrayOutputStream (); java.io.ObjectOutputStream oos = new java.io.ObjectOutputStream(fos); oos.writeObject(chmObjSessionKeyValue); //ConcurrentHashMap oos.flush(); oos.close(); byte buff[]=fos.toByteArray(); ps.setString(2,strSessionId); ps.setBytes(1,buff); ps.execute(); //Read object java.io.InputStream in=null; while(rs.next()) { in=rs.getBinaryStream(2); } java.io.ObjectInputStream oos = new java.io.ObjectInputStream(in); java.util.concurrent.ConcurrentHashMap chmObjectSessionInfo=(java.util.concurrent.ConcurrentHashMap)oos.readObject(); CoreLogger.log("Concurrent hashmap object::"+chmObjectSessionInfo); oos.close(); > `Inline Code Example Here`** *Bold Text …

Member Avatar for karthick2388
0
202
Member Avatar for dorien

I am trying to run an easy Android ndk app in cpp, but I get UnsatisfiedLink Error for the Generate() function. Any help would be appreciated. I am quite fluent in c++, but my java is a little bit rusty. I have been trying a lot of tips from the …

Member Avatar for dorien
0
278
Member Avatar for GlenRogers

I have a TreeMap<String, Customer> (Customer is a class I have created). Customer objects hold a HashMap<String, Repair> (Repair is a class I created). I wrote a method to find a given Repair, this is it: public void processFindRef() { if(ref.length() == 6) // ref is the string we want …

Member Avatar for GlenRogers
0
170
Member Avatar for B204

Following code is for deleting elemnt from array but it shows NullPointerException at **if(names[k].equals(user))** ... how to remove it!!! public class del_array { public static void main(String s[]) { String names[ ] = new String [10]; names[0]="admin"; names[1]="b"; names[3]="m"; String user="b"; for(int k=0;k<names.length;k++) { if(names[k].equals(user)) { String item=names[k]; for(int j=k;j<names.length-1;j++) …

Member Avatar for stultuske
0
200
Member Avatar for ganges

hi friends kinldy suggest me a suitable version of linux os which is suitable for java,j2ee programming ,mysql and oracle thanking you

Member Avatar for godzab
0
94
Member Avatar for GlenRogers

**alue** I have a Customer class and a Repair class I have a TreeMap(customerDetails) of type <String, Customer>. Each Customer object holds a HashMap(repairs) of type<String, Repair>, the String represents the ref number of the repair. The user of my system types in a ref number, the program searches to …

Member Avatar for GlenRogers
0
110

The End.