Cant use packages/classpaths correctly _ never could too

Hello,
I have a directory C:\DIR
In this directory I have a program. Two files both declare the package a.b package a.b;. Both files are in the directory C:\DIR\a\b.
One of my files is KeyInput.java which implements KeyListener for obvious reasons.
The second file is Main.java which has a Frame frame to which I want to add a KeyListener: frame.addKeyListener(new KeyInput()); Now, this works perfectly fine when I have KeyInput as an inner class, but using this (the above) architecture my compiler can't find KeyInput.
I have not set a classpath (though I did try that in my compiling command "javac -classpath C:\ Main.java", but that did not work).
I did check all sorts of documentation on this, so please don't answer that I should do just that. I can't get it running. Until now my remedy was not using packages, but I want to.
Please tell me what I am doing wrong,
Q
thanks

I now have another basic problem with these two classes, which concerns the concept "static".
Here's the problem:
When I add a KeyListener to frame as above I instantiate a KeyInput.
In KeyInput I for instance want to use a key to quit the program. (I also want a lot of other things, but
the same problem applies to them) To do this I create a method "public void kill( )" in Main. mainInst is
an instance of Main (created in the public static void main (String[] args) method), but my instance of KeyInput does not know him.
So now I have a problem. Because I either have to make my instance of KeyInput know mainInst so it
can do "mainInst.kill( )", which I do not know how to do; or I have to use the Main class itself. However:
Main.kill( ) does not work, because kill isn't static. I could make kill static, but then I have a static context
where I don't want any, for know I have a boolean running which has to be declared static etc. etc., and
then I'm not even talking about all the other things to do with the keys.
Ok, one solution is simple... make KeyInput an inner class of Main. But I don't want that! It will wreck
all the little beauty present in my programmature. So what do I do? How does a professional do this? It's such a basic problem I must know the answer.
Many thanks,
Q

Similar Messages

  • TS3212 im trying to reinstall but will not allow, due to an error 7,  itunes helper not installed correctly,i have tried several times, but will not allow me to install, i have used itunes for years but now cant use it, can you help

    i have tried to reinstall itunes because it is saying i cant use my itunes due to an error 7, itunes helper not installed correctly, please reinstall, i have tried several times but still not allowing me to use, ive never had this problem before in all the years i have used itunes, i have gone through all the troubleshooting but still no access, can you help

    Many thanks.
    That suggests that another application has stashed old QuickTime componentry in your system files.
    So just in case we'll go looking for older QuickTime componentry in the most common locations for it to be stashed.
    First we'll need to change some view settings.
    In your Start menu, open Computer.
    In your Organise menu, select Folder Options.
    In the View tab, make sure that "Show hidden files and folders" is selected, and Hide extensions for known file types is unchecked.
    Click OK.
    Now in Computer, open your C:\ drive (or whichever drive you have your operating system installed on).
    Open the "Windows" folder.
    If you have a 32-bit version of Windows, open the "System32" folder.
    If you have a 64-bit version of Windows, open the "SysWOW64" folder.
    What files and folders can you see in there with QuickTime in the title? (In a standard installation of Quicktime you should be seeing precisely two files... QuickTime.qts and QuickTimeVR.qtx ... and no QuickTime folders whatsoever.)

  • Hey guys i was wondering if i could downgrade my iphone 5 from ios 7.1.1 to 7.0.6 or .0.4 i have 7.0.6 and .0.4 shsh blobs but when i try to build a custom ipsw using ifaith it loads and never stop loading is there any way to downgrade to older ios 7 ?

    Hey guys i was wondering if i could downgrade my iphone 5 from ios 7.1.1 to 7.0.6 or .0.4 i have 7.0.6 and .0.4 shsh blobs but when i try to build a custom ipsw using ifaith it loads and never stop loading is there any way to downgrade to older ios 7 ?

    No, you cannot downgrade your iOS device. That's not supported by Apple.

  • Using Maverick, error message: Adobe Reader could not open '***.pdf' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded).

    Receiving error message using current Maverick version: "Adobe Reader could not open '***.pdf' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded).".  Is fix the same as on previous OS versions?

    Back up all data before making any changes. Please take each of the following steps until the problem is resolved.
    Step 1
    If Adobe Reader or Acrobat is installed, and the problem is just that you can't print or save PDF's displayed in Safari, you may be able to do so by moving the cursor to the the bottom edge of the page, somewhere near the middle. A black toolbar should appear under the cursor. Click the printer or disk icon.
    Step 2
    There should be a setting in its preferences of the Adobe application such as Display PDF in Browser. I don't use those applications myself, so I can't be more precise. Deselect that setting, if it's selected.
    Step 3
    If you get a message such as ""Adobe Reader blocked for this website," then from the Safari menu bar, select
    Safari ▹ Preferences... ▹ Security
    and check the box marked
    Allow Plug-ins
    Then click
    Manage Website Settings...
    and make any required changes to the security settings for the Adobe PDF plugin.
    Step 4
    Triple-click anywhere in the line of text below on this page to select it, the copy the selected text to the Clipboard by pressing the key combination command-C:
    /Library/Internet Plug-ins
    In the Finder, select
    Go ▹ Go to Folder
    from the menu bar, or press the key combination shift-command-G. Paste into the text box that opens by pressing command-V, then press return.
    From the folder that opens, move to the Trash any items that have "Adobe" or “PDF” in the name. You may be prompted for your login password. Then quit and relaunch Safari.
    Step 5
    The "Silverlight" web plugin distributed by Microsoft can interfere with PDF display in Safari, so you may need to remove it, if it's present. The same goes for a plugin called "iGetter," and perhaps others—I don't have a complete list. Don't remove Silverlight if you use the "Netflix" video-streaming service.
    Step 6
    Do as in Step 4 with this line:
    ~/Library/Internet Plug-ins
    If you don’t like the results of this procedure, restore the items from the backup you made before you started. Relaunch Safari.

  • Hi I have a macbook pro version 10.6.7 I cant install tunes 12 .and Ihave a i phone4, i cant use it with Itunes 10,,,I delete Itunes10,and now I cant use my Iphone with my macbook cause I don't have the correct version of Itunes

    this is my problem ...I have a macbook pro version 10.6.7  and I cant install tunes 12 ....Ihave a i phone4, i cant use it with Itunes 10,,,I delete Itunes10,and now I cant use my Iphone with my macbook cause I don't have the correct version of Itunes,,,what is the version of Itunes i need to install?? i need it for my iphone 4 and my macbook 10.6.7

    Run the Software Update pane of System Preferences or click here.
    (121029)

  • HT1937 why i cant use my credit card when im purchasing in clash of clan of gems always say your purchase could not be completed etc etc

    why i cant use my credit card when im purchasing in clash of clan of gems always say your purchase could not be completed etc etc

    No one here can help you.
    Go here:
    https://getsupport.apple.com/GetproductgroupList.action
    ask for assistance.

  • Hi helpers I have very old MacBook 10.5.8 please could you tell me what operating system I should get to be able fully use my laptop as i cant use it properly anymore and doesnt connect with my Iphones etc thanks

    Hi helpers I have very old MacBook Mac OS X 10.5.8 please could you tell me what operating system I should get to be able fully use my laptop as i cant use it properly anymore and doesnt connect with my Iphones etc thanks

    Josejanko,
    You don't supply much info other than your machine is old, so here is some info for you to check thru.
    Before doing anything you should have a back up, preferably 2, in the event something goes wrong.
    You would have to start by upgrading to Snow Leopard, you would need to buy the disk for about $20 here  http://store.apple.com/us/product/MC573Z/A/mac-os-x-106-snow-leopard  
    Check the the requirements to see if your machine meets them.
    You would then need to run the 10.6.8 v1.1 combo update to get it to 10.6.8 Mac OS X 10.6.8 Update Combo v1.1
    You can then access the APP STORE and possibly upgrade to to further OSX.
    You may have applications that will not be compatible with any thing past Snow Leopard, you can check those here Upgrading to 10.7 and above, don't forget Rosetta!
    http://roaringapps.com/apps
    Office 2008 will not work with anything newer than Snow Leopard for an wxample
    You may be able to upgrade to Lion or MT Lion or Yosemite, depending on your machine, from the APP STORE.
    OS X Lion - Technical Specifications Lion
    http://store.apple.com/us/product/D6377Z/A/os-x-mountain-lion Mountain Lion
    http://www.apple.com/osx/how-to-upgrade/ Yosemite
    Hope this helps you

  • I buy my numbers april 2013 , never used, then now toldme that,  I cant use in my mac ios, what happen about?

    I buy my numbers april 2013 , never used, then now toldme that,  I cant use in my mac ios, what happen about?

    Hi,
    Do you mean Numbers for the Mac or Numbers for iOS?
    If you bought Numbers for the Mac in April 2013 then you can still use it, and also download the new version for free.
    If you bought Numbers for iOS in April 2013 then you can update it to the latest Numbers for iOS.
    But Numbers for the Mac and Numbers for iOS are two different apps that need to be purchased separately. 
    They do come free with new iOS devices and Macs.
    SG

  • Packages, Classpath, Ant, and JUnit (setting up a nice environment)

    Hi,
    I am seeking a little help getting up and running, creating a nice environment where I can build a Java project, including building with Ant and using JUnit - hopefully this is the right forum. I am having some trouble in getting JUnit to run my tests properly (it is installed and findable by my Java install) and I think this is due to a package/classpath issue that is currently outside my experience. Here's my setup to explain:
    I have installed the JUnit jar in my extensions folder, and it works properly (I can call it, don't get errors about JUnit), however, when I run my test I get the error:
    "Could not find class: org.xxx.powersim.ModelTest
    Time: 0
    OK (0 tests)
    Java Result: 1"
    ModelTest has been compiled properly without error, and looks like this:
    package org.xxx.powersim;
    import org.junit.*;
    import static org.junit.Assert.*;
    import java.util.*;
    public final class ModelTest {
         public static void main(String args[]) {
               org.junit.runner.JUnitCore.main("org.xxx.powersim.ModelTest");
         @Test
         public void testJunit() {
              assertTrue(true);
    }Pretty simple stuff.
    As you can see I'm trying to use the 'main' method of the test to execute the test itself... but I've tried running it via the runner from the command line also: "java org.junit.runner.JUnitCore org.xxx.powersim.ModelTest". I get the same result.
    It might be a package issue, so here's how I have things set up in the file system:
    PowerSim
         /build
              /org
                   /xxx
                        /powersim
                             - ModelTest.class
         /src
              /org
                   /xxx
                        /powersim
                             -ModelTest.javaI've tried running it within Ant, by hand using the runner, by hand calling the main method, and from within TextMate's built-in bundle - I get the same result. JUnit is installed and running fine, but it can't seem to see the test class - the more I think about it this is a package problem that I'm just not sure how to fix. I've tried running it by hand in the root /PowerSim directory, in the /build folder, and in the /powersim folder where ModelTest is. I still get the error that "Could not find class: org.xxx.powersim.ModelTest".
    My files compile just fine with my simple Ant script which is as follows:
    <?xml version="1.0"?>
    <project name="PowerSim" default="run" basedir=".">
    <property name="src" value="./src"/>
    <property name="build" value="./build"/>
    <property name="compile.debug"       value="true"/>
    <path id="compile.classpath">
       <pathelement location="${mysql.jdbc}"/>
       <pathelement location="${junit.jar}"/>
    </path>
       <target name="build" depends="init">
           <javac srcdir="${src}"
                  destdir="${build}"
                  debug="${compile.debug}"
                  source="1.5">
              <classpath refid="compile.classpath"/>
           </javac>
       </target>
    <target name="init">
       <mkdir dir="${build}"/>
    </target>
    <target name="run" depends="build">
       <java classname="org.xxx.powersim.Model"
           fork="true"
           dir="${build}"
           classpath="${build}"
           maxmemory="500m">
       </java>
       </target>
         <target name="test" depends="build">
             <java classname="org.xxx.powersim.ModelTest"
                 fork="yes"
                 dir="${build}"
                 classpath="${build}"
                 maxmemory="500m">
             </java>
             </target>
    <target name="clean" description="Removes previous build">
       <delete verbose="true">
         <fileset dir="${build}"/>
       </delete>
    </target>
    </project>As you can see, I'm not sure what to try next - any help would be much appreciated.
    I've tried adding things to my $CLASSPATH. For example I've added the root folder of the project, 'PowerSim' to my classpath, but this appears to have no effect. I am running OS X 10.5.
    Thanks again for any help you may be able to offer, it will be very much appreciated,
    - Peter

    Ok - final bump and then I'll go away.
    (Really - if anyone has any advice that would be great)

  • Using packages breaks batch file

    Hi there, I wonder if anyone can help me here.
    I've been continuing work on somebody else's previous project, and everything is fine except for the batch file used to run the program from non development. I decided to use Eclipse to develop as opposed to the previous JCreator, and Eclipse gave an error unless I used packages, however this breaks the batch file
    Here's the orginal text from the batch file -
    java.exe -Xmx256m -classpath C:\InsTra\JARS\ant.jar;C:\InsTra\JARS\jaxen-core.jar;C:\InsTra\JARS\jaxen-jdom.jar;C:\InsTra\JARS\jdom.jar;C:\InsTra\JARS\saxpath.jar;C:\InsTra\JARS\xalan.jar;C:\InsTra\JARS\xerces.jar;C:\InsTra\JARS\xml-apis.jar;c:\InsTra\code_files InsTra
    The batch file is located in C:\InsTra, the external JARS are in a JARS subfolder, and the java and class files are in Code_files. The main class is InsTra. I get the error NoClassDefFoundError
    I've tried making the last bit Code_files.InsTra in case it needed to reference the package, but I'm new to this I'm afraid so have little experience of this sort of thing.
    Any help is welcome
    Thanks
    Daniel

    Then either your compiled class is not on the classpath, or you have not used the correct class name. Or both.
    The classpath must point to the root of the package hierarchy.
    The class name must include the package name (which is dictated by the package line at the top of your source file).
    The compiled class file must be in the correct directory.
    Given the information that you have provided, your class file should have the following path:
    c:\InsTra\code_files\Code_files\It should also have the following line at the top of the .java file:
    pacakge Code_files;Class names are case sensitive. Remember that the class path points to the root of the package hierarchy, NOT each of the directories containing class files. For example, if your classpath is thus:
    c:\fooYour class file is in:
    c:\foo\foo\Spong.classWith a package of:
    package foo;And you execute it with:
    java -classpath c:\foo foo.SpongThen it will work. The following will not:
    java -classpath c:\ foo.Spong
    java -classpath c:\foo\foo Spong
    java -classpath c:\foo\foo foo.Spong
    java -classpath c:\foo\foo Spong.class
    etc.

  • My old apple ID had a redeemed gift card on it with a balance still remaining. I made a new apple id today, and it says I cant use the remaning gift card money on any of my apps with my new apple id? The balance shoes up on my new apple id but it wont wor

    I had an apple ID that I could never remember. I did manage to redeem a gift card on it with a balance still remaining. I made a new apple id today, and it says I cant use the remaning gift card money on any of my apps with my new apple id? The balance shoes up on my new apple id but it wont work? I tried to log in under my old apple id, but I cant as my new one as been created?
    How do I fix this?
    Thank You?

    Any purchases and downloads associated with an apple id are forever tied to that apple id. You can not merge any content, purchases, or info between the two accounts.

  • Packages & classpath on os x

    Hi,
    I had some questions about where i should be putting class files. i've got files in a package com.one2one3.io, so i've got a directory structure /com/one2one3/io/ and i'm wondering where is the generally accepted place to put that, its working for now in ~/Code/com/one2one3/..., but then i have to specify the classpath everytime i compile...
    that brings me to the question of setting the classpath in my .tcshrc file so i don't need to do that everytime... google says this should work:
    setenv CLASSPATH .:/Users/stephen/Code/:${CLASSPATH}
    but it isn't i still get class not found errors when compiling.
    can i put the packages i write in /Library/Java/Extensions/com/one2one3/...? from what i understand the jvm on mac searches there by default so i wouldn't need to specify the classpath everytime i compile. thats working for me, but i want to check and make sure it won't cause me any problems down the line...i guess mainly i'm wondering what you all do to deal with these things.
    and is it usual to include the source .java files in the /com/one2one3/... directory?
    Stephen

    I'm relatively new to Java in general, but I've been developing on Linux and Mac OS X a bit and I have some thoughts I can share. Someone will jump in here and correct me if I'm wrong. But I think I've got it. In any case here is a web page you may find helpful on the javac command.
    http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/javac.html
    And here is a link to a relevant thread in the forum discussing the classpath on OS X.
    http://forum.java.sun.com/thread.jspa?forumID=54&threadID=570279
    I had some questions about where i should be putting class files. I generally let the compiler take care of where to put the class files. Of course if no direction is specified using the "-d" option with the javac command, the files will be placed inside the current working directory. That's true on all OS systems including Mac OS X.
    i've got files in a package com.one2one3.io, so i've got a directory structure
    /com/one2one3/io/ and i'm wondering where is the generally accepted place to
    put that, its working for now in ~/Code/com/one2one3/..., but then i have to
    specify the classpath everytime i compile...Note that when the source file that is being compiled includes a package declaration at the top like
    package com.one2one3.io;
    public class HelloWorld {
    }if the directive option "-d" is specified with the javac command and it points to another directory location other than the current working directory, the compiler will create a directory structure for you (assuming one does not already exist) in that destination directory which mirrors the package structure of the java file. That's quite convenient. So for example you can have all your source files in a top level working directory, like "code", and then direct the output of the javac command, the class files themselves, into another directory, maybe one called "classes".
    javac -d classes HelloWorld.javaAfter executing this you will see that the first directory inside the classes directory will be another directory called "com", consistent with your package com.
    that brings me to the question of setting the classpath in my .tcshrc file so
    i don't need to do that everytime... google says this should work:
    setenv CLASSPATH .:/Users/stephen/Code/:${CLASSPATH}
    but it isn't i still get class not found errors when compiling. Once you can isolate all of your class files into the classes directory, then you define the classpath as the classpath using the "-classpath" option of the javac command. You may want to include the current working directory too by including "./" with the option.
    javac -d classes -classpath ./:classes HelloWorld.javaNote though that when you use the -classpath option with the javac or java command, it does override whatever you currently have set in your system settings. Nonetheless, I understand that this is the standard method of defining the classpath.
    Suppose though that you have a number of different external library jar files that you need to include on the class path. Or suppose you have large numbers of source files you wish to compile all at once. In this case you may want to consider creating command line argument files, as explained here...
    http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/javac.html#commandlineargfile
    Then your javac command would look something like this.
    javac @options HelloWorld.javawhere your classpath and directive would be defined in a file named "options" in the current working directory.
    can i put the packages i write in /Library/Java/Extensions/com/one2one3/...?
    from what i understand the jvm on mac searches there by default so i wouldn't
    need to specify the classpath everytime i compile. thats working for me, but i
    want to check and make sure it won't cause me any problems down the line...i
    guess mainly i'm wondering what you all do to deal with these things.
    and is it usual to include the source .java files in the /com/one2one3/...
    directory? Actually I understand that it is considered poor practice to place files directly into the extensions directory of the Java directory, though you are correct about it's location on Mac OS X. It does work, but it's a bit of a cheat.

  • "Cant use this version of mail with this version of Mac OS X"

    Hi all,
    Hope you can help.
    I have got a new hard disk the other day. Ran a copy from my Time Machine to bring my iMac back to my latest copy. Everything works except my mail program.
    Im told I have mail version 4.0 (1075/1076) and it cant be used with Mac version 10.6.1 (build 10B504)
    I have tried to look through my Snow Leopard installation disk but cant find the mail program so I could try to reinstall it.
    Am I looking the wrong place or do you have some other solution.
    Thanks in advance
    Thomas

    You should be able to find the SL version of Mail as follows:
    1. Insert the SL DVD in your optical drive. Locate the Optional Installs folder, double-click to open. Run the Optional Installs installer located inside. In Applications I believe you will find Mail. Check the box for it then click on the Install button. This will reinstall Mail.
    2. In case the above doesn't have Mail available for a separate installation then you can do the following:
    How to Use Pacifist to Replace Deleted or Missing OS X Components
    Insert the OS X Installer DVD into the optical drive. Use a simple utility like TinkerTool to toggle invisibility so you can see invisible items. Alternatively, open the Terminal application in your Utilities folder and at the prompt enter the following:
    defaults write com.apple.finder AppleShowAllFiles Yes
    Press RETURN.
    To turn off the display of invisible files repeat the above command substituting No for Yes.
    The install packages are located in the /System/Installation/ folder on the DVD.
    Download the shareware utility Pacifist from VersionTracker or MacUpdate. Use it to extract a fresh copy of the missing item(s) from the file archives on your OS X installation DVD. The file archives are in the /System/Installations/ folder (use Go to Folder option in the Go menu of the Finder.)
    Here are Four Basic ways to use Pacifist (courtesy of George Orville.)
    A. Drag a .pkg icon onto the Pacifist window .....proceed to step 7.
    B. Click on “Open Package ....” and navigate to package desired and click “Open” in the open/save window.....proceed to step 7.
    C. Insert Mac OS X installer CD and when it mounts, navigate to .... Menu->Go->Go to Folder.
    In the path field enter or paste ....
    /Volumes/disc name/System/Installation/Packages (where disc name is the name of the CD/DVD that you inserted.
    • Click on the "Go" button .....
    • Drag a .pkg to Pacifist..... proceed to step 7.
    The package you'll need will have to be discovered by trial and error, but for most applications you should start with the Essentials.pkg and/or Additional Essentials.pkg.
    D. Insert your Mac OS X install disk 1 .... and open Pacifist.
    1. In Pacifist, select "Open Mac OS X Install Packages" ... dialog may appear asking for disk 2, then disk 3 and finally disk 1 again.... {if DVD is not used)...If “Stop Loading” is selected...the procedure will stop!!!
    2a. When loading is complete, a new window appears, click the triangle to display contents of each package...Select item and proceed to step 7.
    2b. or click the “Find” icon in the Pacifist window and type the name of the software you need.
    3. In the list that comes back, click the top most entry for the item that you want. ..... that is the one for the English language.
    4. On the top of the Pacifist window, click “verify” .... you will probably be prompted for your password.
    5. Enter checks for.... “verify permissions” and “verify file contents.” and click “verify” ....enter password when prompted.... you will get back output which may look like this:
    20 files were scanned.
    20 of 20 files were present on the hard disk.
    0 of 20 files had file permissions that did not match those specified in the package.
    0 of 20 files had checksums that did not match those specified in the package.
    6. Click “close”. Go to step 7.
    Extract or Install........
    7. In the Toolbar (upper left), you now have the option to extract or install. Click a file in the lower list and those two icons will be enabled.
    8. If “Extract to...” is selected.... navigate to the location where the file will be placed, select “choose”, select “extract” in new dialog that appears,authenicate , if prompted, click “OK”.
    9. In the next dialog, click “Extract”.
    10. If “Install” is selected... dialog will appear with the location/path of the installed software. Click “Install”
    11. Type in your password, click “OK”
    • Pacifist will begin to extract files.
    12. In steps 8/10ß.... you also have the choice to “cancel”
    Notes.....
    • Pacifist may find that a file it is installing already exists on the hard disk. Pacifist will present you with an alert panel....
    Stop
    Leave original alone
    Update ..... Default selection
    Replace .... Replace option should only be used on full install packages

  • Airport Express cant use Netgear DG834G

    Hi
    Simple question really: Is I have an existing Wireless Network being supplied by a Netgear DG834G. I have an Airport Express Base Station that I want to extend the range of the existing network. I cant use the Ethernet option. I have tried to use WDS as a Wireless Bridge but the connection never happens. I am beginning to doubt if APX can be used with Netgear Wireless Routers wirelessly.
    Is there is someone out there who knows differently or knows of a way to achieve this?

    Hi
    Connecting to AX is not a problem, its extending the existing wireless network by using it as a wireless bridge that is the problem. As a matter of interest do you have a solid green light on your AX?
    I did achieve a solid green light but could never get on the internet. Checking the settings (DHCP > Wireles) and I never got a router assigned IP address, even if I used a fixed IP within the router range I got the same result. I’ve since tried it with other Netgear routers and it is as Duane posted. The only time it ever works is if you use the Ethernet cable and to configure the AX as a base station.
    You can extend the range wirelessly using another AX (more than one if you like) with no problem at all if the first AX is connected to the router that connects to the internet using the ethernet port.

  • TS4268 Why i cant use my iMessage in my ipad mini? I use the same id and password in my iphone

    Someone help me with the problem i have. I cant log in into my iMessage in my iPad mini using the same account i am using in my iPhone. I checked the spelling of the password and username they are all correct but still i cant use it on iMessage. Somebody help me. Thanks

    Welcome to the Apple Community.
    In order to change your Apple ID or password for your iCloud account on your iOS device, you need to delete the account from your iOS device first, then add it back using your updated details. (Settings > iCloud, scroll down and hit "Delete Account")
    Just enter your existing details, don't try creating a new account.

Maybe you are looking for