32,204 Topics

Member Avatar for
Member Avatar for DavidKroukamp

For now the code isn't to complex. Built in Netbeans 7 java 6.... just the basis for now but its very safe connection so thought i'd post it for anyone who needs it. A quit command may be sent to any client by specifying its ID and then press enter …

0
431
Member Avatar for H_o_p.e

plz help me How to link Access data base with java code. [CODE] public class DataBaseCon { public static void main(String a[]) throws Exception{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:DataBase"); System.out.println("Sucessfully Connected "); Statement st= con.createStatement(); ResultSet rs= st.executeQuery("Select empid,ename from emp"); while(rs.next()){ System.out.print(rs.getString(1)); System.out.println(rs.getString(2)); } st.close(); con.close(); } } [/CODE] Exception in …

Member Avatar for DavidKroukamp
0
463
Member Avatar for crazymidget01

I am new to using swing. I am trying to get a picture to be displayed in a Jframe when a button is pressed. I cannot figure out how to make this work. This is what I have so far: [CODE] import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.awt.image.BufferedImage; import …

Member Avatar for mKorbel
0
1K
Member Avatar for libathos

I'm using a JFreeChart which I found in this link [ICODE]http://www.java2s.com/Code/Java/Chart/JFreeChartCategoryStepChartDemo.htm[/ICODE] I have modified the code as given below.My problem is how i can change the values in the x-axis so that they don't start from the zero. [CODE]public class Chart1 extends JPanel { /** * */ private static final …

Member Avatar for libathos
0
226
Member Avatar for Swirly

I am running into a problem in a card dealing program. When the Deck Constructor tries to run one of the methods associated with the Applet class, the program will fail with an error set typical to running an application as an applet. This is a school project, and the …

Member Avatar for NormR1
0
208
Member Avatar for bibiki

Hey there, I am building a small database app where I allow users to input and retrieve information in and out of database. As part of my application I have this table courses and a java file Course.java that models a Course object. My Course objects have field variables courseID, …

Member Avatar for JamesCherrill
0
113
Member Avatar for moonL!ght

i am reading from file the file is in this format 4 L 100 20 30 200 R 30 20 50 100 O 20 100 100 40 L 30 50 100 100 I'm using string tokenizer now the 4 specifies how many lines I'll have When I read only the …

Member Avatar for JamesCherrill
0
125
Member Avatar for libathos

hello,I am writing a program in java in which I use a jtable to print the data to the users.Do you know how can i get the data of a line when that line gains focus?

Member Avatar for libathos
0
85
Member Avatar for 03hasnam

[B]Hello Guys, Hope youre all well :) Please can someone kindly tell me how I can write to a specific line. The value to be written needs to be in long and not as a string. The File is as follows: 1324214082786 1313131 Paid 0.0 the seconds line is time …

Member Avatar for JamesCherrill
0
461
Member Avatar for 03hasnam

[CODE]/*********************Pay Button Listener***************************************/ public class payListener implements ActionListener{ public void actionPerformed(ActionEvent e) { String fileName2 = "Ticket/"+ticketIDNumber+".dat"; File ticket2 = new File(fileName2); if(ticket2.exists()){ try{ FileReader fileReader = new FileReader(fileName2); BufferedReader bufferedReader = new BufferedReader(fileReader); bufferedReader.readLine(); //OMIT Entrance Time FileWriter fw = new FileWriter(fileName2); BufferedWriter bufferedWriter = new BufferedWriter(fw); //fw.write("Hello"); bufferedReader.close(); …

Member Avatar for 03hasnam
0
174
Member Avatar for DoubleGee

Hello, I am experiencing problems when trying to remove elements from an array. I've been asked to create a little program which creates bank accounts containing (name, address, bank account number, balance etc.). I have successfully implemented all the functions except deleteAccount (I would also like to add that my …

Member Avatar for JamesCherrill
0
197
Member Avatar for apapap

This is the piece of code which i am running : [CODE] public static void main(String[] args) throws Exception { System.out.println("Registering Plugin..."); ServiceConnection connection = ServiceConnection.CreateServiceConnection( "ServiceInstance" ); connection.connect(Constants.VCENTER_URL,Constants.VCENTER_USERNAME,Constants.VCENTER_PASSWORD, true); VimPortType service = null; VimServiceLocator locator = new VimServiceLocator(); locator.setMaintainSession(true); if(connection != null){ System.out.println("Connected successfully to vCenter."); service = connection.getService(); …

Member Avatar for NormR1
0
455
Member Avatar for Steven7

Hey guys, I am new to Java and recently developed a small GUI-based project in Windows using Netbeans IDE. So I try build the project and retrieve the .jar file and it runs well on my Windows computer. Then I copy the .jar file to a Ubuntu Linux computer and …

Member Avatar for JamesCherrill
0
175
Member Avatar for ad_rulz

Dear All, I have a tar file which contains .Z files. File Structure is : x.tar -> [1.Z, 2.Z]. I need to read data from this zip files. So far I have reached a stage where I read entry from tar but am not able to unzip files within the …

Member Avatar for StephNicolaou
0
2K
Member Avatar for ali11

Note: C:\Users\Hamza\Desktop\Graph.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Tool completed successfully [CODE]import java.io.InputStream; import java.net.URL; import java.util.*; import java.awt.*; import java.applet.Applet; class Node { double x; double y; int lane; int road; double dx; double dy; String lbl; int carW; int carL; double carWaiting; …

Member Avatar for JamesCherrill
0
150
Member Avatar for Dean_Grobler

Hi there, Last night I switched to Ubuntu 10.04 (no, not 10.10, long story). And I wanted to get started programming as soon as possible, so I'm trying to find out how to install Eclipse Helios and the Java JDK 1.6 on my machine? Please note that [B]my machine is …

Member Avatar for newpaulman
0
349
Member Avatar for karthik.datt

hi, Can any one help me in parsing a file using java. for example in my text file i have data like line.long 0x0 "MIDR,Identity Code" so i need to read this from a file and print it as command=line type=long offset=0x0 description=MIDR,Identity code There are around 100's of lines …

Member Avatar for stultuske
0
111
Member Avatar for irock_4you

Vince Travis Sillhouette Angeles Create a myMath class that contains the ff procedures and or methods 1. Add any number of numbers 2. Multiply any number of numbers 3. Raise a number to the nth power 4. Slope of a line given 2 points 5. Factors of a whole number …

Member Avatar for v3ga
0
117
Member Avatar for gispe

Hi! Im doing a program in java that gets info from a database.. thing is that im seting a variable with data from one table, and one data is char and cant find the way to have the .getChar() like the rs.getString() the code is: [code=java] public ModosDeCompra_clase dameModoCompra(Integer id) …

Member Avatar for DavidKroukamp
0
3K
Member Avatar for DavidKroukamp

hi everyone, I am writing a small client and server application in java which uses SSL sockets and AES, i got this from the net and edited it a bit is this correct and secure? client: [code=java]/* * To change this template, choose Tools | Templates * and open the …

Member Avatar for DavidKroukamp
1
203
Member Avatar for Albion1

how can i drow a graphic in java like the figure in the link below [URL="http://www.daniweb.com/forums/attachment.php?attachmentid=23269&stc=1&d=1324131212"]http://www.daniweb.com/forums/attachment.php?attachmentid=23269&stc=1&d=1324131212[/URL]

Member Avatar for Albion1
0
110
Member Avatar for gourav1

[CODE]import java.io.*; class file3 { public static void main(String args[]) throws IOException { FileInputStream f1; int i; FileOutputStream f2; try { f1= new FileInputStream(args[0]); }catch(Exception e) { } try { f2= new FileOutputStream(args[1]); }catch(Exception e) { } try{ do { i=f1.read(); if(i!=-1) f2.write(i); }while(i!=-1); }catch(Exception e){}; do { i=f1.read(); System.out.print((char)i); …

Member Avatar for gourav1
0
146
Member Avatar for gourav1

[code]import java.io.*; class file2 { public static void main(String args[]) throws IOException { int b; b='A'; System.out.write(b); System.out.write('\n'); } }[/code] will anyone can tell that when i don't write System.out.write('\n'); then nothing comes in output. but after adding this statement 'A' got printed, why is it so ? secondly, i …

Member Avatar for JamesCherrill
0
96
Member Avatar for gourav1

once a thread enters any sychorinsed method on an instance , no other thread can enter any other synchronised method on the same instance ? what does this line mean ? also, how can one method be called by many threads at the same time on the same object ? …

Member Avatar for NormR1
0
159
Member Avatar for 03hasnam

[B]guys please help me with this. my problem is that on PaymentNewGUI class i am finding it hard to extract the entrance time from the file to be displayed on the gui if correct ticket number is added, reference to enterListener method in paymentnewGUI class thank you[/B] [CODE]import java.awt.*; import …

Member Avatar for 03hasnam
0
172
Member Avatar for creative_m

Hi I want to store variables in a text file (not as an object).my problem is that the class contains ArrayList of another type ,and I wrote one method to store the member variables of my class in "file.txt" ,but I don't really know how to write the ArrayList variable …

Member Avatar for creative_m
0
120
Member Avatar for pro_learner

Guys,i have developed a Java Application.I have already connected it with MySql DB & it's working properly.In DB there is a table calls Music and in that table contains a field calls Song _Path.It includes the path of the song in my computer.In java application there is a "Play" button.After …

Member Avatar for pro_learner
0
1K
Member Avatar for chinee

trying to connect a product class to the main class but i am getting errors i don't understand.like C:\Users\Juanelle\Documents\OOP Final Project\Order Process.java:36: cannot find symbol symbol constructor Product(java.lang.String,double) location: class Product Product product1 = new Product("Roses", 50.00); and in the error message the arrow is pointing at the n in …

Member Avatar for zeroliken
0
342
Member Avatar for abvd

Hi all I have an assigment but I'm stuck on the loop. I've checked other threads here but got a lot of complicated code that I haven't study yet (i.e.: "System . out .print" is still Screen . message("a") for me) So I have 6 lotto numbers 1,2,3,4,5 And I …

Member Avatar for abvd
0
973
Member Avatar for hszforu

HI!! I would like to know some of the alternatives for java swing. I have to create some kind of multithreaded bots for multiple account creations,Scraping etc. using proxies.Although i would like to ask is Java capable of handling this type of bots,because i have read over the internet that …

Member Avatar for hszforu
0
159

The End.