Avenged Sevenfold :)
Another good band.
Actually listening to them right now on Slacker Radio - "Almost Easy".
Avenged Sevenfold :)
Another good band.
Actually listening to them right now on Slacker Radio - "Almost Easy".
Listening to some Killswitch Engage this afternoon.
Try these:
http://java.sun.com/developer/onlineTraining/JavaIntro/exercises.html
(which was the fourth result of a Google search on "simple java exercises" - think about that)
Well, those look like XML tags, so an XML parser is one possibility.
The regex package is another. http://java.sun.com/docs/books/tutorial/essential/regex/index.html
If the text is simple enough, the methods on the String class itself, such as indexOf(), will probably suffice.
And did your friend also let you know that help is only offered to those who demonstrate some effort, as stated in the community rules and many announcement threads scattered throughout the forums?
Post what you have so far or at least some specific questions related to the areas that you are struggling with. "Tell me how to do this" doesn't really indicate much effort or thought on your part.
Just to provide a little more explanation why that works and why you had the previous difficulties, you were executing your animation loop code that slept and called repaint() on the event dispatch thread - which is the same thread that is responsible for processing those repaint() calls you were sending. By moving the animation code to it's own thread, you free up the event dispatch thread to respond to the repaints() that you are requesting.
You can read more about concurrency concerns in Swing here if you like: http://java.sun.com/docs/books/tutorial/uiswing/concurrency/index.html
Which do you think you should choose? Why do you think so?
Have you been paying attention in class at all? If so, you should be able to formulate some more specific questions to ask here.
Maybe you can get somewhere with this: http://java.sun.com/developer/technicalArticles/J2SE/Desktop/jdic_assoc/
Those are things determined by the OS. Windows display the icon of the file type association. Altering any of those would require Windows-specific code to alter the registry for that association. Java itself does not get involved with those things.
I guess the key part is:
as all know it can
You just posted something that is common knowledge as an excuse to get in more link spam to your site.
You're welcome.
You may want to take a look at this as well: http://www.daniweb.com/forums/announcement30-32.html
But your post still offered nothing of value at all and just a spam link to your hosting site.
Here is the main problem
public void dieTest(){
Constructors don't specify a return type. What you wrote there is a method, not a constructor. Drop the "void" and you're good to go.
You only need to return a single value from that method: the value the user selected from the menu.
Ok, some hints.
1) In your constructor, don't re-declare "storage", just initialize it. You have already declared it at the class level.
2) In your addCircle method, you want to add that new Circle object to your storage list, so look at the methods on ArrayList for adding things.
3) In drawCircles, you need to draw each Circle that you put in the list. Look at your notes on how to iterate the list. For each Circle in the iteration you need to call the methods to draw it.
Take a look at the list of properties that are always available through System.getProperties(). OS is one of them.
You can also dump a list of all of them to sysout easily with the following code
System.getProperties().list(System.out);
You don't need JUnit at this point, you just need to place some debugging println statements throughout your methods so you can see what is going on inside them (if you don't have or know how to use an IDE debugger).
Trying to learn how to use JUnit is not going to speed up solving this problem at all - it's just going to add a lot of unnecessary confusion.
System.getProperty("user.home")
will give you the users home directory.
masijade means that the TextField variables themselves might be null, as in you have not initialized them with "new TextField()". He wasn't referring to them being empty.
The code you posted above doesn't really answer that question, because you didn't post the addField() method code.
Ok, two things:
1) Load the Image through an ImageIcon
img = new ImageIcon("gifTest2.gif").getImage() ;
ImageIO.read() returns a BufferedImage, which doesn't update the ImageObserver. I couldn't tell you the exact reason why because I don't really mess with images much, but perhaps an animated gif needs a VolatileImage instead of the BufferedImage the read methods gives you.
2) Make sure your signature matches when you override a method. Instead of imageUpdated(), you need
public boolean imageUpdate(Image img, int infoflags, int x, int y, int w, int h) {
repaint();
return true;
}
That's why you're taking the class and doing homework. Post what you have so far and specific questions.
Do you see any variable named "A" declared in your main() method?
Drop the [] from "A[]" in this portion array_sum(A[],first,last-1)
, you only need those in the declaration, not when using the variable. The array itself is merely "A".
So use String.valueOf(int).
Maybe his professor will give you credit for it.
devonte15, what is the professor's email address, so Vernon can turn in the assignment?
600
You need to add the scroll pane to your container instead of the text area. Change this
container.add(textArea);
to this
container.add(sp);
It really just depends on where and how that class is used. For a tiny private data struct? I'd leave em public. For something that will be used by others, probably best to add accessors.
You can read Josh Bloch's thoughts on the matter here if you're inclined: http://books.google.com/books?id=ka2VUBqHiWkC&pg=PA71&lpg=PA71&dq=java+public+fields+on+small+data+classes+bloch&source=bl&ots=yXFkJkt1OX&sig=PzH5Fo9XfOcs4P2AZScOHjji-bw
Do not hijack old threads. Post your questions in a new thread.
Drop the "IM speak" as well. This is not a chat room nor an IM service. If you are too lazy to type properly, don't expect others to spend much time trying to help you.
Putting in a SeatingSection class probably is more complex than the OP needs for this assignment. I just threw that in as a consideration to get them thinking a bit. I think all they really need is a single collection, List or array, of Seats.
A more generalized Theater class design would have either a single collection of seats with the section, price, etc being properties of the seats, or another intermediate collection class to represent seating sections that contained their own collections of seats.
Theaters do not all share common layouts or number of seats, so hard-coding in three arrays for seats ties your implementation to a theater that had three distinct sections of seats with different properties.
It means the code attempted to access the ninth element of an array that does not have nine elements. Your stack trace would also tell you what line that occurred on. It's probably on one of the lines in readFile() where the data is being put into the arrays after the split().
"\u00a3" is the British pound symbol in unicode, so that output actually is what he stated he wanted: £3.99p
Most likely his own locale settings would place the local currency symbol in many formats though without having to put in the unicode for that particular symbol.
Yeah, that is the same thing. The formatting is just inlined with the printf().
This would do it
int total = 399;
System.out.printf("\u00a3%1$d.%2$dp%n", total/100, total%100);
590
Have you designed classes to represent those Swing controls? Have you read the Sun tutorial on drag and drop yet?
I'm sick of these rules blah blah...
Another problem is that different BBSs have different sets of rules blah blah
Well, yes, distinct cultures have their own varying ideas on what is and is not acceptable interaction. Not really a new thing - ask any sociologist. Get over it or find a culture that doesn't make you "sick".
@notuserfriendly: What you posted really has nothing to do with OOP. And the purpose of OOP is to manage organizational and behavioral complexity in code design - not "learning easier". You may want to do a bit more reading on the subject:
http://en.wikipedia.org/wiki/Object-oriented_programming
You can't place this line
passGet.setEchoChar('*');
in the class body directly. It must be within a method.
Well, assuming that you have imported the TextArea class, those two lines compile just fine in my IDE.
You would want the line numbers to be a separate component along the side of the page, not part of the text in your JTextArea.
Only if you start a new thread for your request and demonstrate that you have made some effort on your own.
You've probably missed a type designation on a variable or parameter somewhere above that code then, because there is nothing wrong with those two lines. Which line specifically is indicated as the cause?
You just need to terminate the line of output after each row with System.out.println();
.
Most likely because the formula you implemented to determine "match all digits" doesn't do that at all. Those are rather odd relationships that you are expecting between the division and mod results. You need to break the numbers into their components before you make the comparison checks.
You should probably explain what it is doing wrong, what you expect it to do, and any errors you receive, rather than expecting people here to pick through it and play "find the problem with this".
This uses the JDOM packages.
org.jdom.input.SAXBuilder builder = new org.jdom.input.SAXBuilder();
Document doc = builder.build(new File("test.xml"));
XPath xp = XPath.newInstance("table[tr/td/b/font='Nohup Files']");
List<Element> result = xp.selectNodes(doc.getRootElement());
XMLOutputter out = new XMLOutputter();
for(Element e: result){
System.out.println(out.outputString(e));
}
<html>Name1<br>
Grade1<br>
Name2<br>
Grade2</html>