3,927 Posted Topics
Re: And don't you have about 5 threads started on this now? | |
Re: I think you are correct that the behavior did stem from some blocking, but this can still be simplified a great deal to work without a separate listening thread. Here's a re-wired version of the same that behaves itself. It's worth noting that these two versions only differ in what … | |
Re: The problem is that all of your code, including the thread.sleep() calls, are executing on the AWT event queue thread, which is the same thread that handles the repaint calls to update the display. You have to separate the animation updates from the painting. One way to do that would … | |
Re: Well, to get rid of that error, don't call methods that do not exist[code]helpMenu = menuBar().addMenu(tr("&Pomoc"));[/code] | |
Re: You can customize all kinds of things about how the UI appears. A lot is possible with the methods provided by the Swing components, but if that isn't sufficient it's possible to use the the pluggable look and feel and custom UI delegates to gain a greater degree of customization. … | |
Re: Looks like you have a bit of work ahead of you. Let us know if you have specific questions about portions of it. | |
Re: You have to actually create the JButtons in your array. You have only declared the array of references with this statement[code]JButton[][] button = new JButton[3][3];[/code]You must still initialize those objects by adding[code]button[i][j] = new JButton();[/code]in your loop before you try to do anything with them. | |
Re: You could define a method like [CODE]private void enableLength(boolean enable){ txtLength.setEnabled( enable ); lblLength.setEnabled( enable ); }[/CODE]so your if() code becomes[code]if (optBox.isSelected() ){ enableLength(true); }[/code]That would be a little clearer to follow and a bit less repetition. You would have one method for each of your dimensions. | |
| |
Re: Just like any anonymous implemenation[code]return new Enumeration() { public boolean hasMoreElements() { throw new UnsupportedOperationException("Not supported yet."); } public Object nextElement() { throw new UnsupportedOperationException("Not supported yet."); } };[/code]Creating a small private inner class for the enumeration and returning an instance of that would be better though. You can see … | |
Re: Sounds like you probably need to fail then if you cannot show that you learned the material. Failing can be a great learning experience. | |
Re: [QUOTE=bobwahler;494945]And anyone who wants to claim that I am being "absurd" better do THEIR homework.[/QUOTE] None of your data shows any causal relationship to spanking though, so despite all the caps-lock words you want to sprinkle about, it still remains unsupported speculation. | |
Re: I'm struggling a bit to understand the exact behavior you are aiming for, but if you're just saying that the "main frame" needs to take some action when the selection array changes, you can make a small listener model for this yourself very easily[code]interface SelectionListener { void selectionChanged(); } /** … | |
Re: The max value for int is 2147483647, so you will need to use [iCODE]long[/iCODE] for that value. | |
Re: Read carefully what you are doing in the paintComponent() method. You are looping through every point in the array list and each time drawing a line between point1 and point2 - which are completely separate from your list of points. Perhaps you want to loop the array list by it's … | |
Re: You are executing this statement, exactly as is [icode]"INSERT INTO user VALUES (forename, surname, dob, add1, add2, county, postCode, telNumber)"[/icode]That does not contain any of the information that you collected above it. It's just that string as written. | |
Re: Well, evidently you it's something that you [U]cannot[/U] do because you are here asking how to do it. I'd say you lost the bet. | |
Re: Use a scanner to get the input. Use a variable for "highest" and one for "lowest". Compare the input to those and alter as needed. | |
Re: There are existing wrapper classes for all of the primitive types. Use Integer. Auto-boxing will handle the casting for you. | |
Re: I can't figure why you would want to render it in a list. If you want to display a series of panel entries they you would be better off putting them in a vertical box layout in a scroll pane. | |
Re: I think you're talking about a combo box: [url]http://java.sun.com/docs/books/tutorial/uiswing/components/combobox.html[/url] | |
Re: There is no reason you need to create an .exe from the jar file (and many reasons [I]not[/I] to). Just read the tutorial on packaging applications as jar files: [url]http://java.sun.com/docs/books/tutorial/deployment/jar/index.html[/url] For your shortcut, you can simply use the same syntax that you would to run it from the command line. … | |
Re: [QUOTE=rouhaifa;990230]this is the answer about the count: int counter (string s){ count=0; for (int i=1;int i<s.length();i++) count ++; return count; }[/QUOTE] Um, no... just no. | |
![]() | Re: You cannot delete the account, but you can turn off all mechanisms for contacting you in your [URL="http://www.daniweb.com/forums/usercp.php"]User Control Panel[/URL]. |
Re: [QUOTE=Josseling;1024833]Para que se usa el string.value, ayudenme a crear una clase cuenta. Manda a pedir si quieres crear una cuenta de ahorro o una de credito...[/QUOTE] Éste es cuatro años. Read the forum rules regarding posting in English please. | |
Re: If you mean task instead of target, yes there is. [URL="http://ant.apache.org/manual/index.html"]Read the documentation[/URL]. | |
Re: There are plenty of references on calculating the distance between two coordinates, but since you're only interested in an approximate 5 mile radius, you could just use the Pythagorean theorem and assume the curvature is negligible [icode]dist = sqrt( (x2-x1)^2 + (y2-y1)^2 )[/icode] edit: You might find this post helpful: … | |
Re: Begin with basic network IO: [url]http://java.sun.com/docs/books/tutorial/networking/index.html[/url] | |
Re: [QUOTE=vikujani;619072]who to find largest value of an array that we entered(in pseudocode)[/QUOTE] Who? Well, the obvious answer is [U]you[/U]. If you are having trouble, post what you have so far in a new thread and ask specific questions about it. | |
Re: You have a few options to work with. - Use a TableModelListener to respond to the model data value change. Your check box is just a renderer/editor for a column value in your data model. The check box is not the data. - Use a custom cell editor that extends … | |
Re: Well, dragging up a four-year-old thread in the wrong forum is not the way to go about it. | |
Re: [QUOTE=aditi_19;1018504]Could you give me your mail id?[/QUOTE] Please do not ask for help via email. Read the forum rules about [URL="http://www.daniweb.com/forums/faq.php?faq=daniweb_policies#faq_keep_it_on_the_site"]Keeping it on the Site[/URL]. | |
Re: [QUOTE=The Mad Hatter;1006499]This is rather amusing. I posted a long, insightful write up on why I don't use Windows. And guess what - my reputation is instantly modded down. Now why would that be. Is it possible that Microsoft Trolls hang out here? I think so.[/QUOTE] Perhaps because your entire … | |
Re: You can set the margin on the button with the following[code]button.setMargin(new Insets(0,0,0,0));[/code] | |
Re: Just post your mailing address up here. I'm sure someone might be willing to send you... something... :P | |
Re: You may just be missing a call to setVisible(). | |
Re: [QUOTE=network18;1009073]what was the need for this, if the problem is solved please mark the thread as solved[/QUOTE] I would rather ask what was the need for this post of yours? You dragged up a two year old thread to ask that it be marked solved? You've done this recently on … | |
Re: It is telling you that the Circle class does not have a constructor defined that takes a double parameter. | |
Re: Sun's tutorial is a good palce to start. [URL="http://java.sun.com/docs/books/tutorial/post1.0/ui/keylistener.html"]Tutorial: Writing a Key Listener[/URL] If you still have unanswered questions after that, just post them here :) | |
Re: You have an outline, so start coding. If you get stuck, post your code and specific questions. | |
Re: kimbsan, This is not a "code by request" site. No one is going to just send you this code. Show some effort and post your code with specific questions in the appropriate forums when you get stuck. It's up to you to make the effort first though. | |
Re: You declare it as an array of CD objects, like so[code]CD[] cdList = new CD[10];[/code] and create them in the array like so[code]cdList[0]=new CD("Kaiser "," up the khazi ", 9.99);[/code] | |
Re: The [icode]super.paintComponent()[/icode] call just let's the component perform whatever normal painting the super class would if the method weren't overridden. To the OP: you may want to glance over this bit of info on the Swing painting mechanism: [url]http://java.sun.com/docs/books/tutorial/uiswing/painting/closer.html[/url] Your paintComponent() code is painting the JPanel portion and then paintChildren() … | |
Re: As a general rule, threads are not deleted upon request. Once it's posted, it's out there for good. | |
Re: You can use 3D apis like OpenGL or Java3D - or you can apply the perspective transformations yourself to generate the 2D representations. |
The End.