abrar alvi

Ranch Hand
+ Follow
since Feb 01, 2012
abrar likes ...
Netbeans IDE Eclipse IDE Java
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
25
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by abrar alvi

Ok so how do i validate my form first and then redirect it to a different page....
Hi I am new to JavaScripts , I have a problem in redirecting my page after clicking sumbit


Note: before redirecting first i have to perform form validation.

Here is my code:




Please help me...
Thank you ....

suggest me some topics which i must be strong in Javascripts.
Thank you Bear Bibeault,


Now my code is working. I just added the following code inside body



Thank You again.....
This is my code:

Thank you....


But i am new to javascripts and would like to use it for these purpose.

Can you help me out...

I tried with getElementById() to acces the element inside <table> but couldn't.
Hi friends,
My problem:

I want to insert a random number in the textarea of my form.

My code:

Javascript:




My HTML code:



But it is not printing my random number in the textarea "token"

Help Me.....
Thanks,

now the code is working fine....
9 years ago

nir sharma wrote:

abrar alvi wrote:


you can use fileaddress.getParent(); to get the parent directory and your variable filename already contain the file name or you can also use fileaddress.getName(); it wont make any difference though.
then you can store those in hashmap.
This should solve the issue but if not then can I know what is the issue you are facing?



Thank you Nir,

i have included HashMap to store the file name and its path....

problem now: filename is only returning the directory name but i need the file name inside it to be returned

this is my modified code:




this is the output:

{New Folder=C:\Documents and Settings\Abrar Alvi\Desktop\New Folder}
{New Folder (2)=C:\Documents and Settings\Abrar Alvi\Desktop\New Folder, New Folder=C:\Documents and Settings\Abrar Alvi\Desktop\New Folder}
{New Folder (3)=C:\Documents and Settings\Abrar Alvi\Desktop\New Folder, New Folder (2)=C:\Documents and Settings\Abrar Alvi\Desktop\New Folder, New Folder=C:\Documents and Settings\Abrar Alvi\Desktop\New Folder}
{New Folder (4)=C:\Documents and Settings\Abrar Alvi\Desktop\New Folder, New Folder (3)=C:\Documents and Settings\Abrar Alvi\Desktop\New Folder, New Folder (2)=C:\Documents and Settings\Abrar Alvi\Desktop\New Folder, New Folder=C:\Documents and Settings\Abrar Alvi\Desktop\New Folder}
9 years ago
hi,

this is a code which scans a given movie directory and stores the location of each files in fileaddress.....

my problem:
1. I want also to store the file name as well as the file path(which i am getting through this code)...
2. Then store the file name and path in a HashMap after getting the same....





Help me....
9 years ago

Jelle Klap wrote:In your MyDrawPanel class you attempt to override JPanel#paintComponent(), but you've misspelled the name as paintComponenet(). Your method never gets invoked, which is why you're only seeing the default empty JPanel graphics

If you use the @Override annotation on a method that should be an overrides of a super class method or an implementation of an interface method, you can prevent this kind of thing very easily. In fact you seem to have done just that with the controlChange() method...





Thanks Jelle Klap,

Really it was a silly mistake....

Yes, now the code is running just fine.....
9 years ago

Campbell Ritchie wrote:Why have you got static fields? I think those fields should go with an object and should not be static.

Which page is it on? I have my copy here, and it would help to compare your code with what was printed.




The code is at page 392
9 years ago
hi, i am trying out the MiniMusicPlayer3 program from the book HeadFirst Java...

Problem: My class which extends JPanel is not loading in my frame.... but the events are occurring...


This is my code:






help me...
9 years ago

Michael Dunn wrote:> Can you explain me why have you made String originalText as final....

remove the word 'final', recompile, see what happens.




yes i removed and tried it gives the follwoing error message:

Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: Uncompilable source code - local variable originalText is accessed from within inner class; needs to be declared final
at EventDemo$1.actionPerformed(EventDemo.java:41)
at javax.swing.Timer.fireActionPerformed(Timer.java:312)
at javax.swing.Timer$DoPostEvent.run(Timer.java:244)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:721)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:682)
at java.awt.EventQueue$3.run(EventQueue.java:680)
at java.security.AccessController.doPrivileged(Native Method)



"local variable originalText is accessed from within inner class; needs to be declared final" please explain me this line...


thanks






9 years ago