200 Posted Topics
Re: well, first and foremost, use [ code][ /code] tags. now that that's out of the way, your constructor is right for print you need to use a for loop or a while loop, to loop through the array and print the individual chars one at a time for concat you … | |
Re: a search i did i found this: [code=java]public static BufferedImage rotate(Image image, double angle, int cx, int cy){ int width = image.getWidth(null); int height = image.getHeight(null); //The bounds of the image int minX, minY, maxX, maxY; minX = minY = maxX = maxY = 0; //create an array containing the … | |
Re: he means setting the page of a JEditorPane to a page contain javascript (i think). in that case it won't work | |
Re: i am about to enter college, going to the field, and i was wondering the same thing... posts 10 and 11 are in a weird order :D | |
Re: or use [URL="http://java.sun.com/docs/books/tutorial/2d/images/loadimage.html"]ImageIO.read()[/URL] and [URL="http://java.sun.com/docs/books/tutorial/2d/images/saveimage.html"]ImageIO.write()[/URL] | |
i have some code that will make sound, a sine wave, actually, but i want to be able to actually play more than one sound at once, how can i modify this code to make it work. i found this on the internet somewhere, and it was hard to find. … | |
Re: why would you have to use Swing? you can just take a URL as a command line argument, or as a prompt from within your program, you don't need a GUI. | |
Re: why not use a constructor? EDIT: [URL="http://java.sun.com/docs/books/tutorial/java/javaOO/constructors.html"]LINK[/URL] | |
Re: i think this thread has something on it: [URL="http://www.daniweb.com/forums/thread142036.html"]LINK[/URL] come to think of it, you started it, 8 hours ago (7 from when you posted this). and if noone replied they either don't know, or haven't seen it yet. you should wait at least a day, and post exactly what … | |
Re: keyboard.next(); returns a string, not an int, so int value = number is trying to assign a string value to an int type. try putting this instead: [icode]int value = Integer.parseInt( number );[/icode] | |
Re: why do you want to generate your UI at runtime? if you want to use XML you could write your own parser, for this you would probably need to use DOM. as for actually creating a UI at runtime, i don't know exactly how you would go after that, you … | |
Re: next largest = largest before changing the largest | |
Re: well, 1 please use code tags. 2 why don't you use the modulo '%' operator. [code]int cents=197; int dollars = cents/100;//shows dollars int temp = cents%100;//gets cents left over int halfs = temp/50;//gets amout of half dollars temp = temp%50;//gets cents left over int quarts = temp/25;//gets quarters temp = … | |
I am working on a Matrix class that will eventually do a lot of stuff, but early on I have already hit a snag, how do I initialize (in a constructor) the 2D vector I have declared. [code=c++]//matrix class #ifndef MAT_CLASS #define MAT_CLASS //template <typename T> using namespace std; class … | |
Re: you mean like this: [code]x+y+z=18 2x+y+3z=20 5x-y+2z=15 1. [ [ 1 1 1 18 ] [ 2 1 3 20 ] [ 5 -1 2 15 ] ] 2. [ [ 1 1 1 18 ] [ 0 -1 1 -16 ] [ 5 -1 2 15 ] ] 3. … | |
Re: 1. don't ask for emails. 2. use code tags for code [URL="http://java.sun.com/javase/6/docs/api/java/io/FileWriter.html"]FileWriter[/URL] why are you changing using rename on a file you are writing, what is this code's purpose? | |
reply to the last post with the name of the band and the name of the song that the lyrics are to. preferably enough lyrics to know the song ie. "i never wanna hear you say i want it that way"-> backstreet boys, i want it that way and i'll … | |
Re: i think you need to nest [URL="http://java.sun.com/docs/books/tutorial/java/nutsandbolts/for.html"]For Loops[/URL] using the counter of the first as the limit for the second | |
I did some quick searches of google and daniweb, but i cannot find anything on how i can do this. instead of a long and probably misunderstood explanation i have this: [img]http://matrixpeckham.googlepages.com/sandscreens.jpg/sandscreens-large.jpg[/img] short explanation: is a falling sand game. list at right can change whenever a new text file is … | |
Re: it's not stop, it's break and [URL="http://java.sun.com/docs/books/tutorial/java/nutsandbolts/branch.html"]this is the sun tutorial on it[/URL] | |
Re: i doubt that there is any code specific for aquariums, or any books on it. there are undoubtedly books on DirectX, and some on AI which, with fish AI shouldn't be too hard, unless you intend to allow cephalopods (squid and octopuses) , which are a bit more intelligent ( … | |
Re: do you know how to write a loop at all? yes/no: google.com ? java.sun.com/doc/books/tutorial ? java.sun.com/javase/6/docs/ ? daniweb.com/forums/thread99132.html ? daniweb.com/forums/search.php?forumid=9&query= ? | |
Re: uh, [URL="http://java.sun.com/docs/books/tutorial/uiswing/components/filechooser.html"]JFileChooser[/URL] | |
Re: yes. read one file write another pseudo-code: [code=pseudo-code]while not end of file read piece of file to var write piece of file from var end while[/code] for information on io go [URL="http://java.sun.com/docs/books/tutorial/essential/io/index.html"]here[/URL] | |
Re: you never set the menubar for the JFame [icode]this.setJMenuBar(menu)[/icode] | |
Re: For info on linux VS windows in the JNI read [URL="http://java.sun.com/developer/onlineTraining/Programming/JDCBook/jni.html"]this. [/URL] to find out the operating system you can use [icode]System.getProperty("os.name");[/icode] NOTE: i am not too familiar with the JNI myself, but it is one of the things about java that typically destroys platform independence, but what your trying … | |
Re: the "paint bucket" or "fill" tool of graphics editors sometimes use recursion. although as has already been stated, when stack space is a problem non-recursive methods are used. the algorithm i found for parsing a mathematical expressions form strings was recursive, i found it in a book after no one … | |
is it possible to use the Dev-C++ compiler with Netbeans? if so how, i can't find anything that explains it. | |
I did a brief search of the forums, and didn't find anything on collision detection that was 1) this general, or 2) had this kind of question I don't want bounding box! every place i look all game tutorials use bounding box, and that is not accurate enough for what … | |
Re: uh, if it is already an .exe, i think you can look at [URL="http://www.dreamincode.net/forums/showtopic21813.htm"]this[/URL] | |
i want to make a code template in netbeans with the abbreviation of cn that will expand into the name of the current class being worked on, is there a way to do this? i cannot find anything about it. google won't turn up any good info | |
Re: ok, 1: use code tags 2: [URL="http://www.daniweb.com/forums/faq.php?faq=daniweb_policies"]Forum Rules[/URL] keep it organized don't use names like "HELP!!" 3:don't use "==" for string comparison use [icode].equals(String)[/icode] or [icode].equalsIgnoreCase(String)[/icode], as "==" won't work correctly 4:ch4 is a checkbox and doesn't have a get selected item method it has an isSelected method that is … | |
Re: take out ItemListener in your class statement and take out the .addItemListener(this) call, the reason is that you are making an abstract item listener with the second set of calls to addItemListener, and your class isn't acting as the listener at all | |
new to network stuff going through the java tutorials and i did what it said heres the code: [code=java]import java.io.*; import java.net.*; public class EchoClient { public static void main(String[] args) throws IOException { Socket echoSocket = null; PrintWriter out = null; BufferedReader in = null; try { echoSocket = … | |
Re: i don't know whether this will work, but try setting using [icode].setFocusable(false)[/icode] on the buttons. i don't think it will work, but it's worth a try EDIT: it may ruin the way that you use the keyboard, but without seeing how you implement i cannot say | |
i know that blender has a game engine, but i cannot find anything really good on how to get it to work... i can make physics happen, there are tutorials (like a ball rolling) on that that are easy to understand, but i don't get the event thing that blender … | |
i don't have any problem with it because i haven't tried to use it... i am curious whether anyone here has used the Speech API, and how it is to work with. what kind of results does it give, and how well does it work. i just don't want to … | |
Re: these are the results i got from running in bluej are they similar to yours? for some reason the last call to println() didn't do anything, i don't have an explanation for that though. [code]64979064 / 65470464 64979064 / 65470464 [SelfTracker at address: SELFTRACKER@15E234C with index: 0, SelfTracker at address: … | |
Re: hi again... here is something that may help: [code]expression = term && (plusterm || minusterm)* plusterm = '+' && term minusterm = '-' && term term = factor && (timesfactor || dividefactor)* timesfactor = '*' && factor dividefactor = '/' && factor factor = phrase && (expfactor || phrase) expfactor= … | |
Re: 1. no one here is just going to give you code without you showing effort and 2. the [URL="http://www.daniweb.com/forums/forum24.html"]JSP board[/URL] would probably be the place to ask | |
the sun tutorials doesn't include anything on how to extend JDialog to make a dialog like this: [url]http://www.oucs.ox.ac.uk/windows/exceed/input.jpg[/url] can anyone point me to a tutorial that included this? my attempts to try making a frame into a dialog result in 100% cpu and infinite loops how do you make the … | |
Re: your the reason it won't draw is because your doing all of your drawing in your action listener, and it doesn't get called at the start of your program, so nothing gets drawn. one way i see to solve the problem... make a new boolean variable, i would call it … | |
Re: why did you post this twice? if it will be stand alone why not write to a plain old file? | |
Re: [url]http://java.sun.com/docs/books/tutorial/uiswing/learn/index.html[/url] gives an example of how to make a GUI with netbeans | |
Re: huh? please be more specific and provide the code you already have | |
Re: you already read the sun tutorial? then i would suggest [URL="http://www.developer.com/java/other/article.php/3556176"]this[/URL]: [QUOTE]Annotation-based development is certainly one of the latest Java development trends. Annotation-based development relieves Java developers from the pain of cumbersome configuration. Quoting from Sun's official site, "It (annotation-based development) lets us avoid writing boilerplate code under many circumstances … | |
Re: package the images in a jar file with the classes and use [icode]getClass().getResource(path);[/icode] to get a url for it and you can use the url directly as an argument to your [icode]ImageIO.read()[/icode] you won't get access denied errors because they will be in the jar | |
Re: [QUOTE=lich;661272]The Lectuerer didnt started about Interfaces.. we have no idea when he gonna do it... meanwhile our project submission is on next week. so we have to start our project.[/QUOTE] that doesn't help us figure out what to tell you but the two possibilities have already been listed. why not … | |
Re: i don't know much about c#, but looking at the syntax, it is much more like c++ than java, it looks like many of the keywords are different, converting to and from languages, if you know the ideas behind it and the concepts, it us usually a matter of learning … | |
ok, so i've been working on this project for a long time now, a falling sand game, on and off. it works [I]almost[/I] the way i want it too... 2 problems, one i don't think this community will be able to help me with, the other, the optimization, i have … |
The End.