Posts
 
Reputation
Joined
Last Seen
Ranked #3K
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
100% Quality Score
Upvotes Received
11
Posts with Upvotes
10
Upvoting Members
7
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
2 Commented Posts
~20.2K People Reached
About Me

I'm a university physics student with a passion for creating video games, currently in Java.

Interests
Guitar, piano, drawing, writing, basketball, physics
PC Specs
HP pavilion dv7 for university Home built desktop at home Currently dual-booting Windows 7 and Ubuntu…

52 Posted Topics

Member Avatar for jhamill

If you just want a boolean to see if it had any capitals, you can use this: [CODE]String test1 = "Hello"// your string; String test2 = test1.toLowerCase(); boolean hasCapital = !test1.equals(test2);[/CODE]

Member Avatar for stultuske
0
3K
Member Avatar for Dani

Going on what mike said, to make it official, I wrote a snippet in Java for dynamic class loading from XML files, to be found here: [Click Here](http://www.daniweb.com/software-development/java/code/425300/dynamic-class-loading-from-xml) Curious what you think of it :)

Member Avatar for L7Sqr
3
1K
Member Avatar for Aviras

Hello everyone, this is something I wrote a couple months back. It is used as a universal class/object loader from an XML file. For the handling of XML I use the JDOM library. The story basically goes like this: I have a load of classes in a game I'm working …

Member Avatar for Troy III
1
396
Member Avatar for km2011

What you can do for instance is put all your coefficients (aka a0,a1, etc) in an array, then make a for loop through that array. Just keep a value say x, and every time you enter the for loop, add x+ai*x EDIT: Didn't read your third line for the summation …

Member Avatar for km2011
0
193
Member Avatar for LondonJava

Every time the user changes something, overwrite the config.properties file, and just always try to load the file when your app starts? There might be more to it I don't know about.

Member Avatar for LondonJava
0
223
Member Avatar for raul8

You can split your string so that you get all the different lines in an array, like this: [CODE]String[] lines = yourString.split(System.getProperty("line.separator"));[/CODE] Then you just select the ones you want. :)

Member Avatar for Aviras
0
69
Member Avatar for BlackStar0703

I assume you're talking about some sort of chat program? You will find many examples on the internet. The things you need to learn are network programming, ie Socket and ServerSocket classes, and multi-threading. Depending on how complex you want to make it, just using google can already help you …

Member Avatar for BlackStar0703
0
319
Member Avatar for Narayanan87

You do this using the java.util.regex package. Tutorial here: [url]http://docs.oracle.com/javase/tutorial/essential/regex/[/url] Should you encounter problems, feel free to ask :)

Member Avatar for Aviras
0
86
Member Avatar for sudarshansirsat

What this means is that your JasperFillManager is null, or perhaps something in the method fillReport. Try to put some printlns on different spots, or just use the debugging tool to check what your variables are, and go back like that.

Member Avatar for sudarshansirsat
0
375
Member Avatar for kmbl84

First: the init() method is the equivalent of a constructor for an applet, as such it gets called first. Since you don't initialize your numbers before using them in the labels, Java takes them as 0 and displays it that way. Second: the problem lies in your actionPerformed method. The …

Member Avatar for NormR1
0
336
Member Avatar for begueradj

Methods can only be called from within other methods, not in the class declaration like you did. Every method is called from within another method, starting with the main(String[] args) method. Also, I noticed you putting n=nombreDeLignesDeMonFichier, while it should actually be the other way around. You haven't initialised nombreDeLignesDeMonFichier, …

Member Avatar for JamesCherrill
0
322
Member Avatar for dennysimon

Do you mean something like microsoft Paint? In that case it's pretty easy to find some examples. If it isn't, you're going to have to be a bit more specific.

Member Avatar for dennysimon
0
127
Member Avatar for vaironl
Member Avatar for sandman64

1) Where exactly lies your problem? 2) Why do write to the file again at line 58 when textfield1.getText() is unchanged? 3) The assignment is to display the string you got from reading the file, i.e. tempString, why print temp. On the outside it'll of course look the same, given …

Member Avatar for Aviras
0
2K
Member Avatar for vaironl

If the things you want are always on the third line, you can just let the scanner read the first two lines without saving it in a String, then just put the third line in a string, and there you have it? Then you just split the string using your …

Member Avatar for Aviras
0
164
Member Avatar for ynwa

A simple requestFocus would probably do the trick, but there might be a more elegant solution. But for that I'd have to actually see some of your code.

Member Avatar for Aviras
0
435
Member Avatar for innspiron

Look up JDom, it's a java developed XML parser and writer API. Depending on what API you use, an 'XML object' are different things. In JDOM it would be an Element object, In SAX I don't believe you can manipulate objects like that since it's a read only API. An …

Member Avatar for Aviras
0
775
Member Avatar for kumaresen

You can just put a [CODE]while(true)[/CODE] loop around your try-catch structure. That way it will keep running forever. It you want it to run say 5 times, you just replace the while(true) loop with a for loop. As a suggestion, doing System.exit(0); if the user types something that can't be …

Member Avatar for Aviras
0
141
Member Avatar for softDeveloper

Have you tried it already and it didn't work? In case it shouldn't work, writing the text to a temporary file and loading from that file isn't an option? Why do you absolutely want to give a full text as a parameter?

Member Avatar for softDeveloper
0
152
Member Avatar for Chuckleluck

win32 is sort of the basis, the lower level end of c++. In my opinion it's about as fun to program as vomiting after a rollercoaster, you hope it was worth it. However it gives you a lot of freedom, but if you want I'm sure there are some libraries …

Member Avatar for mrnutty
0
501
Member Avatar for sike.mausa

As OP said, you can just make a new File with the constructor public File(String filename). Besides that, a file can generally read in 2 ways, using a scanner, or by using a bufferedreader. Both have their uses, though generally it doesn't matter. I suggest you look up both classes, …

Member Avatar for Aviras
0
181
Member Avatar for hatebin
Member Avatar for SnarkysXe

All import statements must be done before defining any classes. Your standard structure should be like [CODE] package something; import something; ... Class definitions[/CODE]

Member Avatar for NormR1
0
251
Member Avatar for Ruben1123

Put brackets around your second if statement, it's good programming practice to use brackets, even for one line expressions, should you want to add more later. It should fix your problem I believe.

Member Avatar for Aviras
0
164
Member Avatar for Aviras

Hello everyone, I'm a java programmer writing a half graphical half text rpg. For the moment I read my data from text files, e.g. Enemies.txt id name hp and so forth. However, I want to make it a little more clear to handle, as in a database format. I can …

Member Avatar for Aviras
0
148
Member Avatar for dandeliondream

As far as I'm aware it's not possible to 'show a website' in a java program. It is however possible to write a html doc with 3 iframes, modify that doc through java, and open it using the default browser though the function Desktop.open().

Member Avatar for Anyday
0
138
Member Avatar for Dwillich87

Besides what JamesCherrill said, you'll probably have to put parenthesis after "in.nextFloat".

Member Avatar for Akill10
0
138
Member Avatar for xanawa

It isn't possible in Java. A workaround would be to create 20 or so white lines, or how many you see fit.

Member Avatar for Taywin
0
146
Member Avatar for Aviras

Dear Daniwebbers, I have a problem regarding the calling of methods on a protected parent object from within a child object, the protected parent object being a child object of the same class. I have a class HostileArea, wich has a "protected DungeonRoom[][] dungeon", DungeonRoom being a child of HostileArea. …

Member Avatar for JamesCherrill
0
222
Member Avatar for nyemba

Could you give us your main method, or how those 2 methods you posted are used together ? I don't see what a method with integer arrays have anything to do with your problem, unless they're the letter number of in the alphabet of each letter.

Member Avatar for Taywin
0
376
Member Avatar for cherrymae.calma

I'm not entirely sure what you mean.. Java IO takes care of reading and writing to files and such. I suggest looking up the BufferedWriter class for writing and BufferedReader for reading.

Member Avatar for stevanity
0
160
Member Avatar for plasticfood

Also, unless you absolutely need AWT, use Swing, among other things it has built in double buffering.

Member Avatar for NormR1
0
303
Member Avatar for kalz

In case you solved the problem yourself, it would be good to list what you did to solve it, so others browsing this thread can profit from your solution. :)

Member Avatar for Aviras
0
147
Member Avatar for dwayned

Search for a command line option to unzip with the program you're using, then execute it in the same way you did to start the program.

Member Avatar for dwayned
0
1K
Member Avatar for Nathan_11

[url]http://download.oracle.com/javase/tutorial/java/nutsandbolts/for.html[/url] They explain it well. For basic programming questions like these it's best to just google it.

Member Avatar for JeffGrigg
0
127
Member Avatar for jinglylime

First, i suppose you're making a text-based game, running in a console window ? Second, in order to print your cards, you need to define what to print. Your computer doesn't know it needs to draw card shapes just because you named your class 'Card'. The toString() method does what …

Member Avatar for JamesCherrill
0
114
Member Avatar for sathya88

The choice of Applet vs Frame is one of where you are going to use it. Applets are basicly used in a webpage, implemented on the page by html. Frames are stand-alone applications. To 'go from one page to the other', I suggest working with different JPanels, and switching the …

Member Avatar for Aviras
0
81
Member Avatar for karyal

Please explain further what you want to achieve. From the title I take it you made a GUI Swing application and you want it to print reports? Also, you ask us how reports are made? First, this isn't a java question, rather an academical, and as such you would find …

Member Avatar for Aviras
0
117
Member Avatar for hardik.rajani

Perhaps Remote Method Invocation (RMI) is something you should check out if connection itself is troubling you. Basicly it's a little higher-level programming than the regular serverSocket/socket programming, taking care of http tunneling itself. [url]http://download.oracle.com/javase/tutorial/rmi/index.html[/url] Would be a good start. Good luck, I'd like to hear your progress :)

Member Avatar for Aviras
0
2K
Member Avatar for mason79

I have quite some MATLAB experience, but you'll have to post specific questions as to where you are stuck, since no one will hold your hand and fix it for you, rather point you in the right direction.

Member Avatar for Aviras
1
69
Member Avatar for Aviras

Hello everyone. I've been programming on a co-op RPG for quite some time now, but my networking side has seen some troubles. I'm using the lower level serverSocket-Socket way. Everything runs flawless within my own network, however connection over the internet is where the trouble is. I understand this is …

Member Avatar for Aviras
0
286
Member Avatar for ayas
Member Avatar for gman1991

In addition to what Jaydenn said, it is advisable to close the streams in the 'finally' section. That way, in case an error is thrown, the stream will still close. As it is now, you'll have bad stream control. So: [CODE] BufferedReader reader = null; try { reader = new …

Member Avatar for Aviras
0
226
Member Avatar for betny

First, when you do "if(readArray[i] =="Exit" ) break;", you don't actually check the value of the string, rather the position in the memory. To check the actual value, use readArray[i].equals("Exit"). Second, you need to place your if statement after your input. As it is now, at your if statement, readArray[i] …

Member Avatar for hfx642
1
230
Member Avatar for buba_kazouba

What exactly does your IDs() method do, e.g. why does it return an unused vector, and you don't even use the returned Vector in your constructor ?

Member Avatar for buba_kazouba
0
218
Member Avatar for beginnerJavaer

The problem you are getting is one of appending to the file instead of replacing. The way you have coded it right now, the writer replaces the file with the last incoming sentence, instead of appending to the file. The trick is that there are 2 constructors for the FileWriter …

Member Avatar for Aviras
0
256
Member Avatar for Clawsy

First: picking up an almost 2 year old thread :sigh: Second: look up RMI (Remote Method Invocation) [url]http://download.oracle.com/javase/tutorial/rmi/index.html[/url]

Member Avatar for Aviras
0
336
Member Avatar for nyaxinya

Make a sort of family tree. Just do it on paper. Basicly just do what the assignment says, just don't start coding right away if you haven't fully figured out what you want to do. It saves a lot of time recoding and bug squashing.

Member Avatar for Aviras
0
134
Member Avatar for stokotten

Methods need to be called from within other methods, which are called from within other methods, etc, going back until your 'public void main(String[] args)' method. Outside the method structures in your class you can only create variables.

Member Avatar for Aviras
0
479
Member Avatar for Aviras

Hello everyone. I just started on 'converting' my multiplayer text RPG into a graphical form. What I am trying to do is this: Create a title window, basicly just a JPanel with one image filling the space. To this JPanel I add a MouseListener. When a user clicks the window …

Member Avatar for Aviras
0
423

The End.