Forum: Java 4 Days Ago |
| Replies: 1 Views: 133 You should start typing - that's where source code comes from. Post actual questions when you have specific troubles. |
Forum: Java 8 Days Ago |
| Replies: 2 Views: 178 Cast your Graphics reference to Graphics2D and turn on anti-aliasing:Graphics2D g2D = (Graphics2D)g;
g2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
Forum: Java 9 Days Ago |
| Replies: 6 Views: 259 Those are actually unrelated to the painting example. That code just makes sure that the GUI initialization occurs on the event dispatch thread. You can read more about that here if you are curious:... |
Forum: Java 9 Days Ago |
| Replies: 2 Views: 195 You might take a look at using internal frames: http://java.sun.com/docs/books/tutorial/uiswing/components/internalframe.html |
Forum: Java 11 Days Ago |
| Replies: 2 Views: 207 You're adding your components to the frame content pane itself - not the JPanel that you're constructing. So you end up with an empty panel plus your splitpane. You just need alter two lines to fix... |
Forum: Java 14 Days Ago |
| Replies: 8 Views: 389 |
Forum: Java 16 Days Ago |
| Replies: 4 Views: 247 I've used the Netbeans GUI builder for years and I don't know what you're referring to. Perhaps if you could be more specific someone could offer advice? |
Forum: Java 16 Days Ago |
| Replies: 15 Views: 3,145 while (notPayingAttentionToTheRules) {
ignore();
}
Start a new thread if you have a question. Show some effort if you would like assistance. |
Forum: Java 16 Days Ago |
| Replies: 2 Views: 215 That error message should contain a little more information at the end. They are appending the string description on that line.
If you want more info than that, add an "e2.printStackTrace()" in... |
Forum: Java 17 Days Ago |
| Replies: 2 Views: 234 Write code to parse this data (http://www.google.com/search?q=site%3Adaniweb.com+final+project) and make a selection. |
Forum: Java 17 Days Ago |
| Replies: 2 Views: 231 Here you have declared the type and size of the arrayMovingPlatform[] platforms;
platforms = new MovingPlatform[1];but you must still create an instance of each elementplatforms[0] = new... |
Forum: Java 24 Days Ago |
| Replies: 1 Views: 212 The code you posted won't compile - improper structure - which will certainly affect the visibility of those buttons.
You also haven't set howMany to any value. |
Forum: Java 24 Days Ago |
| Replies: 6 Views: 349 It looks like you can download the Java SE tutorial from Sun here:... |
Forum: Java 32 Days Ago |
| Replies: 16 Views: 9,353 Any other homework you need us to provide ASAP on your demand? Perhaps just post your instructor's email address so we can send it in directly? |
Forum: Java Nov 13th, 2009 |
| Replies: 7 Views: 603 Well, according to the OP, yes... |
Forum: Java Nov 6th, 2009 |
| Replies: 2 Views: 341 Why not stick with the ButtonGroup? You can put both radio buttons and check boxes in the button group just fine. CheckboxGroup is for use with AWT Checkbox.
(By the way, you forgot... |
Forum: Java Nov 5th, 2009 |
| Replies: 2 Views: 254 Maybe you want to reverse line 23? |
Forum: Java Nov 5th, 2009 |
| Replies: 8 Views: 380 Using the pattern (\w+?[RK]) with the regex Matcher.find() (http://java.sun.com/javase/6/docs/api/java/util/regex/Matcher.html#find()) method will capture all of those groups except for the last one,... |
Forum: Java Nov 5th, 2009 |
| Replies: 18 Views: 606 You can start with Reading Text From A URL (http://www.exampledepot.com/egs/java.net/ReadFromURL.html) and Regular Expressions (http://java.sun.com/docs/books/tutorial/essential/regex/). |
Forum: Java Nov 4th, 2009 |
| Replies: 18 Views: 527 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... |
Forum: Java Nov 4th, 2009 |
| Replies: 5 Views: 247 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.... |
Forum: Java Oct 30th, 2009 |
| Replies: 7 Views: 368 Here is a "bare bones" mockup of how such an event model can be implemented. I've retained your names so it might be a little clearer
import java.util.ArrayList;
import java.util.List;
public... |
Forum: Java Oct 30th, 2009 |
| Replies: 7 Views: 368 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... |
Forum: Java Oct 29th, 2009 |
| Replies: 20 Views: 527 Keep the point2 assignment and a repaint() in mouseDragged(). Leave mouseReleased() as you have it, but also set point2 to null. Then alter your paintComponent() method to draw a line from point1 to... |
Forum: Java Oct 28th, 2009 |
| Replies: 10 Views: 288 Well, evidently you it's something that you cannot do because you are here asking how to do it. I'd say you lost the bet. |
Forum: Java Oct 27th, 2009 |
| Replies: 4 Views: 422 There are existing wrapper classes for all of the primitive types.
Use Integer. Auto-boxing will handle the casting for you. |
Forum: Java Oct 27th, 2009 |
| Replies: 4 Views: 319 I think you're talking about a combo box: http://java.sun.com/docs/books/tutorial/uiswing/components/combobox.html |
Forum: Java Oct 22nd, 2009 |
| Replies: 5 Views: 254 If you mean task instead of target, yes there is.
Read the documentation (http://ant.apache.org/manual/index.html). |
Forum: Java Oct 13th, 2009 |
| Replies: 2 Views: 239 You may just be missing a call to setVisible(). |
Forum: Java Oct 12th, 2009 |
| Replies: 15 Views: 3,909 Asking of coherent question in new thread. |
Forum: Java Oct 5th, 2009 |
| Replies: 3 Views: 352 The super.paintComponent() 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... |
Forum: Java Oct 5th, 2009 |
| Replies: 9 Views: 468 You declare it as an array of CD objects, like soCD[] cdList = new CD[10]; and create them in the array like socdList[0]=new CD("Kaiser "," up the khazi ", 9.99); |
Forum: Java Oct 5th, 2009 |
| Replies: 1 Views: 211 Start with the information in the Read Me: Starting Java thread stickied at the top of the forum. That is exactly why it was put together. |
Forum: Java Oct 2nd, 2009 |
| Replies: 20 Views: 1,807 You could use something like this in your MapPanel to manage the "spots"import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.*;
public... |
Forum: Java Oct 2nd, 2009 |
| Replies: 20 Views: 1,807 Positioning with no layout manager:
http://java.sun.com/docs/books/tutorial/uiswing/layout/none.html |
Forum: Java Sep 30th, 2009 |
| Replies: 3 Views: 277 It's telling you that you can't use constructors that don't exist. |
Forum: Java Sep 29th, 2009 |
| Replies: 3 Views: 255 Just copy everything from lines 3-10 into your method and change the variables to use your method parameters. |
Forum: Java Sep 28th, 2009 |
| Replies: 2 Views: 203 |
Forum: Java Sep 8th, 2009 |
| Replies: 3 Views: 841 Also note that it's a compiler warning, not an error. You can still run the program just fine. |
Forum: Java Aug 26th, 2009 |
| Replies: 10 Views: 495 You might consider:
a) Sticking with the thread that you already started for this:
http://www.daniweb.com/forums/thread212868.html
You didn't bother to inquire further about anything mentioned in... |