398 Posted Topics

Member Avatar for goyal_2485

hmm i havent tried your code, but back when i was doing my own server client encryption, i realizd that if i never converted the data to base64 and sent it over the socket it would decode incorrectly, i think due to symbols etc.... so i first encrypted the data, …

Member Avatar for goyal_2485
0
605
Member Avatar for Kathy0410

you need to check your if statements i made some changes and left out others: if (playerRoll > computerRoll) { System.out.println("YOU WIN !"); } else if (computerRoll > playerRoll) { System.out.println("YOU LOSE"); } if ((computerRoll == playerRoll) || playerRoll > 7) { System.out.println("Winner"); } else if ((computerRoll == playerRoll) && …

Member Avatar for NormR1
0
662
Member Avatar for charmcity04

JTextArea has a setText() method and a getText() method use the getText() to get your previous written text and then use setText() to add the new text and the old text. NB this wont work textarea.setText(whatever+textarea.getText()); you will have to use a temp variable to hold the results of getText()

Member Avatar for NormR1
0
290
Member Avatar for devninja

hmm try using swing timers for that as you can run a scheduled timer to go off every 10 seonds. The reason your threads are giving you that output is because its what threads are used for. Hence it will work on one thread until that thread is paused or …

Member Avatar for NormR1
0
609
Member Avatar for FUTURECompEng

hmm yes if statements are normally evaluate to a boolean, every if statement will end up with either evaluating to true or false: if(1==1) { } else if(1==2) //will during runtime be evaluated as if(true) { } else if(false) { } however in your example you are not evaluating wether …

Member Avatar for FUTURECompEng
0
271
Member Avatar for HungMob

perhaps you are using the wrong name? because i cant find a class called ButtonListener?

Member Avatar for DavidKroukamp
0
190
Member Avatar for Mopikope

I think the problem is because you havent closed your last stream of the file so the new panel cannot read the file as its in use by the other try:: try { file = new File(fileName); br = new BufferedReader(new FileReader(file)); while ((line = br.readLine()) != null) { if(line.startsWith(edit)) …

Member Avatar for Mopikope
0
155
Member Avatar for sonicx2218

see; http://www.java-tips.org/java-se-tips/java.util/how-do-i-generate-a-random-number-between-0-and-some-inte.html and http://docs.oracle.com/javase/1.4.2/docs/api/java/util/Random.html

Member Avatar for sonicx2218
0
2K
Member Avatar for tjcrandall

what exactly is the problem/ what are you trying to do? Do you have any errors when compiling or running? [edit] actually got the problem fixed add: @Override public void paint(Graphics g) { super.paint(g); //other code } as your first line in your paint(Graphics g) {} method

Member Avatar for NormR1
0
1K
Member Avatar for Thermalnuke
Member Avatar for speakon

good link too http://www.roseindia.net/java/javascript-array/modified-java-method-overriding.shtml and http://docs.oracle.com/javase/tutorial/java/IandI/override.html

Member Avatar for JamesCherrill
0
291
Member Avatar for Gsterminator

uhm you use count(n) however i see no method for this where is the method? because if you are incrementing a simple int you would use variable++? where is count defined? it cannot be defined within the method that is recursively called thats the key. So either make it global …

Member Avatar for Gsterminator
0
238
Member Avatar for Kert
Member Avatar for peter_budo
0
129
Member Avatar for Samama

public static void main(String[] args) { File[] files=new File("C:\\test\\").listFiles(); for(File file:files) { System.out.println(file.getPath()); readFile(file); } } private static void readFile(File file) { //method of reading file here } Perhaps that will help, just give it a name of the directory with files and see the output

Member Avatar for DavidKroukamp
0
97
Member Avatar for polarbear125

adding this to your main method should do the trick: Die die = new Die();//create new instance of Die die.roll();//calls instance method roll() in Die to give value a number System.out.println(die.getNumDots());//print out the instance value of die

Member Avatar for DavidKroukamp
0
237
Member Avatar for Sarama2030

> I would like to develop an installer for all platforms(including windows,linux and Mac). well for the first problem: http://installbuilder.bitrock.com/ and this might help: http://www.advancedinstaller.com/java.html for your next problem take a look here for > how to connect to a mysql database in java : http://www.java-samples.com/showtutorial.php?tutorialid=9 and here: http://www.roseindia.net/jdbc/jdbc-mysql/MysqlConnect.shtml hope …

Member Avatar for DavidKroukamp
0
238
Member Avatar for ForceStr

hmmm Can you post the code pertaining to the problem, use: try { //... } catch(Exception ex) { ex.printStackTrace() } in your exceptions and also copy the full error message here. This will help to locate the exact code that is generating the exception so you can post it here. …

Member Avatar for DavidKroukamp
0
115
Member Avatar for c.pentasuglia

what IDE are you using? because if eclispse may this http://stackoverflow.com/questions/2728283/how-can-i-create-a-self-consistent-jar-file-with-eclipse or for Netbeans this: http://www.java-forums.org/netbeans/12582-netbeans-creating-jar-including-jar-libraries.html and perhaphs this too for Netbeans 6.x: http://www.lampos.net/netbeans

Member Avatar for DavidKroukamp
0
242
Member Avatar for resiak

hmm check this link: http://www.daniweb.com/software-development/java/code/408638/read-edit-and-write-to-file

Member Avatar for DavidKroukamp
0
227
Member Avatar for rdhiravani

heres a good link: http://stackoverflow.com/questions/1605332/java-nio-filechannel-versus-fileoutputstream-performance-usefulness

Member Avatar for JamesCherrill
0
174
Member Avatar for javaprog200

check this out: http://forums.codeguru.com/showthread.php?t=348317 and http://www.coderanch.com/t/446406/GUI/java/JTextArea-image but as NormR1 suggested rather try this: http://docs.oracle.com/javase/tutorial/uiswing/components/editorpane.html

Member Avatar for DavidKroukamp
0
5K
Member Avatar for sdr001

what is the error you have or the output you are receiveing thats wrong/not what you excpect?

Member Avatar for NormR1
0
227
Member Avatar for DavidKroukamp

Hmm i really like what applications like Windows Media Player and VLC player can do, and by this i mean: you know when you are watching a movie or listening to music and you minimize the window? Well if you hover the taskbar icon of the minized window with your …

0
191
Member Avatar for DavidKroukamp

Hey all, I must say its taken me a while to get hang of the new sites layout and all but im finally getting there. one thing i cant seem to get is the 'up voting' system.... in the old site you were able to either up vote a post …

Member Avatar for Dani
0
320
Member Avatar for apanimesh061

check here: http://www.daniweb.com/software-development/java/threads/658/javas-string-tokenizer and this : http://www.coderanch.com/t/397858/java/java/StringTokenizer-remove-consecutive-words

Member Avatar for NormR1
0
158
Member Avatar for jackbauer24

You know when i sit and ponder what projects to make i rarely look online, because any project given by another member might not have your sons interests at heart which for me doesnt make it a 'fun' project. Think of what your son might like to make... maybe a …

Member Avatar for DavidKroukamp
0
139
Member Avatar for jarograv

hmm looks like you havent initialized your 2D classList array: classList = new String[100][100];

Member Avatar for BumHunter
0
122
Member Avatar for <HHH>

the simplest way to read from a file is: Scanner sc=new Scanner(System.in); System.out.println("Please enter your files name and path i.e C:\\test.txt: ");//prompt for file name filename = sc.nextLine();//read in the file name Scanner fileToRead = null; try { fileToRead = new Scanner(new File(filename)); //point the scanner method to a file …

Member Avatar for joankim
0
351
Member Avatar for Panathinaikos22

heres 2 good links: http://stackoverflow.com/questions/161942/how-slow-are-net-exceptions and http://stackoverflow.com/questions/615955/under-c-sharp-how-much-of-a-performance-hit-is-a-try-throw-and-catch-block

Member Avatar for sknake
0
6K
Member Avatar for sadzee

hmmm to be honest i havent heard of that and had a look on google and nothing popped up. but from what i can gather i think locally caught exceptions are those that are caught within the class itsself, and global would be when the class or object is throwing …

Member Avatar for nbajordan
0
89
Member Avatar for Thermalnuke

well you are trying to print out the object you initiated, first you must call the constructor like you have, then call: cTotal.setArea(); System.out.println(cTotal.getArea()); I also think your setArea is wrong, it should set the variable for the instance which you called 'area' to the new area not the variable …

Member Avatar for Thermalnuke
0
137
Member Avatar for joankim

> while(x > total){ //Will run until total == x || total < x. hmm i havent checked through all your code but i see this mistake is repeated: ` while(x > total){ //Will run until total == x || total < x.` can you see the mistake? you say …

Member Avatar for joankim
0
248
Member Avatar for Stjerne

here is 2 good links i found: http://docs.oracle.com/javase/tutorial/uiswing/layout/ and http://java.sun.com/developer/onlineTraining/GUI/AWTLayoutMgr/shortcourse.html I'm sure you know that a layout manger helps structire your components sizes and places them on certain places in the container etc, hwoever you may have to use more then 1 layout manger depending on how you want each …

Member Avatar for Stjerne
0
171
Member Avatar for c.pentasuglia

What NormR1 said is the perfect solution to what you said. you could also write the information to a text file for the user to view? Even both :) heres some exampke on adding listners to frames: http://docs.oracle.com/javase/tutorial/uiswing/events/windowlistener.html and http://www.java-tips.org/java-se-tips/java.awt.event/how-to-add-window-listener-to-the-window-in.html

Member Avatar for c.pentasuglia
0
245
Member Avatar for ladybro

because b[][] isnt defined within the scope of the getAlive() method..... import java.util.*; import java.io.*; public class life{ char[][] b; public static void main(String[] args) throws IOException { java.io.File file = new java.io.File("desktop/input.txt"); Scanner input = new Scanner(file); try { int rows= input.nextInt(); int columns = input.nextInt(); b = new …

Member Avatar for JamesCherrill
0
177
Member Avatar for kh.taimoor

you have too many or too little '}' & '{' but i fixed it quickly using my IDE, and the way you called the JOptionPane methods was wrong: /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package studentbook; import …

Member Avatar for DavidKroukamp
0
198
Member Avatar for polarbear125

> System.out.println(result); well i cant see where you defined the variable result, so i take it your trying to call the method findBestFit(int size1,int size2int folder) and get the returned value well to do that you create a variable and assign it with the call to the method findBestFit() like …

Member Avatar for DavidKroukamp
0
204
Member Avatar for andy8521

hmm check this has a great number of free online ones too and also paid for books : http://www.squidoo.com/javaresources

Member Avatar for Krokcy
0
270
Member Avatar for joankim

> so why not write your own pow class that accepts two floats and returns a float? public float pow(float f1, float f2) { float answer = 0; //calculate f1 to the power of f2 and store in answer return answer; }

Member Avatar for NormR1
0
2K
Member Avatar for sara_magdy

check this here: http://stackoverflow.com/questions/1006921/how-do-i-get-a-an-image-to-display-in-jtable-in-java-swing and perhaps this too: http://www.coderanch.com/t/342187/GUI/java/Images-JTable

Member Avatar for DavidKroukamp
0
133
Member Avatar for maverick420

maybe check this out, http://docs.oracle.com/javase/tutorial/java/IandI/polymorphism.html. Im not sure though what you mean, i dont see any form of polymorphism in the above code? maybe post the rest of your code too?

Member Avatar for maverick420
0
210
Member Avatar for thesmile

Hmm well here's a good tutorial: http://www.dreamincode.net/forums/topic/66176-creating-a-basic-notepad-application/.

Member Avatar for DavidKroukamp
-1
103
Member Avatar for JerBear24

Hmm just to add here is a good tutorials on writing your own exceptions if you so wish:[Writing Your Own Exceptions](http://www.osix.net/modules/article/?id=766)

Member Avatar for DavidKroukamp
0
383
Member Avatar for memz

Hmmm...infection of exe's is way more complex then simply attaching a batch script to an exe... unless you delete the exe and give the batch the same name but thats just a simple overwriting virus. I wouldnt be mixing languages as you are because it doesnt really help, just use …

Member Avatar for memz
-1
308
Member Avatar for Tuz

> package pckage1; > class BaseClass { > public int x = 10; > private int y = 10; > protected int z = 10; > int a = 10; //Implicit Default Access Modifier > public int getX() { > return x; > } > public void setX(int x) { …

Member Avatar for NormR1
0
92
Member Avatar for rob211

Hmm im not quiet sure if this is what you mean take a look... [Combination Generator](http://www.merriampark.com/comb.htm)

Member Avatar for stultuske
0
130
Member Avatar for justindill

> package now; > import java.awt.FlowLayout; > import java.awt.event.ActionEvent; > import java.awt.event.ActionListener; > import javax.swing.*; > public class Now extends JFrame { > JLabel FirstName; > JTextField jtfFirstName; > JLabel LastName; > JTextField jtfLastName; > JLabel Age; > JTextField jtfAge; > public Now(){ > //Set FlowLayout > setLayout(new FlowLayout(FlowLayout.LEFT, 10, …

Member Avatar for justindill
0
3K
Member Avatar for Mr.BunyRabit

[QUOTE=Mr.BunyRabit;1728979]I have a java program whith a mysql database. the user loggs in in the breginning of the system with a username and password. there are some functions that the normal users may not see/use. How do i know who is logged on to my system, since they only type …

Member Avatar for gourav1
0
284
Member Avatar for Mr.BunyRabit

[QUOTE=Mr.BunyRabit;1733498]Hey there I started coding again on my old project in netbeans but i have no idea what kind of a prject it is, for example, is it javaEE or whatever. like in the image attached. How can i find out what my current project type is? Thanx[/QUOTE] I'd recommend …

Member Avatar for Mr.BunyRabit
0
110
Member Avatar for Mr.BunyRabit

[QUOTE=Mr.BunyRabit;1733367]but it thats the case, why? I simply draged that button in Just as i did with all the others. i even deleted them, and draged new buttons in. same story. I dont understand whyyyy that happens[/QUOTE] It may occur because netbeans attempted to resize your button but it did …

Member Avatar for Mr.BunyRabit
0
102

The End.