Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Besides, in my opinion, it is up to the software engineers to make their products safe from piracy. If their product is pirated, then it is their own fault for not making it secure enough.

Ah, so if the shop door is not locked and all windows barred, you are not doing any wrong if you rob the place blind? Nice outlook you have there. Do you beat up old ladies as well, if they make no attempt to defend themselves?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

As I've indicated twice now, you need to post the code here and specific questions about what you are having trouble with. "Having trouble with case menu" isn't all that specific. What piece do you not understand about it?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Try to narrow the relevant code section if it is overly large or provide a skeletal portion of it as needed and post it here. Questions should generally be kept on the forums so that all can participate or view the suggestions offered. Personally I never provide code help via PM.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Post the code that you have and what problems you are encountering. Please put [ code] tags around any code you post.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Couldn't really say on that one. You'll just have to test it and tweak if needed. A lot of factors go into FPS besides just the resolution because most apps are doing more than simply blitting an image to the screen each cycle of the animation loop.

To keep painting as lean and responsive as possible, try to keep everything that does not directly relate to rendering out of your paintComponent() code. The paint methods can be called by many other things other than your loop, so put code that updates things or performs calculation in another method if possible and just keep the minimum about of code needed to redender the component in the paintComponent() method itself.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

>When you steal software you are violation federal and international copyright laws.

Am I supposed to care? If there's no penalty, why not?

There are penalties, you have just been lucky enough not to incur them - yet.

>Then you are a fool.

I'm a fool for actually formulated my own opinions instead of being baby fed by the government?

Your opinions on the law matter very little in its enforcement.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Sad... truly sad...

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

If you need to supply arguments when you run the program you'll need to specify them in the "Run" section of the Project Properties. Right-click the project node and choose "Properties" to access them or you can also view them from the File menu.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

H2 and McKoi are also freely available embedded database options.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Add your key bindings to the JFrame itself like so

JRootPane root = frame.getRootPane();
root.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
  KeyStroke.getKeyStroke(KeyEvent.VK_UP,0),"UpAction");

root.getActionMap().put("UpAction",new AbstractAction(){
    public void actionPerformed(java.awt.event.ActionEvent e){
        upAction();
    }
});
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

And I already told you to use IzPack or something like it if you need to create an installer - which will do exactly what you are asking for.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You are getting the error because on line 69 you are adding "imagePan" to the frame but you have not initialized imagePan yet.

Also, on line 89, you don't need to create a new ImagePanel. Just call imagePanel.loadImage(File) to load a new image in the panel.

If you need ImagePanel to remain blank until the button is pressed, take the code that loads the image out of the ImagePanel constructor.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

If you just override paintComponent() for the JPanel, you shouldn't have any problem.

new JPanel(){
  public void paintComponent(Graphics g){
    paintPanel(g);
  }
};
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Your explanation isn't very clear. Which component do you want to customize the drawing code for? Are you wanting to custom paint the background on the panel, yet not affect the text field?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Ah, okay, got it. No, there isn't a straight-forward way to make transparent frames like that. The following article discusses a way to hack that effect though through use of screen shots:
http://www.onjava.com/pub/a/onjava/excerpt/swinghks_hack41/index.html

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

hi
please give me wumpus parogram

Bye.
Find your own "wumpus parogram".

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Where? All I see is a semi-accurate assessment of the situation.

Same. You might want to throw socialism in there too.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I don't really understand what you mean with the first question.

As far as animation timing, take a look at this article: http://www.developer.com/java/article.php/893471

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

JInput can be used for other input devices: https://jinput.dev.java.net/

This article discusses using it for a gamepad: http://fivedots.coe.psu.ac.th/~ad/jg2/ch11/index.html

darkagn commented: great links! +1
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Consider also that you don't really need to pop up separate windows for each question. You just need to change the text and the choices. You could easily do that within a single panel.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Applets are typically only used for small programs embedded in web-pages. If you are developing a regular desktop Java app then you would use JFrames and JPanel sub-components. The individual screens that you describe could be either one, depending upon how many top-level windows you wish to have.

JPanels are not standalone top-level windows, but can be placed in any other container component, such as JFrame, JSplitPane, JScrollPane, JTabbedPane, etc. By developing smaller classes that extend JPanel, you can easily create "sub-forms" that can be placed into containers in any manner you chose.

This tutorial covers a lot of these things in detail:
http://java.sun.com/docs/books/tutorial/uiswing/index.html

Most everything that you have coded so far can probably be moved to a JPanel with only minimal effort. Anything in init() can probably be done in the constructor. Code in start() may be okay in the constructor or perhaps a public method, depending upon what that code is doing.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Why on earth are you putting an Applet in a JFrame?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Well, it's fairly simple if you think about it. Your array indexes run from 0 to n-1, where n is the number of entries. If you read the API doc for the Random.nextInt(int) method, you should see how it would be easy to randomly select an index from that String array.

Edit: Ok, this post is now a bit out of order after your edit.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You can keep it in the Fortune class. I was suggesting a plain String[] array, not ArrayList though. Since you have a fixed number of hard-coded phrases, you really don't need an ArrayList.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Place the responses in a String[] array. Select a random index within that array with a Random.nextInt() call.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Use something like IzPack (http://izpack.org/) to create an installer can install the JRE if necessary.

There is just NO valid reason to think you absolutely have to create an exe for a Java app. You are much better off with an executable jar file.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You'll just need to pass a File instance (i.e. loadImage(new File("someFile.jpg")) instead of the string path or you can alter the loadImage() method to take a string path instead if you prefer it. It was a mistake in the method parameter on my part.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Yeah, Planet Earth was really impressive.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Yule has a nice ring to it. Actually, that Santa Claus thing is based on paganism too, so you don't have to be too apologetic..

I don't think he was being apologetic, nor should he need be at all :P

Merry Christmas all, from a resident atheist :icon_biggrin:

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Watch less TV in an effort to raise my IQ.

What about just watching programs on The Discovery Channel, The History Channel, National Geographic, etc? :)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Not from the ChangeEvent supplied by columnMarginChanged() unfortunately. In most case, the resize affects more than one column at the same time, so it's up to you to handle a particular column on your own. I fiddled with a few things but didn't come up with a clean way of avoiding that circular cascade in the resizing and still have it resize to fill the pane after they are done trying to make it smaller. That's to be expected though since they are actually fighting against the listeners with the mouse to drag it smaller and the code is just trying to respond the way you want it to.

This change

if (diffWidth > 0) {
    int newWidth = tc.getWidth() + diffWidth - 3;
    tc.setPreferredWidth(newWidth);
    tc.setMinWidth(newWidth);
}

does prevent them from making it too small to fill the pane, but if the min size gets larger from a panel resize, it can't be set back to a smaller size later. It becomes a one way street in that respect.

A relevant question might be though, if the user intentionally makes that column narrower and it doesn't fill the pane, should you care enough to prevent it?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Offering continual smackdowns of anyone showing even the slightest modicum of faith and/or religious beliefs, regardless of how and/or if it affects the person giving the smackdown. Would this not qualify?

I suppose it could, yes. I was thinking of public in terms of out on the street or in a mall or some such. I have seen some who preach their religion in such venues, but I haven't run across atheists doing so and therefore wondered what behavior was under consideration.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I'm not certain exactly how one would "do atheism" in public. Have you ever seen anything that would qualify? I can't say that I have really, so that one is a bit confusing.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Try this

Component c = evt.getComponent();
int viewWidth = c.getWidth();
int tableWidth = libraryTable.getWidth();
int diffWidth = viewWidth - tableWidth;

if (diffWidth > 0) {
    TableColumn tc = libraryTable.getColumnModel().getColumn(libraryTable.getColumnCount()-1);
    tc.setPreferredWidth(tc.getWidth() + diffWidth - 3);
}

The magic number 3 is just there to keep it from being just a tiny bit wider than the internal display area and forcing an unnecessary scroll bar (I didn't spend the time to find out which component width was causing it - probably just a border or inset on one of them).

That does still allow them to manually make the last column narrower than the scroll pane. If you really want to avoid that you would need to call this when a column is resized as well.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

No, sorry, it won't. I should have checked it before suggesting.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You can use a Timer for the polling. You will need to detect changes on your own.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Have you tried setAutoResizeMode(int) using AUTO_RESIZE_LAST_COLUMN ?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Does it do any "good"; and which of us gets to define good? Is it "appropriate"? Others ask, is it "justified"? Right? Acceptable? And not one of these questions has an objectively demonstrable correct answer. Which SHOULD mean, you do it your way, I'll do it mine, and the gov't. should stick to protecting children from genuine malice and harm (of more than their "feelings"); but NOT punishment.

"Should kids be spanked?" is an academic, philosophical question.
"Should parents be ALLOWED to spank?" goes directly to our social contract; and the question that actually needs to be answered.

I agree with this. My post regarding government establishing law guided by religious principal was a direct response to Midi's assertion that the government can't make any laws about it. I feel that itself is a silly assertion and has no basis in fact. That post has nothing to do with my position as to whether the government should make any laws on the matter.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Because both are religious beliefs, neither may be made part of the law without violating the First Amendment.

It also could be considered assault if they did wish to make it illegal. Killing is against the law and is also prohibited by the ten commandments. I don't think anyone ever challenged that on the basis of separation of church and state.

Assuming anything that is mentioned in any religion is off limits to legislate is just myopic. Whether you can admit it or not, morality and ethics are still applicable outside the bounds of religion.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

He seems like he's screaming stuff I can't understand into the mic.

He is - the singer just mangles it. Very sad :(

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

While I wouldn't call it a "classic", the song they are covering is classic Metallica and a great one. Dream Theater, the band covering it, did a pretty decent job on the music, but the singer was just hideous. It's obviously just not his vocal range or style and make the song just unbearable to listen to.

Dream Theater does have some cool songs though from years gone by. Check out "Pull Me Under" from the little video menu at the bottom of the player if you want to hear one of their better ones. They have an eclectic style, but some very good musical talent in the group. I haven't heard any of their recent stuff though - just a few albums from the late 80s - early 90s.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I've never used the J3D api myself, but this tutorial on mouse picking mentions having to enable pick reporting on an object in your scene:
http://java.sun.com/developer/onlineTraining/java3d/j3d_tutorial_ch4.pdf

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

It's getting closer, but it looks like you are still a little bit confused on using methods and classes. I think it we rename a few things it will clarify their intent.

Class names are usually nouns, because they represent "things". Let's rename the DrawImage class to ImagePanel, because that is what it actually is: a panel that shows an image. DrawImage sounds a bit like a method that would draw an image and is a little misleading.

Method names should be verbs, because they represent actions you wish to take. Methods "do "stuff", so we name them to clearly indicate what they do. So let's rename the imageLoader() method to loadImage() or perhaps getImage(). It's now clear that we are performing an action to load an image when we call that method. Let's also move the method into the ImagePanel class since that is the "thing" that really needs to load an image. The PhoneInterface doesn't need to load an image itself and shouldn't have to worry about what the image panel needs to do for itself. That's why we create separate classes in the first place: to group together specific pieces of functionality with clearly defined roles and responsibilities. One class should keep out of other classes' business as much as possible.

So now we have an ImagePanel that has a method to load an image from a file. The ImagePanel has a variable to hold that image so it can paint it whenever it …

darkagn commented: Great explanation of methods and classes, Ezz +1
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Are you going to take Josh's place as grammar police? Fine. Just be aware that I don't like that dude, and will probably take it out on you.

I believe Josh is the Posting Relevance Police, which may leave an opening in Grammar police, but really I don't have the time to fulfill it to the necessary extent.

I do really hate "text speak" or "leet speak" though.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Thanks heavens, I have never dreamed about the economy or politics. However, I have had dreams about overflowing toilets.

They are very similar actually.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Who is this "Ur" you speak of? A caveman?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I think I fell asleep during Rush Limbaugh, and absorbed some of the schpiel.

Fixed that for you.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

- I am building huge databases about really stupid stuff (e.g. the number of tacos eaten daily in each state) in Access.

Well, building a huge database for anything in Access does equate to "stupid stuff", so that one should be no surprise.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I agree that neither should be legislated. However, religious belief is only ONE motivation. To say it is THE motivation is simplistic and false.
Unless, of course, atheist have absolutely no opinion on the subject.
Any atheists flipping through the channels?

I'm an atheist and do not believe feelings on the effectiveness or appropriateness of corporal punishment have the least to do with religion. Many religions may have proscriptions regarding discipline, but that does not relegate the entire matter to one of religious belief.