- Strength to Increase Rep
- +12
- Strength to Decrease Rep
- -3
- Upvotes Received
- 30
- Posts with Upvotes
- 27
- Upvoting Members
- 23
- Downvotes Received
- 18
- Posts with Downvotes
- 14
- Downvoting Members
- 8
1,034 Posted Topics
Re: Maybe something like this would work, but I'm not sure: [Code] String text = textArea.getText(); int upperCaseCount = 0; for (int i=0; i<text.length(); i++) { for(char c='A'; c<='Z'; c++) { if (text.charAt(i) == c) { upperCaseCount++; } } } [/Code] | |
Re: There's isn't a cd out there that's impossible to copy. You don't need any special kind of software, actually there's a program out there called "Alcohol 120%" that can copy any protected cd, even the strongest protection to date. I guess you could look into apply some of these copy … | |
Re: please do NOT send it. Clearly they want it for homework. | |
Re: Just some simple nested loops are involved: [Code] class Pattern { public static void main(String[] args) { for (int i=1; i<=6; i++) { for (int j=1; j<=i; j++) { System.out.print(j); } System.out.println(""); } } } [/Code] | |
Re: [Code] JTextField.setHorizontalAlignment(JTextField.RIGHT); [/Code] | |
Re: [Code] static int countChars( String str, char searchChar ) { // Count the number of times searchChar occurs in // str and return the result. int i; // A position in the string, str. char ch; // A character in the string. int count; // Number of times searchChar has … | |
Re: [QUOTE=jwenting][url]http://www.vim.org[/url] All you need.[/QUOTE] pshhhhh. All you need is JEdit. :cool: | |
I know that you can call this method to delete a row from a JTable: [Code] DefaultTableModel.deleteRow(index); [/Code] I need to delete all of the rows at some point, and this is not working: [Code] for (int i=0; i<dtm.getRowCount(); i++) { dtm.removeRow(i); mortgageTable.revalidate(); } [/Code] I tried revalidating, but that … | |
Re: try this link: [url]http://www.google.com/search?client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial_s&hl=de&q=inurl%3Ajava+filetype%3Apdf&lr=&btnG=Google-Suche[/url] Actually, my browser is in german so you might not get english results. So just copy and paste this into google search and it will come up some ebooks(pdf files): [Code] inurl:java filetype:pdf [/Code] | |
Re: This is how I would do it: [Code] public class ReverseString { public String reverse(String arg) { String tmp = null; if (arg.length() == 1) { return arg; } else { //extract the last char String lastChar = arg.substring(arg.length()-1,arg.length()); //extract the remaining chars String remainingString = arg.substring(0, arg.length() -1); tmp … | |
Re: I'll have to agree with Rashakil on this one. Math is extremely important. A few years back I would have told you that math is just worthless crap you will never use, but once you get into the more strenuous classes you'll see the real importance of it. I have … | |
| |
Re: Yes, the URL Object should make that work. Knight, is this JAR file an executable JAR file? If it is, could you show me how you did it? I tried once and never could get mine to work, even though everything was correct. | |
Re: You should be able to use Process: Process p = Runtime.getRuntime().exec(command); command is a string you pass. What's the error you're recieving? | |
Re: Why don't you take the number of characters the textfield is long, and how many characters the input is long, and formulate a center point out of that...Of course I would rather use setHorizontalAlignment(); ![]() | |
Re: You should post a seperate thread, so that you don't distract away from this thread starter. | |
Re: You want us to do your homework for you? | |
Re: import java.util.*; DecimalFormat dec = new DecimalFormat("###.##"); System.out.println(dec.format(value)); | |
I've often pondered over this subject. I know the main method has a special signature the JVM looks for, but why is it static? | |
I've looked and looked for some good material on this exception, but I can't find anything helpful. I just don't understand it. It's suppose to be caught or thrown whenever a method is called when not suppose to be...But won't other exceptions be caught or thrown in it's place? If … | |
Re: When you look at how much money is spent to keep ONE prisoner in prison, then it's just not fair to let them live. For me, it all depends on what they did. This mousaoui dude shouldn't get the death penalty because that's letting him off easy. What should happen … | |
I've created a jar file like this: jar cfmv Manifest.mf RoboPlot.jar RoboPlot.class ImagePlotter.class The manifest.mf file looks like this: Main-Class:RoboPlot For some reason, when I use this command to run it, java -jar RoboPlot.jar it tells me that the main class could not be found I also tried this: Manifest-Version: … | |
![]() | Re: Not that it's important or anything, but you can initialize all the elements to a specific value: vector< vector< double > > matrix( row, vector<double>(row, int_val)); |
I made this simple program that prints out all the factors of a given number. The only problem is that it prints out the numbers in different order...For example: factors of 12: 1*12 2*6 3*4 but this is what my program prints out: 1*12 2*6 3*4 [B]4*3 6*2 12*1[/B] It's … | |
Re: Debugging 101: Put some system.out.println()'s throughout the actionPerformed() method, and all methods it calls. check to make sure all variables have the proper values, and that it even enters certain methods. By the way, what are you doing with these lines: Numtemp = displayN.getText(); Base = displayB.getText(); If those are … | |
Re: Since it's abstract shouldn't you override that method and implement your own version, instead of calling that method? | |
Re: String pass = "crap"; If ( pass.length() > 6 && pass.length() < 15 ) { } | |
Re: I bet you could get some help in the JSP forum. | |
Re: I think you would have to create a PixelGrabber which returns an array of ints made from the image. Once you have that, I think you could use this method to convert the ints to binary: Integer.toBinaryString(int); Here is an example of a Pixel Grabber that creates a screen shot … | |
Re: I never got into video games that much but if I did I would probably buy used games or ask a friend if I could borrow one for a few days. | |
Re: [QUOTE=mikeandike22]ok i want to make a program to show a teacher at my school so i can get into computer Ap which teaches you java(but they say u have to know stuff to get in it makes no sense i am in highschool). [/QUOTE] I would learn it over the … | |
Re: For something like that I would say some if else statements would work. Like: [code] if (!card slot is already taken) { //do something } else { //do something else } [/code] Of course it would be cool to experiment making your own exception as EB said. | |
| |
Re: [QUOTE=jwenting]turns them into lazy bastards [/QUOTE] lol :cheesy: I agree though, you should of at least let him show a little effort..I mean even if it was a bunch of method and class stubs, at least it would have been some effort. | |
Re: [QUOTE=Chaky]Guy walks in a bar holding a big turd in both hands, showing it around and saying: "Look at what I almost steeped on!"[/QUOTE] hahhahahhahahahhahahaha | |
Re: Ever heard of anonymous proxies? | |
| |
Re: I think you got it backwards. compareTo() is used to compare Objects. It tests if THIS object is of the same type as the parameterized object. For instance, String s = "t"; String s2 = "sdfsa"; s.compareTo(s2); ///would be true .equals() compares the contents of the object. For instance, String … | |
Re: I'll give you a screenshot of my favorite project, although it didn' take ver long. | |
Re: If you simply trying to replace one character like that, use the replace method: [Code] class ReplaceAll { public static void main(String[] args) { String s = "Replace /, /, and /"; String replace = s.replace('/','r'); System.out.println(replace); } } [/Code] | |
Re: Where are you making a connection to the DB? | |
| |
Re: I have both of the books wmivey just specified{java in 24 hours and java primer plus}. I would definately go with these. | |
Re: [QUOTE=gpta_varun] one bottle out of 32 wine bottles is posioned with such poison that even one drop of it can kill a person.but any quantity of this poison kills exactly in 32 days.how will you find out the bottle with poisoned wine using min number of taste testers in 32 … | |
Re: [QUOTE=hooknc]I'm betting this is a compile error? Your compiler can't find the class MyInput. Make sure that MyInput is in your classpath. Regards, Nate[/QUOTE] Yep. You're using a third party class to read input. I'm guessing it's either came with a book, or your teacher supplied it. Either way you … | |
Re: I JUST gave you the answer to this problem a couple of days ago. Your program works fine...Nowhere in your code do you actually run the program though..What do you expect it do output if you don't make it output. This is the link...Don't crosspost. If you have further questions … | |
Re: I had to do a diamond once, making two triangles. I could post the code if you need it, but it looks like you've already got it solved. | |
The End.