32,204 Topics

Member Avatar for
Member Avatar for Dannyo329

Hi, whilst reading a book on Java, I came across a bit where the author used [CODE] GregorianCalendar now = new GregorainCalendar(); [/CODE] And I was just wondering, is that any different from [CODE] Calendar now = Calendar.getInstance(); [/CODE] And if so, why did he use GregorianCalendar instead of the …

Member Avatar for Dannyo329
0
91
Member Avatar for EddieC

With the release last week of [Groovy 1.7](http://groovy.codehaus.org/), developers using the object-oriented scripting language for Java gained access to anonymous inner classes and nested classes, annotations, SQL and other features that could simplify development when mixing Groovy code with Java. Groovy's [Eclipse community](http://groovy.codehaus.org/Eclipse+Plugin) yesterday released Groovy-Eclipse 2.0.0, a nearly rewritten …

0
195
Member Avatar for nader_shadi2010

Hi could any body help me out fixing this code . Because when I compile it I got an error, I've tried to solve it, but unfortunately I could't . Here is the java code : import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.io.*; class MyPad extends JFrame implements ActionListener, …

Member Avatar for masijade
0
318
Member Avatar for Moonrise_state

Hi again, I have a class that is supposed to match different people of different genders together under different rules. For example, they are supposed to live in the same postal district. The problem is Java seems to be mismatching people, and I think its because it isn't comparing the …

Member Avatar for Moonrise_state
0
115
Member Avatar for hellonikki

Hi, At the moment my program holds a list video titles in a doubly linked list. When the user wants to save the list to file it is converted to an array then saved onto file. But the problem starts when i want to delete from the list. Say for …

Member Avatar for hellonikki
0
133
Member Avatar for denniskhor

[CODE] FileReader readKGN = new FileReader("KGNLibrary.txt"); int KGNLib = readKGN.read(); readKGN.close();[/CODE] i dunwan read it as int.. because i wan use it on IF, so i need it to compare wat i input string item into text area with text file inside string item. [CODE] if (POS[i].equals(KGNLib)) { jTextArea2.append((POS[i] + …

Member Avatar for rrusin
0
97
Member Avatar for StarZ

hi.. so basically my program works like this.....first frame > buttons > another frame > more buttons > lead to another frame ... but a few problems are preventing me from doing this. p.s. I don't want to use the cardlayout because I want my buttons like a column, and …

Member Avatar for musthafa.aj
0
102
Member Avatar for ryy705

Hello, I get a out of memory error on line 4: [CODE]int isDeleted = 0; PreparedStatement psDeleteRecord=null; try { psDeleteRecord=con.prepareStatement(delQuery); isDeleted = psDeleteRecord.executeUpdate(); if(isDeleted !=1){ echoLog("Could not Delete: " + delQuery); } else { numDel++; } } catch (SQLException s) { echoLog("Failed: " + delQuery); s.printStackTrace(); }[/CODE] This block of …

Member Avatar for javaAddict
0
140
Member Avatar for anjalhere

hello everyone, Output is coming not equal for same input.what is the error in this program? import java.util.*; class newobj_equal { public static void main(String[] args) { int eid; String ename; double salary; Scanner sin=new Scanner(System.in); System.out.println("Enter eid");z eid=sin.nextInt(); System.out.println("Enter ename"); ename=sin.next(); System.out.println("Enter salary"); salary=sin.nextDouble(); emp e1=new emp(); e1.accept(eid,ename,salary); e1.display(); …

Member Avatar for musthafa.aj
0
147
Member Avatar for jemz

hello can you please help me on how to make the loading bar in java can you make this code..i have a program and i want to put a loading bar ..thanks in advance hoping for your positive responds.

Member Avatar for jemz
0
102
Member Avatar for adams161

i've written a game board currently but its minimal. i draw the board and then i've added two labels that i've postiioned off to the right side with setlocation. I dont know that set location will work as i add more controls so i'm looking for a better way. currently …

Member Avatar for adams161
0
119
Member Avatar for jogendar

i have created executable jar file for my program pedit.java as follows jar cvfm pedit.jar manifest.txt images *.class splash.gif where images is a directory where the icons for toolbar are there,as my program is a editor... my problem is that when i run the jar file the application is loaded …

Member Avatar for masijade
0
136
Member Avatar for sifounas

Hi to everyone, i am wondering which language (java or c#) can create more robust and scalable application including stuffs such as multiprocessing, multithreading, and of course speed???? Thanks, in advance!!!

Member Avatar for Salem
0
151
Member Avatar for jogendar

[code] String filename = jfr.getTitle(); File fname = new File(filename); System.out.println(filename); if(filename.equals("untitled")) { System.out.println(filename); return; } else { System.out.println(filename+"+"); } [/code] when i run the above code though the filename is "untitled",the statements under both if and else are been executed... is there any wrong in it??

Member Avatar for ahmed hashmi
0
80
Member Avatar for jogendar

i am creating a text editor,i am using textpane in that,how to enable discontinous text selection in the textpane??

0
53
Member Avatar for StarZ

sooo i finally got the new "pop up" frame after a button is clicked. so than after the user clicks the button and new frame pops up i try to add some stuff and buttons to that new frame.. but it doesn't show. it's just a black frame. I don't …

Member Avatar for StarZ
0
3K
Member Avatar for ttnfrm

Hello everybody, I'm looking for a ready code in Java for JADE implementation of Bellman-Ford algorithm. I really need in developing Agent for the research. I am not an expert in programming. For anyone who has been developed or seen the Bellman-Ford algorithm source code in Java, I would be …

Member Avatar for Nick Evan
0
156
Member Avatar for P00dle

I'm reading a whole xml file in as a string. Some of the Node values are directories, e.g. "C:\" When I print out the string, to make sure that the file has been read in correctly, I see that it has completely ignored the Nodes that have directories in them. …

Member Avatar for P00dle
0
85
Member Avatar for heroes8453

this is my code. I have no clue what could be wrong with it. The error that keeps coming up is: class, interface, or enum expected. The five errors it pointed out are the 'v' in public void actionPerformed at the bottom of the code, the 'g' in the green …

Member Avatar for gunjannigam
0
91
Member Avatar for Waddiwassi

Hi, I'm in my second year of computer science and we're currently learning about design patterns. As part of this we have been given an assignment to include the Abstract Factory design. I'm having trouble understanding exactly how it fits together so I was wondering if someone could explain, in …

Member Avatar for Waddiwassi
0
169
Member Avatar for Dearster

Is there a function with the scanner class to allow for the user's input to just go on one line instead of two. I am using Scanner scan = new Scanner (System.in) with scan.nextInt and it is coming up with 10 4 and I want it to appear on one …

Member Avatar for fardoonmuhafiz
0
81
Member Avatar for Aamit

Hi..I am trying to connect oracle which is on my pc.i am using oracle 9i. i am creating 1 customer table & trying to display it. [code] import java.sql.*; import java.net.*; public class JdbcDemo{ public static void main(String args[]){ Driver d; Connection con; Statement stmt ; ResultSet rs; try{ d=(Driver)Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance(); …

Member Avatar for fardoonmuhaifz
0
342
Member Avatar for sifounas

Hi, i am a php programmer who has no previous programming experience neither in java nor in c#(sharp). My goal is to learn both languages java and c#, so i am looking for an experienced programmer who has in depth knowledge of both languages to suggest me which one to …

Member Avatar for JamesCherrill
0
128
Member Avatar for valatharv

Hi, I am looking for best approach to query db table and get corresponding values on the basis of Ids passed. I have ids in String array, please provide best approach for point (a) and (b), what to use ArrayList, HashMap, etc... so that there are minimum loops... Sample code: …

Member Avatar for JamesCherrill
0
115
Member Avatar for junezy4

I need to make a password in php and javascript (with html) so that if the user wants the password to be 6 digits long, then the password is y0z0z2z4z6y2z0z2z4z6y4z0z2z4z6y6z0z2z4z6… If the password is 4 digits long, then the password is y0z0z2z4y2z0z2z4y4z0z2z4. THESE ARE NOT RANDOM NUMBERS. There is a …

Member Avatar for Rashakil Fol
0
118
Member Avatar for JBeginer7891
Member Avatar for javaAddict
0
150
Member Avatar for jogendar

i have been searching about how to create an executable jar file, [url]http://csdl.ics.hawaii.edu/~johnson/613f99/modules/04/jar-files.html[/url] by seing the above site i have created a jar file,while double clicking the jar file an error saying that "jar file couldnt be loaded check for possible console errors" is being displayed,i had tried by downloading …

0
75
Member Avatar for jogendar
Member Avatar for masijade
0
54
Member Avatar for c_Newbie

Hi everyone, I hope im posting in the right section. I'm desperate searching for an algorithm which tells me the similarity between two java codes. Some kind of anti-plagiarizer. The algorithm I found were mostly written in languages like C# .. I'm trying to write it in PHP, even though …

Member Avatar for pritaeas
0
116
Member Avatar for jogendar

i am creating a text editor using java swings concept this is the code i am using to save a file jfr.setTitle(fname.getName()); FileOutputStream fop=new FileOutputStream(fname); fop.write(jta.getText().getBytes()); fop.flush(); fop.close(); where fname is the name given in save file chooser bye the user jta is the text pane in which the text …

Member Avatar for JamesCherrill
0
102

The End.