masijade 1,351 Industrious Poster Team Colleague Featured Poster

Bind a ServerSocket. If it fails to bind then abort the startup. Since a ServerSocket can be bound only once, only single instsances of the program will be able to run.

And before you ask, no. Just because you bind a ServerSocket, does not mean you are open to network traffic. That only comes into effect once the program starts "listening" to the port with accept().

~s.o.s~ commented: Nice. +24
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Yes place the push/unshift @INC in a BEGIN block, or change use MyModule to require MyModule.

The keyword use forces inclusion of the module at compile time, so modifications of the @INC list (AFAIK) has no effect for a use, but a require doesn't include the module until "runtime", or when it is actually needed, so modifications of @INC will be heeded.

Since a BEGIN block is the first thing compiled, use should be able to use a modified @INC list that is modified in a BEGIN block, but it won't (AFAIK) be able to use a modified @INC that is modified outside of a BEGIN block.

Edit: Unless of course that use is wrapped in an eval statement. Then you can use an @INC list that is modified outside of a BEGIN block as well.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Because, by having layers using defined interfaces between them, allows you to completely change the way a specific part of the program works without affecting the others.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Javascript. most likely. Ask on the JavaScript Forum.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Very good. It has been awhile since a new poster here has been willing to work through his own problem. Good Job.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

And you got it in the first post.

iamthwee commented: too right! +11
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Is the database running? Is it running on port 3306? Is there a firewall active blocking the port? Are you attempting to connect to the right host? Are you attempting to connect to 3306? Are you using the correct tablename in the connection url? Is the username and password correct? Is MySQL configured to allow that user, with that password, to connect from where the user is attempting to connect from?

I think that pretty much covers the possibilites.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Look at the Process class and its exitValue() method.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You still haven't provided your code, so we can still only guess. If you are doing things in the "standard" constructor, it should work, but I wouldn't count on it. If you have any other constrcutor, then forget it, as it will never be called. For the most part, however, instance/class variables in a Servlet are usually not a good thing. Most people just starting use them wrongly and have from very serious side effects from it.

As I said, provide your code.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Do your own homework. You have a month, do it. God, asking for someone to do your work for you, then saying, in the same breath no less, that you want to master the language. Well, buddy, those two statements just do not go together.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Look at the different Focus and FocusListener classes. I haven't done something like this, myself, yet, but I would assume that you will finds the info there.

Specifically (now that I look at it):
http://java.sun.com/j2se/1.5.0/docs/api/java/awt/FocusTraversalPolicy.html

Ezzaral commented: Helpful info +2
masijade 1,351 Industrious Poster Team Colleague Featured Poster

He mentions netbeans because he was probably hoping to get an answer that told him what three or four mouse clicks he had to make in netbeans to get netbeans to generate the code. (Not that this either is, or is not, possible.)

masijade 1,351 Industrious Poster Team Colleague Featured Poster

hi:
you can do that like that is
package com.structure;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class TestArray {
static List<String> list = new ArrayList<String>();
// static Object[] state;
public static void main(String agrs[]) {
Scanner scan = new Scanner(System.in);
System.out.println("Please input number:");
int num = scan.nextInt();
System.out.println("Please input your String:");
for (int i = 0; i < num; i++) {
list.add((String) scan.next());
}
for (Object str : exchangeArray(list)) {
System.out.println(str);
}
}
public static Object[] exchangeArray(List list) {
return list.toArray();
}
}

He could do it something like, but then the question is, Why would he, when he as already been shown two better, and easier to use, solutions.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Although (at least according to the "normal" rules for class extension) it will compile just fine without overriding any of them (AFAIK, I haven't actually tried it), it just wouldn't do anything other than return the http error message that the requested http service/method is not supported/implemented.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

What exactly are you trying to do, and what error messages / unwanted effects are you getting / seeing?

The code in question would help, alot.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

That's what these forums are for, so ask your question.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Also, at least as far as apache is concerned, there is no reason why the Web Server can't have business logic. I know someone who has written an entire web site (not page) (and a complex one at that) as an Apache module. Very fast, but I, myself, would not want to be the one that had to maintain it (although there was flexible content).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

AFAIK this used to be the case, now-a-days webServ itself takes care of both these tasks.

No. Tomcat is a ServletContainer that is able to perform most of the tasks of a web server.

Apache is a Web Server, but has 0 JSP/Servlet capability (it has its own ASPs, but that is something else entirely).

The above are just two examples to show the difference between a Servlet Container and a Web Server. S.O.S's order list is correct.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You're Welcome.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Yes it is. Instead of simply pushing on the blue (right pointing) triangle, click next to it to get the pull down, and select something like "configuration" and play around in there a while.

You would be better off, however, since you are learning, programming with a simple, highlight capable, editor and the compiling on the command line, rather than using an IDE.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Try adding a call to validate() or repaint() after you have added all components. Since you are using Null Layout, the mechanisms for notifying the container to redraw itself may not behave in an expected manner. When you mouse over something, the window redraws the portion behind the mouse cursor, so this is probably what is causing the buttons to become visible.

As I mentioned in the last sentence of my post (as well). ;-)

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Yes I have, but I didn't get the correct answer yet.
<deleted - keep it clean>.

Well, this is guanrteed to get you answers.

Continue in the other thread. If you don't like the answers there, then say that in the thread and ask for other possibilities, don't just simply start another thread, it's rude. But then again, I get the idea (from this post alone) that rude is your normal state of affairs. Welcome to the ignore list.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Using a NullLayout is not Platform independent as the varying underlying graphics systems display things differently, so the bounds are not always (and usually are not) the same and so your layout will not always work.

As far as the buttons showing up under the image, remove everything from the panel before displaying the image, then after displaying the image, remove it and redisplay/redraw the original item.

You may wish to create one JPanel with everything needed for the game/whatever and one Panel for the Image, then you can swap the JPanels.

If you do not wish to do this (or find it to hard), Google Java SplashScreen to find out how make on of those, and use that to display the image.


And, BTW, you do not have to use "pixel" locations. The GridBagLayout, once you understand it, is a very powerful layout manager where you can lay things out exactly how you want them with creative use of anchors, widths, heights, fills, and weights that is completely platform independent, without having to try and fiddle with pixel sizes and bounds.

As far as the buttons not immediately displaying, try moving the setVisible(true) to the end of the constructor and adding a validate() and/or pack() right before it.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

They are called CustomRenderers. And, both of them are covered in the JTable Tutorial

http://java.sun.com/docs/books/tutorial/uiswing/components/table.html

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Because the Tomcat/Jakarta projects are a part of the Apache Foundation, but the Tomcat Server is not the same thing as the Apache Web Server.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

How To Store Image In Oracle

Use a BLOB.

And Fetch Using Jsp Java Beans.

Use JDBC.

Ask a general question, get a general answer.

Try and start coding something (search for and read some tutorials and definately read the API for the involved classes), then when you are stuck, and have a specific question, then please, come back and ask.

peter_budo commented: How true..."Ask a general question, get a general answer." +6
masijade 1,351 Industrious Poster Team Colleague Featured Poster

mod_jk is not part of Tomcat, per se. It is an apache module which allows apache to communicate with tomcat using a "special" protocol, thereby allowing apache to serve as a front end web server for tomcat.

Therefore, that file will be found wherever apache stores its modules.

masijade 1,351 Industrious Poster Team Colleague Featured Poster
awk '{print $1 "-" $2 "-" $3}'
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Download a newer version of Java and use its plug-in ?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

First of all, What thing in bold?

Second of all, why did you start a new thread?

Rather than sticking with http://www.daniweb.com/forums/thread81344.html ?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

What the prvious poster was saying is, post the method you are using, as well as the code where you get the string from the user, and where you then call the method involved.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Your trying to access/use something that has not been defined/initialised yet. The full error message, and highlighting of the line referenced in the error message would help.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I'm sorry, but start your own thread, don't hijack someone else's.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

i didnt vote so not my problem

Um, no I didnt vote because the election was when I was 6?

Then you are learning the wrong attitude far too early.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

i didnt vote so not my problem

This is way too late, but, if you didn't vote, then it is your porblem, and actually, you are part of the problem. If you don't vote, you also have no right to complain. Write in your own candidate if you have to (not sure if you can do this in in the UK), if you don't agree with any of the parties' candidates.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I will bet that currently, you have a JRE_HOME defined in your Tomcat configuration, but not a JAVA_HOME. Define JAVA_HOME in your Tomcat configuration and the problem should go away.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I assume this is coming after some other command, right? Such as cat somefile .

So, what the following pipeline command does

cat somefile | grep "^[a-zA-Z]"

is return all lines that start with a letter, whether capital or not. Effectivly filtering out all lines that do not.

That is, as long as it is double quotes ( " ) that are used. I believe that if it is single quotes ( ' ) are used, that it will only return those lines that contain (anywhere in the line) exactly those characters. I do not have a *nix system at hand, currently, to check that again though, and it has been a while since I have been able to work extensivly on an *nix system.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

What is the "input" object.

It appears as though you have forgotten to declare, define, and initialize it. (I assume it is suppossed to be a Scanner or something like that).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Welcome

masijade 1,351 Industrious Poster Team Colleague Featured Poster

...

masijade 1,351 Industrious Poster Team Colleague Featured Poster
man rm

-r is recursive (including the directories)
-f force (don't ask)
-i interactive (ask before deleting)

Chances are, somewhere in the profile, whether in your shell or in /etc/profile is an alias that changes rm to rm -i.

masijade 1,351 Industrious Poster Team Colleague Featured Poster
Alarm a = new Alarm();
Thread t = new Thread(a);
t.start();

Alarm implements runnable, that means it must define a method run, but it is not, in itself a Thread object. The method start is a method of Thread. You create a new Thread with your Alarm object by creating an instance of Thread including in the "new" call an instance of your Alarm class (i.e. a Runnable object). Then you call start on the thread, which in turn, executes your run method.

If you want to be able to call a.start(), then you need to make Alarm extend Thread rather than implement Runnable.

I think you need to reread the Thread tutorials.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

For Audio check out the AudioInputStream class and its getAudioInputStream(File) and getClip() methods, and Clip's open(AudioInputStream) and play()/loop() methods.

For an Image see the read(File) method of ImageIO.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Try using System.getProperty("user.dir") or System.getProperty("home.dir") if you want the current directory or if you want the directory where that class file also resides, then try getClass().getClassLoader().findResource("danger.jpg") Read the API for System and ClassLoader for a more detailed description.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Read up on JDBC, first (the Sun tutorials are enough).

Then download, read the documentation for, and experiment with, either POI or JExcel.

Then, combine the lessons learned from the two above points.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I'm sorry, but, you are not a member of the Politeness Police here. Nothing I said was rude. It was not especially polite, but it was not rude. They were simple directions and statements of fact.

I am not here to be polite (although I am not deliberately rude unless the poster has demonstrated his/her own disregard for others). I am here, to at least attempt, to help people, but I do not always have the time to be ultra polite or overly explanatory in my posts, so you get something like my post above.

I have nothing to be ashamed of in that post, as I did nothing wrong, and I provided him with advice that he needed.

masijade 1,351 Industrious Poster Team Colleague Featured Poster
total += 1000;

Assuming total is the variable.

masijade 1,351 Industrious Poster Team Colleague Featured Poster
javac *.java
// or
javac `find . -name \*.java`
// then
java TheClassWithAMainMethod
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Read the API for one of the Timer Classes. The one you want is probably javax.swing.Timer.

masijade 1,351 Industrious Poster Team Colleague Featured Poster