32,199 Topics

Member Avatar for
Member Avatar for l_03

import java.io.*; import java.util.*; import javax.swing.*; import java.util.StringTokenizer; public class Sample { public static int count = 0; public static String s[]=new String[2]; public static String s2; public static String s3; public static void main (String args[]) throws IOException{ isRead(); } public static void isRead()throws IOException{ int count2 = 0; …

Member Avatar for verruckt24
0
110
Member Avatar for rude04

i used setundecorated(true); to remove the buttons and border of the window,,the problem is the frame only stays where it is, because the title bar is removed i cant drag it around the screen anymore.. what code should i add to be able to drag it anywhere in the scree …

Member Avatar for darkagn
0
209
Member Avatar for Coyboss

Hello everybody, I know what I want to do with the code, but I am not sure where exaclty to put the "if" statements. I am working on a weekly payroll program and I need to put in an if statement so it throws an error if the weekly hours …

Member Avatar for Coyboss
0
270
Member Avatar for puneetkay

Hello everyone, Im back, with a new problem. LOL! I need to change Java datatypes to SQL types. I have sql queries as String object. like this one : [CODE=sql]create table MyTable ( id bigint, name String , city String , state String ) OR create table MyTable ( id …

Member Avatar for masijade
0
176
Member Avatar for lllllIllIlllI

Hi I have been using java.swing for my GUI programs so far and i kinda hit a brick wall, and i think its a stupid one on my account, i cant find a way for something to load a html file to the screen using a java.swing control. This is …

Member Avatar for stephen84s
0
86
Member Avatar for lllllIllIlllI

Hi When using java, for almost all the time i just use java.swing for my applications that i make, yet when using other programming languages i often find that the GUI toolkit that comes bundled with the download of the Development Kit, is not quite as good as some third …

Member Avatar for stephen84s
0
133
Member Avatar for sivak

i have 2 combo box country and state if i select any one of the countryin first combo box automatically partcular state shoudl display in second combo box ...can u tell me javascript coding for this ?

Member Avatar for virang_21
0
83
Member Avatar for freesoft_2000

Hi everyone, I am trying to insert a image into the jtextpane using the html document as the default document for the jtextpane. It seems that nothing happens when i try to insert the image from disk. htmldoc - an instance of the HTMLDocument class TextPane1 - an instance of …

Member Avatar for arseniew
0
142
Member Avatar for Tavicz

Wel, I have discovered, how to copy one text file to another,yet. (See code bellow). However, I really need to Cap every word in the source text file and copy the text that way to the second file. But I'm desperate. I tried few ways to make it (via Character.toUpperCase()) …

Member Avatar for Tavicz
0
139
Member Avatar for RohitSahni

I will be starting working on perl and java soon.. Can anyone please help, form where to start so that i get the confidence of working on it and i can do hands on.

Member Avatar for verruckt24
0
158
Member Avatar for Modo

hi guys how r u doing .. i am trying something in java .. i want to know if there is a way to the java looks into the current year. i want to be to return the age of someone after filling in his birth year .. and then …

Member Avatar for Modo
0
137
Member Avatar for srs_grp

[code] stm =con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE); rs=stm.executeQuery(qry); rs.last(); String s=rs.getString(1); [/code] I have backend as sybase. But above code is throwing an error as follows: [code] Error [Sybase][ODBC Driver][Adaptive Server Enterprise]HEADERFORMAT1 not found. Specify owner.objectname or use sp_help to check whether the object exists (sp_help may produce lots of output) [/code]

Member Avatar for stephen84s
0
182
Member Avatar for jjaunich

Hi, I've just started a Java course, which is giving me trouble because I've had so much unscheduled overtime. I have three programs due that have small problems that I can't fix no matter how many changes I've made. They are really basic, but I've only been one week into …

Member Avatar for verruckt24
0
150
Member Avatar for localp

i wont to use shocket programming to create a chat client. and the end users should be given a GUI interface. are there any sample codes available online .. please help me find some sample codes..

Member Avatar for stephen84s
0
32
Member Avatar for OracleLite

I'm in the process of writing a program that generates six random numbers. If I run the program I have so far, there's a bit of a problem. It is possible for this code to generate the same random number more than once. Generally speaking, lottery tickets require the numbers …

Member Avatar for javaAddict
0
484
Member Avatar for java2000

Im trying to make a counter that tells how many times a name appears with array. I am using a scanner that read the names from a file and stores it an array. It then uses random class to pick a random name. I then stored all the names that …

Member Avatar for java2000
0
172
Member Avatar for ub_old

Hi all. I have string contains xml content. I use dom xml parser. Below is my parse code. DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document doc=builder.parse(new InputSource(new StringReader(xmlText))); It works but very slow. too slow. If i write xml to file and parse from file like builder.parse(filePath) then …

Member Avatar for sillyboy
0
133
Member Avatar for zaraeleus

Okay, I am a new student (to Java--well programming in general) and the first assignment we have is to create a program that computes the future value of an investment based on three user inputs (principle deposit, interest rate, and length of term in years). First of all, I am …

Member Avatar for zaraeleus
0
687
Member Avatar for alpha_gamma

Hello, I downloaded some code from coreservlets.com and put the code on BEA WebLogic 8.1. The code is actually from ch4 of the book "Core Servlets and Java Server Pages (Hall/Brown)". I wanted to run a particular html form that one fills out then goes to a servlet. The html …

Member Avatar for peter_budo
0
142
Member Avatar for rapture

I'm new in Java and supposed to write a program that prints a number into a diamond shape. It doesn't print correctly, can someone point out where I'm messed up? [code] private static void diamondOfAsterisks(int number) { int spaces = number / 2; int stars = 1; int row; int …

Member Avatar for rapture
0
99
Member Avatar for zatin

Hello!!! For my assignment I have to develop small library system. I'm doing ok, I'have developped borrower and book classes and they work just fine... I was wondering if anyone could just suggest how to implement copies for the book. (Sometimes the most popular books will have more copies)I'm not …

Member Avatar for Ezzaral
0
67
Member Avatar for celebritybree

I need a code that when I'm given two number, the computeer gives me back 4 integers ex) user gives me: "3 & 6" The computer displays back: "3,4,5,6"

Member Avatar for celebritybree
0
94
Member Avatar for JoeK

Can someone point me in the right directions. I have to build on an existing mortgage program. I have to pull interest rates in from an external txt file and have them populate my array. The array will then be used in a combobox pull down. I don't know which …

Member Avatar for JoeK
0
145
Member Avatar for jsand2

Hello everybody! I am new to the site and to java. I am in week 2 of my java class now and still not sure if I am enjoying it. Unfortunately I would say it is my weakest link in the IT field so I picked this class on my …

Member Avatar for jsand2
0
66
Member Avatar for radhasb

I have 2 .java files called model.java and table.java I have 3 class files, model.class, table.class and WindowCloser.class (which is in the table.java file). I've looked online on how to make a jar file, but whenever I try, either nothing happens or it says Main-class not found. table has the …

Member Avatar for stephen84s
0
102
Member Avatar for caps_lock

With the code below I am getting an error reading long cannot be dereferenced, how can I solve this problem? [code] import java.io.File; public class TestingClass { public static void main( String [] args ) { File actual = new File("."); for( File f : actual.listFiles()) for( File e : …

Member Avatar for ~s.o.s~
0
361
Member Avatar for l_03

[ICODE] import java.io.BufferedReader; import java.io.FileReader; import TokenizerProcess.StringTokenizer; import javax.swing.JOptionPane; public class ReadFile { public static int count = 0; public static String[][]file = new String[6][3]; public void isReadFile(){ SubjectInput input = new SubjectInput(); try{ BufferedReader reader = new BufferedReader (new FileReader("SubjectFiles/subjects.txt")); String line; while((line = reader.readLine())!=null){ StringTokenizer tokenFile = new …

Member Avatar for ~s.o.s~
0
145
Member Avatar for radhasb

I am writing a program in which I have done ALOT of coding already but there are still problems and features to be added. So far my program: 1) Takes data from a .dat file and displays it on a table 2) There is a button for which you can …

Member Avatar for quuba
0
340
Member Avatar for dalbirsingh

Can u people help me in getting java code to transfer files (FTP) over the LAN.Give me the complete code for this. I wan that a FTP request to be send to the desired host and if the host accept the request then the browse menu be opened that allows …

Member Avatar for ~s.o.s~
0
168
Member Avatar for srinukatkam

I am using asp.net 3.5(visual studio 2008) and sql server 2005/2000. I want code for validation of Account number and password. i.e. when user enter the Accountno and password and click submit button it should check the data with that enter in database. If it is correct it should go …

Member Avatar for Ramy Mahrous
0
82

The End.