masijade 1,351 Industrious Poster Team Colleague Featured Poster

Im not printing out the array. The purpose of this program is creating an array of objects. the result of this program should be a box filled with green color.

Then you need to show that somehow. So, your question is no longer how to create a 2d array, but rather how to display it? If so, take a look at GridLayout and JPanel and setBackground, or Canvas.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Hi i'm new here in daniweb i would like to ask about my program
i'll make a program that show if the word is palindrome or not can you correct my program when i complie my program its say Process complete then when i run the program it doesn't show the output can you help me pls!

import javax.swing.*;

public class Palindrome
{
    public static void main(String[] args) 
    {
        String A;
        int i,palindrome=1;
        A=JOptionPane.showInputDialog(null,"Enter a Word");
        
        for(i=0;i<A.length()/2;++i)
        {
        	if(A.charAt(i)!=A.charAt(A.length())-i-1)
        	{
        		palindrome=0;break;
        	}
        	if(palindrome==1)
        	System.out.println("The Word "+A+" is a Palindrome"); 
        	else
        	System.out.println("The Word "+A+" is not a Palindrome");
        }
    }
}

I don't believe your if statement should be inside of your loop, right?

Move the if statement down below the closing brace that comes directly after it.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

For the first item Google "Java Installer Builder" (Hint install4j).

For the second item
http://java.sun.com/docs/books/tutorial/uiswing/events/actionlistener.html

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

Well, let us see what you've tried. We are more than happy to help you complete it, and "get it right" but, nobody here is simply going to do it for you.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Manual. Gives full control with no "bolierplate", repetitive, rigid code.

But that's not what you're looking for is it? I dislike all "Gui builders", as they all produce rigid, reptitive code that is hard to modify correctly, and is not always that effecient when any action to be performed is more than popping up a dialog.

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

How is javascript going to help with this when there is no server and no html, or anything else that has anything at all to do with JavaScript? Or is this really a download after all? Even though you said it wasn't? Is there a server now? Where did it come from if there wasn't one before? JavaScript would still have nothing to do with it though. Either parse the access log or only allow the "download" through a cgi/jsp/php/whatever rather than a direct link and have the page that delivers the file "increment the counter", as I already suggested in one of your other threads before you claimed that it wasn't a download at all.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

None of those. This is simply accessing a file on a shared disk. Not a download at all. Take a look at his other threads on this forum about access times and downloads.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Okay? And what have tried?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, of course you're "not getting the exact reason for this" when you ignore all errors. Add a printStackTrace to each of those catch blocks.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Because that brace after the list of values for the enum ends the enum. Remove it and replace it with a semi colon.

Then the second "TypeOfStudent "method" is actually a constructor, and since it is an enum constructor it needs to be private, so change "public String" to "private" for that constructor.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Exctly as it says. Compare line 75 with line 54. What's missing at the front of the line 75 statement?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You were much better off with a PreparedStatement, you just need to do it right

pstmt = conn.prepareStatement("select Cust_fname from Customers where Cust_Id = ?");

Edit: javaAddict attempted to tell you this obliquely, but you seemingly didn't take the hint.

There are always the tutorials though
http://java.sun.com/docs/books/tutorial/jdbc/basics/prepared.html

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Then that is the compilation error. On which line does that occur.

But I can tell you, that most of the class defination of "Listed" needs to be contained within a Method and not directly under the class.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Compile the project?

Read the manual to find out how, if you must.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

With the API docs for Image?

With the Swing Tutorials?

With the Threading Tutorial?

With the "Getting Started" Tutorial?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Provide the full stack trace please. That message doesn't help at all, and it doesn't even seem to be produced by this piece of code.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

There is more than that. That occurs when you try to execute a project within Eclipse that hasn't been successfuly compiled yet. It would definately help to have the compilation messages.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

And I just told you. It is because x is 0 so that equation for y becomes 0-0+4, which is 4, of course.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

It might help to know what these nebulous "errors" are. complete error message with stack traces (where applicable), please.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Okay? You have an array somewhere with three elements (or less) meaning it has indexes 0,1, and 2, and you are trying to access index 3.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Because what is automatically "converted" is the result of the operation, not the individual pieces of the operation. Therefore, the operation consists of two Integers 2/3, therefore Integer math is performed resulting in Integer 0. And the Integer 0, automatically converted to double is 0.0.

Edit: And what do you mean by

in java why we don't get zero in this situation

You do get zero in this situation, and for the reasons explained above.

Edit Again: Why do people simply refuse to believe either 1) there own eyes or 2) explanations from people who know, simply because their initial impression of their own code is "it should be right", even though it's not?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Because 2 and 3 are Integers, so pure Integer math is performed.

Use a literal double (i.e. 2.0 instead of 2) or cast at least one of them to a double

double a = (double) 2 / 3;
// or
double b = 2 / (double) 3;
// or
double c = (double) 2 / (double) 3;
// or
double d = 2.0 / 3;
// or
double e = 2 / 3.0;
// or
double f = 2.0 / 3.0;
// or any combination of casting and literal doubles
kvprajapati commented: Helpful! +6
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Check out the "eval" command.

Edit: I.E.

eval "echo \$${AGENCY}_INCOMING_READY"
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Then you're tough out of luck. If you poll the file with ls -u (on solaris) every few milliseconds you can get a rough (and I do mean rough) estimate, at an extreme overhead cost, but that's all.

Edit: And, BTW, that is not a "download". A "download" runs through a server of some type. If the "clients" have direct access to the file directly through the file system, it is not a "download".

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Go back further.

Explain, exactly, what it is you are trying to do, with all factors detailed.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

If this is that "download count" problem, then you are going about it completely the wrong way.

If it is "good enough" to get the count the next day, then simply parse the servers access log. If you need it "real time", then don't give direct access to the file, at all. Only allow people to "download" it through a cgi/servlet/whatever and have that directly record the attempt.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

At least on Solaris "-u" is the option. For any other system you are going to have to man ls and actually read it to find out if any of the options have anything to do with access time and then actually try that option (and try it in combo with "-l", maybe).

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

uploading images
Java File Upload

db "connectivity"
See the tutorials

MS Access
DSNless ODBC MS Access

masijade 1,351 Industrious Poster Team Colleague Featured Poster

IMHO, not really since they are different sites (as long as you keep them all up-to-date with your progress), but many people consider even that cross-posting (I consider cross-posting to be posting on multiple forums from the site), and cross-posting is considered extremely rude. Since "Tom" on site "abc" could take time out of his day to try and help you with the problem, only to find out the "Joe" on site "xyz" (or the same site) already provided all the same pointers (and possibly even completely solved your problem) two days ago, meaning "Tom" has just completely wasted that time of his because you cross-posted a question and didn't even bother to keep them up-to-date with each other.

Edit: Just like Sabre has just given you the necessary pointers at Sun, which you didn't bother here to point out what they were or how (or if) they helped you, so someone here may waste their time reiterating them.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

ArrayList (and this looks familiar. Did you post this same question on Sun? Yes.)

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, I am sure someone can, but this is not the proper forum. Try an HTML forum? Or a JavaScript forum?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

See the API docs DatabaseMetaData. Good luck with the password, though. The JDBC Driver will not provide that info (or, at the very least, should not).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Google Jasper.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Huh? An "ArrayList" doesn't do any splitting whatsoever and what you are splitting on is "$$". Are you telling me that you have a String such as

a,b,c$$d,e,f$$g,h,i

And you want to get three list's out of it?

If you want one list that contains "a,b,c" - "d,e,f" - "g,h,i" then use the line above (P.S. you may have noticed I am using List, and not ArrayList. Unless you have some specific method from ArrayList you need to use, I would suggest you do the same.).

If you want three Lists as follows
List1 - "a" - "b" - "c"
List2 - "d" - "e" - "f"
List3 - "g" - "h" - "i"

Then use the new for loop to loop over the "split" used above and use the above statement with "," as the pattern within that loop.

masijade 1,351 Industrious Poster Team Colleague Featured Poster
List<String> list = Arrays.asList(string.split());
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Did you not read the part about your reassigning and then clearing Input and Temp? That is your problem.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Or Andy Khan's jxl (Don't believe this works as of Office 2007, however). As last resort you can use the JDBC-ODBC Bridge.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Please post the exact and complete message.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

So, waited until the last minute to do your project, huh? The bar's were just too tempting, huh? Well, good luck. We are not going to do this for you. Try rent-a-coder.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, first off, why are you not using the Stack class, rather than a LinkedList?

Also, rather than doing Temp.clear() create a new Stack and assign it to Temp, because at that point Input and Temp both reference the same List/Stack and so you clear the Stack/List referenced by both (since they are the same stack at that point). That fact would also kept the second iteration of the loop from working since everything pushed onto Temp, would also be pushed onto Input (since they are the same Stack/List after the first iteration).

The other option is to use Input.addAll(Temp) , rather than Input = Temp . Then you would need to still call Temp.clear() , of course.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

no i have not set the class path for this driver.... but even if i use the access database an exception is raised as "[microsoft] Invalid descriptor exception"

Well, that's a different exception, isn't it? What does the one have anything to do with the other?

You need to print more than just the message so that you actually know what is going on. I.E. your first error message was just a class name. If you don't know, beforehand it's a CNFE then all you can do is think, "oh, goody, what's this?". Whereas if you use printStackTrace() you see "ClassNotFoundException: <classname>" instead of just "<classname>". At least a bit more informative, don't you think. And the rest of it also tells you exactly where it happened. That is also nice to know, isn't it?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Nope. The real problem is that that code needs to be inside a method. You can't simply code loops and other actions as part of the class definition, but rather as method/constructor/block definitions inside the class.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

We are not here to do your (home)work for you.

We are more than happy to help you with it, but you have to do it. Show us what you are trying and we will help you to correct it, or describe what part of the problem you are having problems with and/or don't understand and we will give you tips and pointers. But do not simply post your assignment here and expect someone to do it for you.

It is not only morally wrong, it doesn't even help you. You do not learn anything that way and makes the rest of your class/work just that much harder. It is also against the terms and conditions of this site that you agreed to when you signed up here.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, sorry to say, JOGL is not part of the JDK itself, so Mac is not required to implement/support it. That is not a satisfying answer, but true.

Edit: BTW, All systems you know of, or you believe. There is nothing that requires any OS to implement it, or that even if they implement it to interact with the Video Cards they wish to install, there is nothing that says that they have give any other program direct access to the API.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

See http://java.sun.com/docs/books/tutorial/deployment/applet/appletMethods.html

You are missing the methods that actually count for anything. You want to move most of the stuff in your constructor to the init method and you want to define the other three.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Then you seemingly missed the "support request" link on the next page, duh!

Stop making things up, either that or actually open your eyes when you look at the web sites.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

If you want to "split up" the initialisation, place the actual processes into private methods and call those methods from the constructors, rather than coding it directly into the constructors.

And "private" is not a mistake. The methods must be either private or final (or both, although that is overkill) to prevent any unintended consequences from any possible polymorphish.