3,927 Posted Topics
![]() | |
Re: [quote=RamyMahrous;440782]you don't have any problem to cast int to string int myInteger = 25 String myString = myInteger; what's your problem?![/quote] This is not valid at all. To the OP, use String.valueOf(int value). | |
Re: Just parse the lines from the text file into its fields, create the Student, and I would suggest you could use a HashMap if you want to access the Students by their ID. You have already posted several threads about reading a field from text file, so I find it … | |
Re: Instantiating a class at runtime like that can be done through Reflection. See the following info: [url]http://java.sun.com/docs/books/tutorial/reflect/index.html[/url] Class.forName() will allow you to get a Class instance for a given full (including package) class name. | |
Re: Super can also be used to call a parent class method that you overriding to extend the original functionality. i.e.[code=java] public void someMethod(){ // go ahead and do what parent class has defined super.someMethod(); // now do a few other things that this subclass needs... }[/code] | |
Re: Post the code that you do have, or pseudocode for the algorithm and specific questions that you have about implementing it in Java. The forum is for Java help - not implementations by request. | |
Re: Not sure exactly what you are referring to with "precasting". There is casting[code] List pointList = new ArrayList(); pointList.add( new Point(0,0) ); Point p = (Point)pointList.get(0); // you must cast Object to Point here[/code] or you can use generics to "pre-cast" and declare the type of collection[code] List<Point> pointList = … | |
Re: "visualization java tools"? Do you mean the graphics APIs? Please describe what you are wanting to do a little bit more. | |
Re: Well, the math that it is performing is very straightforward. Do you mean to increase the "discountRate" by 20% of "discountRateBeforeTaxes" on every call to setDiscountRate()? You would probably be better served by breaking those calculations into multiple steps if you aren't getting the results you expect. Then you can … | |
Re: If you pass the JFrame reference as the "owner" parameter to the JDialog constructor it will center on it. Example:[code] JFrame frame = new JFrame(); frame.setBounds(200,200,300, 400); frame.setVisible(true); JDialog dialog = new JDialog(frame,"test"); dialog.setVisible(true);[/code] | |
![]() | Re: [quote=sakura_fujin;441002]actually i still have problems with regards to this project of mine, GUI is really not the priority, il post a new thread with regards to it, tnx[/quote] And [U]use code tags[/U]! Both here and in the other post, you have posted a huge wall of code without any formatting, … |
Re: [inlinecode]Ellipse2D.Double ellipse = new Ellipse2D.Double(0,0,getWidth(),getHeight());[/inlinecode] | |
Re: Well, without a database you will have to hardcode every condition as an if statement, but if that is really what you want to do then...[code] $makems = $_GET['makems']; if ($makems==83){ // place the audi banner }[/code] | |
Re: If you are using the DefaultTableModel for your model, you can call [INLINECODE]removeRow(int row)[/INLINECODE]. If you are using your own custom table model then you must implement it yourself. | |
Re: [quote=BABSYOMMY;439940]I need to a have a CHAT WINDOW in my business website. Please how can I achieve this?[/quote] You don't mention what language you are using for your site, but you might want to look into Joomla if you are willing to consider something PHP-based. It has a ton of … | |
Re: [code]String.valueOf(x);[/code] | |
Re: Perhaps this will help:[url]http://www.mindcontrol.org/~hplus/nat-punch.html[/url] | |
Re: You need to look into [URL="http://en.wikipedia.org/wiki/Optimization_%28mathematics%29"]optimization[/URL]. ![]() | |
Re: What? Your post does not make any sense at all. Please provide a bit more info on what you are wanting to do. | |
Re: [quote=ft3ssgeek;438324]Free speech is, of course, one of the core foundations of our contry and I would not presume to infringe on anyones decision to exercise that right...but I believe that with that right should come the responsibility to exercise it responsibly...[/quote] Responsibility seems to be a fading concept these days. | |
Re: Not sure if you are storing the ID as a number or a string in the db, but if it is a number then drop the single quotes in the where clause. Other than that the SQL look just fine. | |
Re: Why don't you ask on the vBulletin forums?? [url]http://www.vbulletin.com/forum/[/url] For specific apps like that you're better off starting at the source. | |
Re: You may want to look into using osCommerce for the site:[url]http://www.oscommerce.com/[/url] There are many people that do custom templating for osCommerce if you need that service. | |
Re: You will of course have to implement a paging mechanism if your results exceed rows*columns and you will need to get all of the items into a single array before you generate the <tr> and <td> elements. The following example code shows how you can generate the table you want[code] … | |
Re: Ok, I think I know what is causing your issue. Check your db.conf file for the root_path property. If you left it set to the default 'jvm' then you need to change that to use "configuration" as below[code] # root_path - If this is set to 'jvm' then the root … | |
Re: Maybe you would find an idea by using the search feature of the forums - there are about 2 million posts for "final year project" help... | |
Re: [quote=java_starter;438781][code] F:\JAVA\Java Files\Lab3\DellCustomer.java:3: cannot find symbol symbol : class Stirng location: class DellCustomer public static void main(Stirng[] args)[/code][/quote] Just a spelling error - I think you mean String. ^ [quote=java_starter;438781][code] F:\JAVA\Java Files\Lab3\DellCustomer.java:5: cannot find symbol symbol : constructor Customer(java.lang.String) location: class Customer Customer neel = new Customer("Neel Smith"); ^ [/code][/quote] … | |
Re: I don't know - but it has nothing to do with PHP so perhaps you should post such general ponderings over in the Geek's Lounge? | |
Re: Unless you are parsing XML streams, you would find it simpler to use the DOM parser, which uses a Document model instead of the event-driven stream parsing of SAX. Info on using both types of parsers is here: [url]http://java.sun.com/xml/tutorial_intro.html[/url] | |
Re: [quote=Herm;436506]i love holland.....[/quote] ... and ... ? [quote=Herm;436515]I'm a hot woman from Holland[/quote] No... you aren't. [quote=Herm;436518]Hey, are you that on your pic? What is your age?[/quote] If he are that on his pic, he age are what his is. [quote=Herm;436523]i'm sorry i'm new here.[/quote] I'm sorry you are new … | |
Re: [quote=iamthwee;438658]Surely the util.Calendar stuff should contain something relevant?[/quote] Yea, a combo of Calendar and DateFormat, though not very intuitive unfortunately:[code] Calendar now = Calendar.getInstance(); System.out.println(new SimpleDateFormat("EEEE").format(now.getTime()));[/code] | |
Re: [quote=iamthwee;438089]Erm maybe because 08765 isn't an integer?[/quote] Exactly. If you really need leading zeros then you have to create that String representation yourself - which will undo the whole point of converting in the first place. | |
Re: I can't see what you are wanting to accomplish with this code[code] foreach ($nvalue as $key => $value){ $nvalue[]=$value; }[/code] the following shows your array is just fine as it is[code] foreach ($nvalue as $key=>$value){ echo $key."=".$value."<br>"; }[/code] Why are you overwriting the array values? | |
Re: File.[B][URL="http://java.sun.com/javase/6/docs/api/java/io/File.html#lastModified%28%29"]lastModified[/URL][/B]() You can't get creation date without using native code though. [URL]http://mindprod.com/jgloss/lastmodified.html[/URL] | |
Re: You need J2ME: [url]http://java.sun.com/javame/index.jsp[/url] (and why are you advertising the links at the bottom of your post?) | |
Re: You're right - you didn't follow number 3 correctly. Your code is adding the new coordinates to the old when all it needs to do is set them[code] x1 = xNew1; y1 = yNew1; x2 = xNew2; y2 = yNew2;[/code] | |
Re: [quote=vinod_javas;437818]hi everyone i have a very a very basic question in mind .. i wanted to discuss .. Difference Between these? String s1= new String("java") ; String s2="java" ; [/quote] Strings are immutable in Java and the String class maintains a pool of String objects that have been created. Using … | |
Re: Well, you don't say where you are in the learning process, but wanting to do a graphical game is a bit beyond the basics. I'd recommend something text-based from the console before you get into Swing and 2D graphics. ![]() | |
Re: See bold red comments in the code: [quote=volscolts16;436999]I having a small problem with the output on the Your CD's side, they are only viewable if I double click inside the pane, then they show up, almost like the pane is on top. How can I fix, I have tried moving … | |
Re: You'll have to read from one file and write what you want into another. As you scan your input, when you find line.startsWith("Acknowledgement") then keep reading lines but don't write any data until you get to the line.startsWith("Introduction"). I hope you aren't stripping copyrighted material of all copyright and acknowledegment … | |
Re: Well, you can use [code] long startTime = System.nanoTime(); // ... the code being measured ... long estimatedTime = System.nanoTime() - startTime;[/code] if you really think you need better than millisecond resolution. | |
Re: I can't see why you need to avoid split, but [URL="http://java.sun.com/javase/6/docs/api/java/util/Scanner.html"]Scanner [/URL] and [URL="http://java.sun.com/javase/6/docs/api/java/util/regex/package-frame.html"]java.util.regex[/URL] are other options for parsing your input. | |
Re: It all depends on the nature of the app, but yes, many use a database to store information. The database choice depends on your application needs. If you need a central database for many client apps, take a look at Postgre SQL or MySQL. If each clients data is self-contained, … | |
Re: Well, your question barely makes sense given the code that you posted (which needs code tags too). Maybe this example of writing to a file will help [url]http://www.exampledepot.com/egs/java.io/WriteToFile.html[/url] | |
Re: You need to reset index and tmp before scanning each line. Also you don't have any checks on index vs strLine.length() so if you did have a line with no spaces in it you will get an index out of range. | |
Re: You don't even need the [inlinecode]new File("")[/inlinecode] part - the method is static. [code] for(File drive : File.listRoots() ) System.out.println(drive); [/code] :) | |
Re: As I understand your requirement, you only need an array coffee[numberOfAisles][numberOfBins]. I don't think you need to have a different number of bins per aisle, so you can create the array directly from the two questions without looping. You will need to loop the array when you total the weight. … | |
Re: That's not much of a question. Care to be a little more specific? | |
Re: [quote=tirivamwe;432742]code in login page is: [code]header("Location: index.php?$page");[/code] how do i get the data from the variable in index page after redirect from login page[/quote] You mean the $page value? Or some other variable? If you mean $page (which I assume is a name-value pair like "var=someValue", if not then you … |
The End.