4,084 Posted Topics
Re: well, it might surely help to ask such a question in a forum that's about Corel Draw, instead of a Java development forum. | |
Re: No. first part, yes, you can create .exe files from java progs, but no, an exe can not be used everywhere you want. by creating an exe file, the program will no longer be cross-platform. you can, however, create .jar files that (basically) do the same as .exe files and … | |
Re: mjah, you really shouldn't. since you are creating a new Object of the type, you won't be working with the Object you've allready stored data in, but with a new one, that has only the data in it, which is specified in the constructor. since you didn't show the entire … | |
Re: are you sure you've actually stored data in the object before using the getter? | |
Re: there are several classes that can help you do this, for instance the 'Date' class (but I think the one I'm thinking of is for a large part deprecated) scrolling through the api's from sun 'll propably get you quite far allready, all you need to do is figure out … | |
Re: I'm quite sure 5 mins of google will solve this problem for you. | |
Re: or we could submit links to tutorials in the Java-tutorial section. | |
Re: getSelectedText(); setText(); should do the trick. just go through the api's | |
Re: nativeJ is an easy to use java-to-exe tool, but why would you want to make an exe of it,? if you're intending to let other people use your program as well, I'd suggest you stick with the jar file. | |
Re: since you are taking the subject, you'll propably have examples in your textbook or a course. try to understand what they do, create alternative sollutions, ... this is a better (and faster) way to learn java than asking someone you don't know and who'll propably use code you don't understand … | |
Re: just unzip the jar you want to use, place it in your .classes directory and make sure you have the right import statements. should work just fine | |
Re: first of all: in what kind of object would you like your String object to turn? since a String on itself is an object. in order to delete the first word: go check out the api's on the indexOf( ) method and the substring( ) method. this is about all … | |
Re: hmmm... jad decompiler doesn't work that well with the latest version of java, but there are still several other decent compilers out there who will do the job (if the source code isn't provided in the jar file, that is) | |
Re: well... when you create a web site in .jsp, you'll end up getting war files, so you might consider this java related. but maybe there is a more suitable forum in the web development forums for this? | |
Re: tried to just run the list trough a loop and add the value of every element to a seperate counter? | |
Re: well... your explanation was quite clear, but then again, so are the forum rules about making other peoples homework. the point of this forum is to ask for help when you're stuck, not to ask someone else to do your work completely for you. I have no doubt you will … | |
Re: good luck with that... once you've written some code, don't get the result you want and don't know where the problem lies, just submit your code and the error you get. but, like you said it: YOU want to make that function need some pointers? an easy way to do … | |
Re: if I understand you correctly, you're trying to 'fetch' data that's inside the GLUE/ADAM dir, while you're inside the GLUE dir? well... I kind of take it as you're trying to read data out of (for instance) GLUE/ADAM/data.txt what you need to do is to check wether this file exists. … | |
Re: it's quite normal that this code gives an error. you're calling the default constructor of BankImpl, but your BankImpl class doesn't have a default constructor. you should just use the constructor that does exist: [CODE] public BankImpl (int acctNo, String lname, String fname, double bal) { accountNumber = acctNo; lastName … | |
Re: just read the api's on Date or Calendar. Or look for "system date + java" in google, you should find all you need | |
Re: there are many places decent Calendars gan be downloaded. I recently stumbled upon [url]http://www.JideSoft.com[/url] they have a number of goodies that might come in handy, among which a Calendar | |
Re: [quote=4zlimit;381802]I am trying to store information then retrieve it on my program. I know I have to use a class and a constructor. The problem is that my text doesn't have any good examples that I can view. I am truly lost. I am not sure 1. where to build … | |
Re: you actually already have the loop defined, you just forgot to put the code you want to be running during this loop [CODE] while(nameOfEmployee != "stop"){ } [/CODE] between the brackets of this loop. if you want for every employee you enter to give the numbers and print the outcome, … | |
Re: you might want to take a look at the Math class. Ceil is one of it's functions, of that I'm sure. I'm quite sure it 'll also help you solving the rest of the puzzle. | |
Re: or, using Swing: [CODE] import javax.Swing.JOptionPane; public class ReadAName{ public static void main(String args[]){ String name = JOptionPane.showInputDialog(null, "Give a name."; System.out.println("Name : " + name); } } [/CODE] | |
Re: a String is one Object (of the type String). an array is a small collection of Objects. for instance: you know you need to keep seven String-Objects, containing the days of the week, in your program. String dayOne = "Monday"; String dayTwo = "Tuesday"; ... like here above, this are … | |
Re: you create a reference to a new object (nd). then you ask your computer to print this object, but since you don't specify what should be printed, it just prints the reference to this object. maybe you'll learn more if you try to change or add some methods and testing … | |
Re: a JPanel containing JLabels and JTextFields | |
Re: just search for information on the 'import' statement. that should quite answer your question. | |
Re: have you got any code (you have allready written) that we can check? I don't mind help correcting your code, but the idea is that you learn by doing. You won't learn much if someone else writes the code for you | |
Re: if I understand you correctly, which I hope I do, otherwise my answer won't mean that much to you :) you want a number of answers, determined by the case clauses, all in the same `MessageDialog`, like Answer one Answer two ... Last answer if this is the problem, the … | |
Re: just a little part I copied out of the java API's, should answer your question: public void setHorizontalAlignment(int alignment) Sets the horizontal alignment of the text. Valid keys are: * JTextField.LEFT * JTextField.CENTER * JTextField.RIGHT * JTextField.LEADING * JTextField.TRAILING invalidate and repaint are called when the alignment is set, and … | |
Re: using try and catch is an easy, but on the other hand definitive way to catch your error. your program will not crash, but if you make a wrong input, your program won't ask for any more. for instance: `int numbers[] = new int[5];` try{ for(int count = 0; count … | |
Re: [quote=realnsleo;357127]how do i do that???[/quote] try{ // code that you want to run } catch(NullPointerException nEx){ // what you want it to do or show when a nullpointerexception occurs } catch(Exception ex){ // what has to be done in case of another exception } a more simple form (the simplest) … |
The End.