masijade 1,351 Industrious Poster Team Colleague Featured Poster

Use String's split method to get a String[] (which you can then use in the "enhanced" for loop) then use Integer.parse(String) to get the integer values for the switch.

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

It's called paging. Google "Java Paging".

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

Why!? Why!? Why!!? I say!

Why all "beginners" absolutely feel the need to do this is just beyond me. I would think it would be much easier to simply Google "How do I deploy/distribute my Java app" and find out the proper way to do it, rather than simply assuming that an "exe" is needed.

Not only does that lock you into one platform it locks you into one version. Any improvements (including security fixes) that come with newer versions of the JRE, are, of course, blissfully ignored.

masijade 1,351 Industrious Poster Team Colleague Featured Poster
rm `ls | egrep -v "(20110225104849|20110225104833|20110225104848)"`
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Fix your code indentation. It's no wonder I missed that while loop since I didn't bother looking at anything higher than the print statement that was on the same "level" as the print statement.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Is it "giving" "SUCCESS" or " SUCCESS" or "SUCCESS " or .... I think you get the idea. The only lines after the print that will result in an NPE are the s.equals..., and since s contained a value, seemingly, the line mesg = mesg.concat... is throwing the NPE. So, s does not match exactly "SUCCESS" or some code is missing. call "trim" on s in that equals call.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

JOptionPane for a "GUI", for console simply system.out.println and "nextline" on the (hopefully) already defined scanner (or readLine on the bufferedreader depending on which is being used).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

An easier, more efficient, and less obvious method is to re-initialize the stack:

public void Clear(){
	inputStack = new Stack<Character>();
}

That always sounds like a good idea, however, if this class instance is being used in multple threads, it could easily cause some very unpredictable behaviour. Just as a note of warning.

Edit: And it seems as though some people don't like to be reminded that RTFM is sometimes a good idea.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

No. The arguments are everything after the name of the main class on the command line. Everything after the name of the main class on the command line is turned into a string array with the first item being index 0 of course. If you don't have anything after the name of the main class on the command line then you don't have any command line arguments and index 0 of the args array won't exist. The thing you need to read the documentation of your IDE for is to be able to find out how to enter command line arguments when executing from that IDE.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

By typing it?

If you are using an IDE then read its documentation.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

That "8" in the above "example" is what command line arguments are. If "args[0]" is throwing an IndexOutOfBoundsException (which is the only "index of the array" problem that I know of), then you haven't provided any command line arguments.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Are you providing any arguments on the command line?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Use the full one always and if the domain part is the same simply don't show it. Or, if you wish, if the domain part is the same then use the other. That is the only simple solution. Better would be to actually check their addresses, not their names.

Edit: And, p.s., I said understand the subject, not just have a fleeting, surface, familiarity with it.

Edit Again: Their addresses in combination with their netmasks (all of them), of course, as that is what will tell you if they are really part of the same network(s). You do know what that means, right? That does not mean, however, that they either can or cannot reach each other without using the fqdn, the host table and local nis/dns servers is what will determine that.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Research some basic networking. If you are writing a program that deals with a subject, you need someone physically working with you that understands that subject, and it is best if that person is you.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Using a web service, as already mentioned.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

And think about whether you actually need all "95000 lines" in memeory at the same time. You would be better off reading a line, processing that line, reading the next line. Only rarely do you actually need all of the data in memory at the same time.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

hostname is "mycomp"
(fqdn) is "mycomp.my.internet.domain"

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Uhm, with clear() ? See the API docs, Stack does have a clear method.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

By using a website that allows it.

Your computer cannot just "magically" transmit bytes through the air without some sort of device to handle the signal. So, either you hook a handy up to your computer, or you find a web service that allows "free" sending of SMS and figure out how to access that service programmatically.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Is that the first question in the quiz?

No one here is going to write it for you. Explain, in greater detail, your current problem with it. If its that you "don't know where to start", as so many here like to say, then research what exactly such a thing does (without regard to any programming language) then start thinking about how to do those things, one thing at a time, in Java, then put it all together.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Seemingly your pwd is not what you think it is.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Do not use scriptlets in JSP.

Do not cobble together statements like that, use a PreparedStatement.

Use a Connection Pool.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

can u plz send me code to implement it

Well, where are you currently setting the mailhost? Do it there. If you are not setting the mailhost, then find a JavaMail tutorial (google will provide plenty) as you are not doing anything right in the first place.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Java doesn't have function pointers.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Do not use scriptlets in JSP, use, at the very least, a servlet.

Do not cobble together statements like that, use a PreparedStatement.

Use a Connection Pool (see the documentation for your web container).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

set that as the host name for the smtp host?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Like I said, you are still using the execute methods where you pass the sql as an argument

statement.executeUpdate(todo);

don't do that.

Edit: If I must spell it out, do

statement.executeUpdate();

and I hope that they are all char/varchar fields.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Not dificult to translate at all. every place where you have a "?" you need to use a "set" statement and then simply call executeUpdate or executeQuery. I really don't know what the problem with that is. It is still looking as though you are taking the one example given above and still haven't bothered to either look at the tutorial or the api docs. I gave you that information for you to use not for you to ignore. If you're not willing to do that I don't know that I am willing to help.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Because you are, seemingly, still using the execute methods that take the sql as an argument. Don't do that.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

probably has to do with instance variables (i.e. bad programming) in your servlets/jsps

masijade 1,351 Industrious Poster Team Colleague Featured Poster

here

go to JDBC, then to PreparedStatements

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Because peter made a mistake. You use prepareStatement not createStatement (then again, maybe he did it on purpose to see if you even bothered to look at the docs you've been pointed to).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Okay? So do it. You have to make sure that that method exists in the class though, of course.

P.S. Do Not cobble together statements unless you want sporadic SQL syntax errors and (un)intentional SQL injection attacks. See the JDBC Tutorials for PreparedStatement (and don't say you have, because you haven't or you wouldn't be doing that).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

No. I am not just typing in order to watch the letters assemble across the screen.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

jsp runs on the server, the browser runs on the client. You need network communication. AJAX (or write the necessary JavaScript yourself).

Edit: Of course, you can always just submit the form.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

AJAX

masijade 1,351 Industrious Poster Team Colleague Featured Poster

A subclass must call a constructor of the super class. If you, as the programmer, do not program a specific super call in the constructor of the subclass the compiler will automatically add a call to the default constructor of the super class. Unfortunately, when the super class defines a constructor, and does not define a default constructor, then the super class does not have a default constructor and you get exactly the error message you are seeing there. So, either define a constructor in the subclass and have it make a specific super call, or define a default constructor in the super class.

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

How do you mean, I don't understand what you are saying? Could you say it on a different manner so I know what you meant. I have to return the value of String filename. So getImage could read it. Thanks for your help :)

Greets

MeandJava

How far along are you suppossed to be in your class?

In any case, what difference do you see between

public ImageIcon(String filename){

and this

public Image getImage(String path){

The second one is correct, declaring both a return type and a name. The first one is missing one of those (seemingly the name).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

What return type should this method be or what should the method be "called"

public ImageIcon(String filename){

you either haven't declared a return type or have not "named" it.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Okay? And what do we want with this copied code?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

As I have answered elsewhere, I believe on java-forums.org, but I'm not sure anymore, and stop cross-posting, use getTimestamp.

masijade 1,351 Industrious Poster Team Colleague Featured Poster
set i=84
while [ $i <= 92 ]
do
  # whatever
  i=$(($i + 1))
done

or stick with the first version. What you don't seem to understand is that ".." is an operator (just like "+" is an operator) defined in Perl. It is, as you can see above, not available in Shell. It is a Perl language feature.

deepakkrish commented: Thanks for the ans +2
masijade 1,351 Industrious Poster Team Colleague Featured Poster

One note. Do not use "\n", use System.getProperty("line.separator") to get the proper, platform-dependant line ending.

Edit: A second note, it is probably more effecient to simply print each line indivudually, if you can, as each String concatenation creates a StringBuffer and a new String. Or better, would be to "build your String" using a StringBuilder.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Because it is assuming that numbers that start with 0 are octal numbers. ctal numbers can only have digits from 0-7. If you only want to move files where the number is greater then 030 do

mv *[3-9][0-9].jpg *[1-9][0-9][0-9].jpg destination
rhoit commented: it was fast! +4
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Package it as a jarfile.

See this and this. As always the Tutorials nearly always help, even with this.

Nahiyan commented: Clear concept +2
masijade 1,351 Industrious Poster Team Colleague Featured Poster

It's pretty clear to me. You are trying to compile something as though it where source code using JDK version 1.4 when it is actually code that needs a JDK of 1.5 or higher.

masijade 1,351 Industrious Poster Team Colleague Featured Poster
package test;

import java.awt.BorderLayout;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;

import javax.swing.JFrame;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;

public class FocusTest {

	public static void main(String[] args) throws Exception {
		SwingUtilities.invokeLater(
			new Runnable() {
				public void run() { createGui(); }
			});
	}

	public static void createGui() {
		JFrame f = new JFrame();
		f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		final JTextField jtf1 = new JTextField(20);
		final JTextField jtf2 = new JTextField(20);
		jtf1.addFocusListener(
			new FocusListener() {
				public void focusGained(FocusEvent e) {}
				public void focusLost(FocusEvent e) { jtf2.setText(jtf1.getText()); }
			});
		f.getContentPane().add(jtf1, BorderLayout.NORTH);
		f.getContentPane().add(jtf2, BorderLayout.SOUTH);
		f.pack();
		f.setVisible(true);
	}
}

The Tutorials obviously give better information as does this.

Edit: P.S. In earlier post I meant to say don't forget to disable the combobox while you repopulate it.