3,927 Posted Topics
Re: None of your classes implement MouseListener, which has a couple more methods than just mousePressed(). If your MeltingSnowman class implemented MouseListener, you could add it as a mouse listener to your Frame. Or you could add an anonymous inner class that extends MouseAdapter and forward the mousePressed() event to your … | |
Re: No, they really won't, because they just posted their homework assignment without demonstrating any effort whatsoever - which runs afoul of the announcement in all of the dev forums: [url]http://www.daniweb.com/forums/announcement8-2.html[/url] | |
Re: I would recommend Java or C#. There are forums for both of those here to assist with questions: [URL="http://www.daniweb.com/forums/forum9.html"]Java[/URL] [URL="http://www.daniweb.com/forums/forum61.html"]C#[/URL] The Java forum has a [URL="http://www.daniweb.com/forums/thread99132.html"]Read Me: Starting Java[/URL] post at the top of the forum with plenty of information to help you get started. I didn't see such a … | |
Re: [URL="http://recaptcha.net/"]Recaptcha[/URL] is good, free, and easy to implement - plus you're helping to digitize books at the same time. | |
Re: We ditched VSS for Subversion as well. Very happy with it. | |
Re: Yes, that's what objects are for and you can place any object type you want into a combo box. The toString() value of the object will be displayed as the text if the object is not itself a String. So consider how a small class like this could be used[code=java]class … | |
Re: [QUOTE=jbennet;728566]yeah im staying up all night (its all going on between 2300 and 0600 GMT)[/QUOTE] Ouch! That's dedication! I'm hoping to be in bed by midnight here in Central Standard (GMT-6) | |
Re: [quote=Infarction;398043]I'll make the assumption that the email you sent had reasonably proper punctuation and spelling, unlike your posts (which walk a fine line of understandability)... :icon_wink:[/quote] hehehe... These were my thoughts as well :P | |
Re: My wife mentioned that she was sure to get some flak over that dress. Of course, my response was "huh? dress? I hadn't really noticed.". I guess stuff like that just doesn't even register with me very often. | |
Re: If you don't ever change x or y, it's going to keep overwriting the same element forever. | |
Re: And what is that error? It should indicate the nature of the problem and the line number on which it occurs. One thing I would point out is the missing parenthesis on this method call [icode]Circle.radiusInt[/icode] | |
Re: [QUOTE=VENOM <3;730554]im bored. im posting this because im bored. yup... ughhhhhhhhhh.... im soooooooooooooooooooooo bored... is there anyone out there that wants to chat??? anyone??? at all? =|[/QUOTE] [URL="http://www.google.com/search?sourceid=mozclient&ie=utf-8&oe=utf-8&q=california+inmate+penpals"]All of these people do[/URL]. They're bored as well, I imagine. | |
Re: You missed the ! (not) operator in my code to toggle the glass pane on/off. You aren't ever setting it visible :) Do this[code]getGlassPane().setVisible( !getGlassPane().isVisible() );[/code] | |
Re: If you are wanting to paint the line over a grid of JButtons, you'll need to create a small component to install as the glass pane (you read about glass pane [URL="http://java.sun.com/docs/books/tutorial/uiswing/components/rootpane.html"]here[/URL]). The code to paint the lines will go in the paintComponent() method of that class. Here is a … | |
Re: [QUOTE=scru;693599]Coldplay (no laughing.)[/QUOTE] :icon_lol: | |
Re: Huh? That is exactly what you are doing here[code]envStack.push(envA);[/code] Perhaps you need to restate the question? | |
Re: [url=http://java.sun.com/javase/6/docs/api/java/lang/ProcessBuilder.html]ProcessBuilder[/url] or [URL="http://java.sun.com/javase/6/docs/api/java/lang/Runtime.html#exec(java.lang.String,%20java.lang.String[],%20java.io.File)"]Runtime.exec()[/URL] | |
Re: Well, if they are four individual variables you could use nested min/max calls[code]int a = 2; int b = 22; int c = 3; int d = 345; System.out.println(String.valueOf(Math.min(Math.min(a, b), Math.min(c, d)))); System.out.println(String.valueOf(Math.max(Math.max(a, b), Math.max(c, d))));[/code] If they are an array, you could just call Arrays.sort() and pull the first … | |
Re: It works just fine for me as well. The only "disappearing" I could see is that the label will move depending on the length of the value displayed in the "result". That is because you used FlowLayout. | |
Re: First, make sure all code you post is in [noparse][code][/code][/noparse] tags (there is a button to apply them to highlighted code in the post editor). Second, you can't use primitives "by reference". Your function needs to return the result of the calculation. Objects passed as parameters can be modified by … | |
Re: "Objects are the same" is the entire purpose of the equals() method. [url]http://www.ibm.com/developerworks/java/library/j-jtp05273.html[/url] | |
Re: [QUOTE=sameya qazi;730040]how can i get the an my questionfrom this website?[/QUOTE] You could start by making some sense I suppose. | |
Re: [url]http://www.oracle.com/technology/oramag/code/tips2004/031504.html[/url] | |
Re: If you just want to append to the string generated by the parent class toString() method, use this[code]return super.toString() + " [" + college + "]"; [/code] | |
Re: How should we know? Is it doing what you expect it to do? If not, what is wrong with it? Be specific. If you want someone to read it, you need to post it in [noparse][code][/code][/noparse] tags so the indentation is preserved instead of that wall of unformatted mess. | |
Re: I voted "very urgent please". Perhaps if you post the code here in [noparse][code][/code][/noparse] tags people will be a little more inclined to look at it. | |
Re: [QUOTE=adetya;727697]cant u read?[/QUOTE]Can't [U]you[/U] write? [QUOTE=adetya;727697]ACCOUNTING MAJOR...i dont have any background in this.this is the first and definatly the last cis course ill be taking ever.[/QUOTE]YOUR COURSEWORK. Regardless of your background, you can either make the effort to pass or fail the course. [QUOTE=adetya;727697]plus i really dont think i nything … | |
Re: [QUOTE=christina>you;727923]Obama isn't.[/QUOTE] Says your propaganda. | |
Re: [QUOTE=Davonpk;714700]well i think that it is easier to learn java then to start learning a programming code but it depends on which type of job your looking for i personally think C# is the best for a programming language[/QUOTE] This statement makes little sense. Are you under the impression that … | |
Re: ... and thus were the beginnings of [URL="http://en.wikipedia.org/wiki/Skynet_(Terminator)"]SkyNet[/URL]. | |
Re: *adjusting tin foil hat* Oh, it's already in place. The New World government and their alien puppeteers carefully control all of the information you receive.... [url]http://en.wikipedia.org/wiki/Coast_to_Coast_AM[/url] | |
Re: Use basic math to translate your values to pixel coordinates. You are just drawing on a rectangle of getHeight() and getWidth() dimensions. (Hint: the middle is just [getWidth()/2, getHeight()/2] and y' = getHeight()-y ) Or translate the graphics context to the origin you want and invert the y scale on … | |
Re: Correct. The mouse event will supply the current coordinates of the mouse, which you can use to calculate your new rectangle coordinates. The paintComponent() method can then draw a rectangle with those coordinates when you call repaint(). | |
Re: Well, understanding how to solve it is going to be pretty important to coding it, wouldn't you say? You need to start with some pseudocode of your approach and then start writing the Java code to carry it out. Post your code and specific questions if you have difficulties. | |
Re: Two options: 1) Give the program more memory with -Xmx: [url]http://java.sun.com/javase/6/docs/technotes/tools/windows/java.html#options[/url] 2) Use less memory. That may involved using a smaller thread pool or limiting buffer sizes for file operations, etc. | |
Re: Easy to do with a Swing [URL="http://java.sun.com/javase/6/docs/api/javax/swing/Timer.html"]Timer[/URL] that toggles a "paint string" boolean on and off and calls repaint(). Just have your paint method check that variable before drawing the string. | |
Re: Since you are using DefaultTableModel, use [URL="http://java.sun.com/javase/6/docs/api/javax/swing/table/DefaultTableModel.html#addRow(java.lang.Object[])"]addRow()[/URL] to add the row. [URL="http://java.sun.com/javase/6/docs/api/javax/swing/JTable.html#editCellAt(int,%20int)"]JTable.editCellAt(int,int)[/URL] to set the editing cell. | |
Re: First off, read the tutorial on using custom cell renders: [url]http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#renderer[/url] and here is another example: [url]http://www.exampledepot.com/egs/javax.swing.table/CustRend.html?l=rel[/url] The render will be called for each cell in the table that you have registered it for. Look at the parameters that are supplied when the render is requested:[code]getTableCellRendererComponent(JTable table, Object value, boolean … | |
Re: A few well-placed System.out.println() statements to verify what you are trying to delete would be a good place to start. | |
Re: Yes, [URL="http://java.sun.com/docs/books/tutorial/uiswing/components/applet.html"]that is what JApplet is for[/URL]. | |
Re: Toss up between Iron Maiden and Metallica. Runners up include Megadeth, Testament, Anthrax, Overkill, Helloween, and Queensryche. Honorable mentions to Slayer, Ozzy, Exodus, Savatage, Rage, Annihilator, Death Angel, and Metal Church. | |
Re: Perhaps you would like to explain which methods you are having trouble with in that wall of code? That's a lot of extraneous UI code to wade through to distill the relevant pieces you want to work with. | |
Re: Nope. Too many "e"s in the title. (Also, you haven't explained precisely what trouble you are having with the program.) | |
Re: These may answer a lot of questions for you: [LIST] [*][url=http://www.gamedev.net/community/forums/topic.asp?topic_id=317688]A Potential Game Programmer's Guide to a Future in the Industy: Degree Mappings[/url] [*][URL="http://www.gamedev.net/community/forums/topic.asp?topic_id=356663"]Question a grizzled and not yet bitter veteran[/URL] [*][URL="http://sloperama.com/advice.html"]Tom Sloper's Game Biz Advice[/URL][/LIST] | |
Re: Yes, it's possible to "add further functionality" by composing new classes of your own that use those classes internally to extend or alter the functionality (assuming there are not licensing issues). Of course, you do need to understand the API of the other classes if you expect to do much … | |
Re: [QUOTE=liquoriser21;719738]Im not really concerned and bothered by that! Im living programming not English[/QUOTE] And it sounds like that isn't working out so well for you. :-/ | |
Re: The constructor needs to declare that it throws that exception.[code]public TestScores(double[] s) throws InvalidTestScore {[/code] You also need to: - Use a constructor that actually exists for InvalidTestScore. - Use an appropriate constructor for TestScores in ExTest. - Check the spelling of your exception and use the right one. | |
Re: Read the API for the [URL="http://java.sun.com/javase/6/docs/api/java/lang/Math.html"]Math[/URL] class. | |
Re: Have you already read through the entire tutorial on [URL="http://java.sun.com/docs/books/tutorial/uiswing/layout/gridbag.html"]Using the GridBagLayout[/URL]? The layout you want isn't difficult to achieve, but getting used to the way the constraints work does take some time and experimentation. For your particular question, try giving the text fields a weightx of 1.0. This will … | |
Re: Or an even crazier suggestion: Read your class notes and materials. |
The End.