3,927 Posted Topics

Member Avatar for adun
Member Avatar for Hockeyfreak889

Here's another option as well, using ImageIcon and JLabel: [url]http://java.sun.com/docs/books/tutorial/uiswing/components/icon.html[/url]

Member Avatar for Hockeyfreak889
0
100
Member Avatar for k2k

Example method[code] private void showPanel(JPanel panel){ Container contentPane = getContentPane(); contentPane.removeAll(); contentPane.add(panel); pack(); }[/code]

Member Avatar for k2k
0
127
Member Avatar for GrimJack
Member Avatar for sneekula
0
141
Member Avatar for llemes4011

For some ideas, I would recommend looking into the [URL="http://en.wikipedia.org/wiki/A*_search_algorithm"]A* pathing algorithm[/URL].

Member Avatar for llemes4011
0
100
Member Avatar for BestJewSinceJC

The 'unsafe' part would be a chance that some portion of the components might still be in an inconsistent state that would produce errors or graphical "glitches" if a paint request happened to be processed. Essentially it's still "under construction" and may exhibit inconsistent behavior if accessed by another thread.

Member Avatar for BestJewSinceJC
0
103
Member Avatar for kakakon

You would find those things much easier with a DOM parser, if that is an option. Otherwise, you have to keep track of the overall structure yourself.

Member Avatar for Ezzaral
0
67
Member Avatar for britto
Member Avatar for darkagn
0
84
Member Avatar for jbennet

You can save yourself some typing if you want to list all of the properties available through System.getProperties()[code]System.getProperties().list(System.out);[/code]

Member Avatar for stephen84s
0
368
Member Avatar for Dani

One thing I noticed missing on the forum listing pages is the "Mark as read" function. Have I missed its new location or is that still "in progress" or is it gone for good?

Member Avatar for John A
1
139
Member Avatar for Skorpion

Start a thread on it if you wish to have such a discussion. Posting it on the tail end of someone else's thread on Bluetooth won't attract much participation.

Member Avatar for yogindernath
0
127
Member Avatar for Robtyketto

Correct. The drawing code needs to either be moved into the paint() method or called from it with a reference to the Graphics object. See comments in edited code: [CODE=java]package wk8exercise3; import java.applet.Applet; import java.awt.*; import java.awt.Graphics; import java.awt.event.*; /** * * @author Rob */ public class wk8Exercise3 extends Applet …

Member Avatar for Ezzaral
0
669
Member Avatar for beth2138

So just add them. I don't understand what part you are having trouble with [code]double total = weight[a][0] +weight[a][1] +weight[a][2];[/code]String concatenation has nothing at all to do with math operations on variables.

Member Avatar for VernonDozier
0
90
Member Avatar for neutralfox

Any help offered here is a completely voluntary effort. As such, your own attitude is going to determine the extent and nature of that help. The attitude demonstrated above is certainly not going to encourage much assistance in the future. Good luck with your efforts. (You should also know that …

Member Avatar for BestJewSinceJC
0
151
Member Avatar for younaskhanpk

Posting an email address still isn't going to get this code written for you.

Member Avatar for younaskhanpk
0
100
Member Avatar for samarthashok

This line [icode]location: interface org.w3c.dom.Node[/icode] would indicate it's returning a Node object but he's probably expecting an Element object.

Member Avatar for Ezzaral
0
110
Member Avatar for JavaKiddo

To be able to move, resize, and interact with an object, you'll need to create a class to represent it. It should keep track of things like its current bounds, "grabby points", color, etc. and be able to render itself to a supplied graphics object. Your painting canvas needs to …

Member Avatar for Ezzaral
1
123
Member Avatar for Banderasky
Member Avatar for xgmx

Oh, I doubt Dani wants to open the gates to hordes of pubescent leet gankers, pwning this and roflcoperting that and generally epeeing about the place.

Member Avatar for darkagn
0
106
Member Avatar for madeindadex305

You haven't given enough info to answer that. It depends upon how you have stored those objects and their data. The part about "choosing" the method is odd as well. edit: Okay, you added another post while I was typing. Why not take both height and width and compare both …

Member Avatar for Ezzaral
0
142
Member Avatar for denniskhor

You don't need to create an exe for that. Just package it in a jar file: [url]http://java.sun.com/docs/books/tutorial/deployment/jar/index.html[/url] Most Windows users already have a JVM installed, but if they don't it's a simple matter for them to install from the web.

Member Avatar for peter_budo
0
159
Member Avatar for lllllIllIlllI
Member Avatar for Intrade

It's kind of hard to say from a general standpoint, since it does depend on what you've coded after all, but keep in mind that repaintings of the top level container (Applet, JFrame, etc) are heavyweight AWT operations that use native code to redraw the top level window in the …

Member Avatar for Ezzaral
0
127
Member Avatar for JIMBO37167

>If my assignment is right let me know but I need someone to explain to me why it is right. Why? Are you completing them through [URL="http://en.wikipedia.org/wiki/Automatic_writing"]automatic writing[/URL] or [URL="http://en.wikipedia.org/wiki/Mediumship"]channeling[/URL] or something?

Member Avatar for thoughtcoder
0
113
Member Avatar for gyagyus

Are you trying to call that method on an object that extends JComponent? You can't just import JComponent and use that method.

Member Avatar for Ezzaral
0
85
Member Avatar for Dave Sinkula

[quote=joshSCH;394379]I would hardly call that evidence.. perhaps the smokers where you live are nice, but the ones here in texas are rude.. The evidence needs to be documented and places from all over the USA tested.. or else it isn't valid statistical data..[/quote] So you have performed statistical research on …

Member Avatar for jbennet
0
4K
Member Avatar for notetech

Anyone [I]can[/I] become a PHP programmer - or a Java programmer or a .Net programmer - it just takes effort and it's easier for some than others. PHP may have a slightly lower learning curve than some other languages but that does not make it trivial or a less useful …

Member Avatar for jbennet
0
90
Member Avatar for add4

The hosts file is just a text file: [url]http://vlaurie.com/computers2/Articles/hosts.htm[/url]

Member Avatar for Ezzaral
0
92
Member Avatar for jackiejoe

The table model is a bit much to digest for someone who is new to Java. If you are just trying to print the array contents into a text area, you can do something along the lines of this[code]String[][] stuff = { {"a","b","c"}, {"x","y","z"}, {"Bob","Mary","Steve"} }; StringBuilder output = new …

Member Avatar for javaAddict
0
2K
Member Avatar for doha786

And after you've managed the open/read operations mentioned above, read through this tutorial on regular expressions for the data extraction: [url]http://java.sun.com/docs/books/tutorial/essential/regex/index.html[/url]

Member Avatar for Ezzaral
0
198
Member Avatar for prashant1111

It really depends on what you need to respond to. You can use key bindings in Swing: [url]http://java.sun.com/docs/books/tutorial/uiswing/misc/keybinding.html[/url] or you can use a KeyListener: [url]http://java.sun.com/docs/books/tutorial/uiswing/events/keylistener.html[/url]

Member Avatar for BestJewSinceJC
0
76
Member Avatar for lllllIllIlllI

Try it with your code base one level higher, like this[code]<html> <applet code="Sorter" width="800" height="300" [B]CODEBASE="C:\Documents and Settings\Paul\My Documents\NetBeansProjects\Sort2\build\classes">[/B] </applet> </html>[/code]It looks like you had the package directory in the previous code base.

Member Avatar for lllllIllIlllI
0
365
Member Avatar for denniskhor

That certainly isn't the only logic problem. Why are you opening and reading the same files over and over for each portion of your split() result? I'll mention one last time: read up on HashMap.

Member Avatar for denniskhor
0
120
Member Avatar for denniskhor

Your description is a little bit difficult to understand, but I think you are saying the extra spaces are causing you trouble in the split() result? You can make it ignore those by altering your pattern to allow for one or more occurrences of those characters. Try this [icode]"[-.!? ,\n]+"[/icode] …

Member Avatar for denniskhor
0
99
Member Avatar for stewie griffin

You [URL="http://java.sun.com/docs/books/tutorial/essential/exceptions/throwing.html"]throw an exception[/URL].

Member Avatar for Ezzaral
0
171
Member Avatar for artemis_f

You're correct that you need to create a copy of that object before you alter it. Using '=' is setting the two variables to be references to the exact same object in memory, hence it reflects the changes. If your Matrix class doesn't implement the clone method then you will …

Member Avatar for artemis_f
0
117
Member Avatar for denniskhor
Member Avatar for YoungCoder

If you are really lucky, you can even get spam like this in your Private Messages right here, like I did :) [QUOTE=peee2007]Dear, I know that my message will come to you as a surprise since I don’t know you in person or meet with you before, but I am …

Member Avatar for chriswellings
0
708
Member Avatar for smithu.simi
Member Avatar for BestJewSinceJC
0
112
Member Avatar for Andrewsc1

It's as simple as incrementing by 2[code]for (int i=1; i<200; i+=2){ System.out.println(i); }[/code] The printf documentation isn't the easiest read in the world, but here is how you can limit to 3 decimal places[code]double d = 4444.3434545; System.out.printf("%.3f \t\t %.3f ", d, d*2.2);[/code]

Member Avatar for Andrewsc1
0
109
Member Avatar for Blue29

First, you start your own thread and pay attention to what you are typing so it actually makes sense (punctuation would be a bonus).

Member Avatar for Ezzaral
0
219
Member Avatar for speed101

>i'm prepared to leave either my email address or yours or a means of contact via the web ... Ok, leave my email address and I'll contact it.

Member Avatar for ithelp
0
111
Member Avatar for ZeRo 00

For future reference, the quickest way to [I]not[/I] get help is to put "URGENT" in a thread title.

Member Avatar for JamesCherrill
0
112
Member Avatar for NicAx64

Sneek, you're asking this of a guy who wants to trade in a female companion for an operating system for his computer based upon a fantastical list of requirements written by some moon-eyed pre-teen girl - you're expecting lot if you want coherence.

Member Avatar for nav33n
0
242
Member Avatar for farhan.foxtrot
Member Avatar for Ezzaral
0
99
Member Avatar for Narayan15
Member Avatar for Ezzaral
0
156
Member Avatar for mario.herbst

You can get that info from the MatchResult returned by the [URL="http://java.sun.com/javase/6/docs/api/java/util/Scanner.html#match()"]match()[/URL] method. It would probably be a lot easier to add a capturing group to your match pattern for the data you want to collect and extract it as part of the match result. More info on capturing groups …

Member Avatar for Ezzaral
0
100
Member Avatar for jackiejoe

Those are for the visual web designer do not apply to JTable. See this tutorial on using JTable: [url]http://java.sun.com/docs/books/tutorial/uiswing/components/table.html[/url]

Member Avatar for BestJewSinceJC
0
87
Member Avatar for Dio1080
Member Avatar for jhonny_86

If you're printing them through AWT, you'll probably need to use a Book for it. If you can get all of the content into a JTextComponent, it's printing API might make it a little easier: [url]http://java.sun.com/docs/books/tutorial/uiswing/misc/printtext.html[/url]

Member Avatar for Ezzaral
0
85

The End.