Importing my class files from another folder

hello everybody ,im creating a software package for a new company and want to organise my class files into different folders so that it would be easier for someone to navigate through them and update if necessary ,how do i import an instance of a class in a file that is in a subfolder of the folder that contains the class that is calling it.(sorry for being a bit long winded) iv tried diff things and they didn't work.
At the moment i have all the files in the one folder,but as i said above want to put them into appropriate folders.
I would be very gratefull if someone could give me some examples and if not some appropriate links,thanks iv tried looking for this on the net but could not find anything.

What you should probably do is to organise your classes into a heirarchy of packages not merely folders. Java expects the package structure to be reflected in the directory structure holding both the source and class files. If it's looking for a class called, say, com.mycompany.widgets.MainWidget it expects to find it in a directory com//mycompany/widgets relative the the directory on the class path.
Use the package directive in each source file to indicate the package path.

Similar Messages

  • I am not being able to play sound when I import a .MTS file from my folder

    I am not being able to play sound when I import a .MTS file from my folder on my sequence bar of my Premiere Pro CS6. Even if I use my Media Browser to import the file, the video plays fine, but the audio is disabled it seems. I don't know what to do since I have used .MTS files before without hassle on CS5.5. It is quite frustrating. What can I do?

    Hi debesh05,
    Please mention the Operating System that you are using and also make and model of the Camera that was used to capture those clips. Also, try to make another folder with the same name in the same location where the .MTS files are and move all the clips into the new folder and then try to import the files again using Media Browser in Premiere Pro CS6. If this doesn't work then make a copy of one file and rename it as .M2TS and then import that single file into Premiere Pro CS6. Please update if either of the solution works for you.
    Regards,
    Vinay

  • Importing All the files from a folder at a time

    Hi....
    Can any body tell me how to import set of files from a folder into IDM.
    It is becoming very difficult to import the files one after other....
    Waiting for Reply....
    Thanks in advance..........

    We used an ant script to build an XML file that will contain the files. The script is configured to use the folder structure of our CVS repository.
    We'd checkout our XML module and then run the build script and import the resulting init file.
    Code to the script is below -- caveat emptor. You'll need to change the folder structure to suit your own environment.
    <?xml version="1.0" encoding="UTF-8"?>
    <project basedir="." default="all" name="MyInit">
        <target name="init">
            <property location="." name="src.dir"/>
            <property location="." name="dest.dir"/>       
            <property name="project.name" value="${ant.project.name}"/>
            <property location="${dest.dir}/MyInit.xml" name="MyInit.output"/>
            <property name="source.configuration" value="${dest.dir}/configuration"/>       
            <property name="source.emailTemplate" value="${dest.dir}/emailTemplate"/>
            <property name="source.forms" value="${dest.dir}/forms"/>
            <property name="source.reports" value="${dest.dir}/reports"/>               
            <property name="source.resource" value="${dest.dir}/resource"/>          
            <property name="source.rules" value="${dest.dir}/rules"/>
            <property name="source.workflow" value="${dest.dir}/workflow"/>
            <!-- get the source path -->
            <path id="configuration.path">
                <fileset dir="${source.configuration}" >
                   <include name="*.xml" />
                </fileset>
             </path>
             <property name="cp" refid="configuration.path" />
             <path id="emailTemplate.path">
                <fileset dir="${source.emailTemplate}" >
                   <include name="*.xml" />
                </fileset>
             </path>
             <property name="ep" refid="emailTemplate.path" />
             <path id="forms.path">
                <fileset dir="${source.forms}" >
                   <include name="*.xml" />
                </fileset>
             </path>
             <property name="fp" refid="forms.path" />
            <path id="reports.path">
                <fileset dir="${source.reports}" >
                   <include name="*.xml" />
                </fileset>
             </path>
             <property name="rptp" refid="reports.path" />                 
            <path id="resource.path">
                <fileset dir="${source.resource}" >
                   <include name="*.xml" />
                </fileset>
             </path>
             <property name="rep" refid="resource.path" />        
            <path id="rules.path">
                <fileset dir="${source.rules}" >
                   <include name="*.xml" />
                </fileset>
             </path>
             <property name="rp" refid="rules.path" />
            <path id="workflow.path">
                <fileset dir="${source.workflow}" >
                   <include name="*.xml" />
                </fileset>
             </path>
             <property name="wp" refid="workflow.path" />
            <!-- get the path prefix -->
             <path id="source.path">
                <pathelement location="${src.dir}" />
             </path>
             <property name="sp" refid="source.path" />       
        </target>
        <target depends="init"  name="win_init">
            <!-- change the path of xml files to windows path -->
            <property name="importfile.path" value="${sp}"/>                            
        </target>              
        <target depends="init" name="make">
        <!-- using XML character entity references to escape
        <  <
        >  >
        '  &apos;      -->    
            <echo file="${MyInit.output}" append="false"><?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE Waveset PUBLIC 'waveset.dtd' 'waveset.dtd'>
    <Waveset>
    ${cp}
    ${ep}
    ${fp}
    ${rptp}
    ${rp}
    ${wp}
    </Waveset>
            </echo>
         <!-- replace path prefix with ImportCommand -->
         <replace file="${MyInit.output}"
                  token = "${sp}"
                  value = "<ImportCommand name='include' file='${importfile.path}" />
         <!-- deal with file and path separators in an os independent way -->
         <replace file="${MyInit.output}"
                  token = "${file.separator}"
                  value = "/" />        
        <replace file="${MyInit.output}"
                  token = "${path.separator}"
                  value = "${line.separator}" />
        <replace file="${MyInit.output}"
                  token = ".xml"
                  value = ".xml'/>" />
        </target>
        <target depends="init,win_init,clean,make" description="Build everything." name="all"/>
        <target depends="init" description="Clean all build products." name="clean">
            <delete file="${MyInit.output}"/>
        </target>
    </project>

  • My imported backup html files from another computer do not show up after import

    I am currently transferring files from my macbook pro to a pc netbook. I already exported my firefox bookmarks via an external drive and accessed the html file on my new netbook. After importing the html on firefox on my new netbook, the bookmarks do not show up on my bookmark list.

    Please see this article on how to move your bookmarks and settings from one computer to another: [[Moving your Firefox bookmarks and settings]].
    Caution: Restoring bookmarks from a backup will overwrite your current set of bookmarks with the ones in the backup file.

  • Importing multiple jpeg files from local folder into database LOB column

    I have to programatically save multiple pictures (jpeg) from the folder on my PC into Oracle table LOB column. I have to be able to choose local folder on my PC where are the pictures, and press button on Oracle Forms to save pictures in LOB column in database.
    I'm using Forms 6i and Oracle 10g Rel2 database.
    Is this possible with Oracle Forms or the only way to do that is to use create directory database command and use dbms_lob package which I shouldn't do, because Oracle database directory is not allowed to see my local folder.

    As I said I don't know how to use object data type, I just given a shot as below. I know the following code has errors can you please correct it for me.
    Public
    Sub Main()
    ' Add your code here 
    Dim f1
    As FileStream
    Dim s1
    As StreamReader
    Dim date1
    As
    Object
    Dim rline
    As
    String
    Dim Filelist(1)
    As
    String
    Dim FileName
    As
    String
    Dim i
    As
    Integer
    i = 1
    date1 =
    Filelist(0) =
    "XYZ"
    Filelist(1) =
    "123"
    For
    Each FileName
    In Filelist
    f1 = File.OpenRead(FileName)
    s1 = File.OpenText(FileName)
    rline = s1.ReadLine
    While
    Not rline
    Is
    Nothing
    If Left(rline, 4) =
    "DATE"
    Then
    date1 (i)= Mid(rline, 7, 8)
     i = i + 1
    Exit
    While
    End
    If
    rline = s1.ReadLine
    End
    While
    Next
    Dts.Variables(
    "date").Value = date1(1)
    Dts.Variables(
    "date1").Value = date1(2)
    Dts.TaskResult = ScriptResults.Success
    End
    Sub

  • How do I import a iWeb file from another computer to my computer? I have Lion and iweb version 3.0.4

    My friend has been working on a website on her iWeb on her computer and I would like to take over on mine. Does anyone know how to do this?
    thanks!

    Once you copy the Domain.sties file from your friend's computer to yours consider the following:
    In Lion the Library folder is now invisible. To make it permanently visible enter the following in the Terminal application window: chflags nohidden ~/Library and hit the Enter button - 10.7: Un-hide the User Library folder.
    To open your domain file in Lion or to switch between multiple domain files Cyclosaurus has provided us with the following script that you can make into an Applescript application with Script Editor. Open Script Editor, copy and paste the script below into Script Editor's window and save as an application.
    do shell script "/usr/bin/defaults write com.apple.iWeb iWebDefaultsDocumentPath -boolean no"delay 1
    tell application "iWeb" to activate
    You can download an already compiled version with this link: iWeb Switch Domain.
    Just launch the application, find and select the domain file you want to open and it will open with iWeb. It modifies the iWeb preference file each time it's launched so one can switch between domain files.
    WARNING: iWeb Switch Domain will overwrite an existing Domain.sites2 file if you select to create a new domain in the same folder.  So rename your domain files once they've been created to something other than the default name.
    OT

  • Storing class file into another folder

    can i compile a java program "abc.java" in folder one and its class file will be automatically created in folder two.

    Yes, you can use the -d flag when invoking javac:
    // *nix/MacOS
    javac -d two/ one/abc.java
    // Windows
    javac -d two\ one\abc.javaFor all javac options, execute:
    javac -help

  • How to include applet in jsp if applet.class file in another folder

    hi,
    i'm getting problem when my applet.class file is not with its appropriate jsp file. i'm using jsp :plugin tag.it work when jsp file n apllet.class file at same location.
    in short my jsp file is at location /webapps/jsp-examples/myproject/includeDemo.jsp
    n applet i want in a WEB-INF folder.
    Plz help me to solve this..
    or give me other way that an applet can be loaded in jsp page n applet should be in WEB-INF file..
    Help me for this

    http://forum.java.sun.com/thread.jspa?threadID=5148764&messageID=9556205

  • Setting JTree in one class file from another class file

    Hello,
    I'm new to java. I recently created a project in netbeans and here is one of the java files. I used the IDE to make a split pane, with a tree structure and panel in it.
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    * AmplifierDesignGUI.java
    * Created on Jun 20, 2010, 1:18:52 PM
    package AmplifierDesign;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    * @author Bugz
    public class AmplifierDesignGUI extends javax.swing.JFrame {
    /** Creates new form AmplifierDesignGUI */
    public AmplifierDesignGUI() {
    initComponents();
    /** This method is called from within the constructor to
    * initialize the form.
    * WARNING: Do NOT modify this code. The content of this method is
    * always regenerated by the Form Editor.
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {
    jSplitPane1 = new javax.swing.JSplitPane();
    jScrollPane1 = new javax.swing.JScrollPane();
    jTree1 = new javax.swing.JTree();
    jPanel1 = new javax.swing.JPanel();
    jMenuBar1 = new javax.swing.JMenuBar();
    jMenu1 = new javax.swing.JMenu();
    jMenu2 = new javax.swing.JMenu();
    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    jScrollPane1.setViewportView(jTree1);
    jSplitPane1.setLeftComponent(jScrollPane1);
    org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(
    jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(0, 475, Short.MAX_VALUE)
    jPanel1Layout.setVerticalGroup(
    jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(0, 274, Short.MAX_VALUE)
    jSplitPane1.setRightComponent(jPanel1);
    jMenu1.setText("File");
    jMenuBar1.add(jMenu1);
    jMenu2.setText("Edit");
    jMenuBar1.add(jMenu2);
    setJMenuBar(jMenuBar1);
    org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
    layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(layout.createSequentialGroup()
    .add(8, 8, 8)
    .add(jSplitPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 571, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
    .addContainerGap(32, Short.MAX_VALUE))
    layout.setVerticalGroup(
    layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(layout.createSequentialGroup()
    .add(8, 8, 8)
    .add(jSplitPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 278, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
    .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    pack();
    }// </editor-fold>
    * @param args the command line arguments
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    new AmplifierDesignGUI().setVisible(true);
    try {
    new JTreeStructure().setVisible(true);
    } catch (Exception ex) {
    Logger.getLogger(AmplifierDesignGUI.class.getName()).log(Level.SEVERE, null, ex);
    // Variables declaration - do not modify
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JSplitPane jSplitPane1;
    private javax.swing.JTree jTree1;
    // End of variables declaration
    So once this was done I wanted to link the JTree to a mysql database. So I found a sample .java file on the net:
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package AmplifierDesign;
    import java.awt.*;
    import java.sql.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.tree.*;
    public class JTreeStructure extends JFrame {
    Connection con = null;
    Statement st = null;
    ResultSet rs = null;
    //public static void main(String args[]) throws Exception {
    // new JTreeStructure();
    public JTreeStructure() throws Exception {
    super("Retrieving data from database ");
    String driver = "com.mysql.jdbc.Driver";
    String url = "jdbc:mysql://localhost:8889/";
    String db = "icons";
    ArrayList list = new ArrayList();
    list.add("Laser Objects");
    Class.forName(driver);
    con = DriverManager.getConnection(url + db, "root", "root");
    try {
    String sql = "Select * from fiberComponents";
    st = con.createStatement();
    rs = st.executeQuery(sql);
    while (rs.next()) {
    Object value[] = {"Fiber Components",rs.getString(2) };
    list.add(value);
    } catch (Exception e) {
    System.out.println(e);
    rs.close();
    st.close();
    con.close();
    Object hierarchy[] = list.toArray();
    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Container content = getContentPane();
    DefaultMutableTreeNode root = processHierarchy(hierarchy);
    JTree tree = new JTree(root);
    content.add(new JScrollPane(tree), BorderLayout.CENTER);
    setSize(275, 300);
    setLocation(300, 100);
    setVisible(true);
    private DefaultMutableTreeNode processHierarchy(Object[] hierarchy) {
    DefaultMutableTreeNode node = new DefaultMutableTreeNode(hierarchy[0]);
    DefaultMutableTreeNode child;
    for (int i = 1; i < hierarchy.length; i++) {
    Object nodeSpecifier = hierarchy;
    if (nodeSpecifier instanceof Object[]) // Ie node with children
    child = processHierarchy((Object[]) nodeSpecifier);
    } else {
    child = new DefaultMutableTreeNode(nodeSpecifier); // Ie Leaf
    node.add(child);
    return (node);
    The problem is when I run my program two windows open up. The original one with JTree1, and the panel and horizontal splitplane and another window with a new tree component that did get its objects from the database. My question is how do I "replace" the JTree1 with the new tree created from the second java file?
    Or additionally, maybe I could set the data for JTree1 from within the second java file?

    zmoddynamics wrote:
    ....Please excuse my post as I am not sure what is meant by code tags?To use code tags, highlight your pasted code (please be sure that it is already formatted when you paste it into the forum; the code tags don't magically format unformatted code) and then press the code button, and your code will have tags.
    Another way to do this is to manually place the tags into your code by placing the tag [cod&#101;] above your pasted code and the tag [cod&#101;] below your pasted code like so:
    [cod&#101;]
      // your code goes here
      // notice how the top and bottom tags are different
    [/cod&#101;]Luck.

  • Importing an image file from a folder not inside iPhoto????

    I can't find a way to just import a jpg or other image file into iMovie O8. Do you really have to put it in iPhoto and then bring it in.
    Thanks - Larry

    Do you really have to put it in iPhoto and then bring it in.
    No, you can simply drop them to the "Project" window from the desktop to automatically create a "Still Frame" sequence.

  • How to Copy an Image File from a Folder to another Folder

    i face the problem of copying an image file from a folder to another folder by coding. i not really know which method to use so i need some reference about it. hope to get reply soon, thx :)

    Try this code. Make an object of this class and call
    copyTo method.
    import java.io.*;
    import java.net.*;
    import java.util.*;
    public class FileUtil
    extends File {
    public FileUtil(String pathname) throws
    NullPointerException {
    super(pathname);
    public void copyTo(File dest) throws Exception {
    File parent = dest.getParentFile();
    parent.mkdirs();
    FileInputStream in = new FileInputStream(this); //
    Open the source file
    FileOutputStream out = new FileOutputStream(dest); //
    Open the destination file
    byte[] buffer = new byte[4096]; // Create an input
    buffer
    int bytes_read;
    while ( (bytes_read = in.read(buffer)) != -1) { //
    Keep reading until the end
    out.write(buffer, 0, bytes_read);
    in.close(); // Close the file
    out.close(); // Close the file
    This is poor object-oriented design. Use derivation only when you have to override methods -- this is just
    a static utility method hiding here.

  • I suddenly can't move files from one folder to another in my FlashHelp project.

    I have RH8 (8.02). I have been working on this project for a couple of years now.
    What changed? I had imported a Word document and then removed the document and the folder it created from the Project Manager. Now I cannot move any of my files from one folder to another in the Project Manager pod. I susptected a corrupt CPD file so I closed the project, deleted the CPD file. Next I opened Robo from Programes (I never open from the .xpj file), went to Tools>Options and deleted the pinned most recently used project. Select Open, and locate/open the xpj file. I've also re-generated the output (no errors) and completed all these steps again. Of course Robo only goes haywire on me right before I have to publish for our new software release.

    Hi there
    From what I'm seeing my own guess here is that RoboHelp is still believing that the content belongs to word.
    I might suggest the following steps.
    Open Winows Explorer and make copies of the HTML files involved. Then from RoboHelp, delete or remove the content. Then use the Import function to add the desired HTML files back into the project into the desired folder.
    My thought is that by taking these steps you will have effectively disassociated Word and the topics should now be independent topics that RoboHelp should allow you to manage as you wish.
    Hope you get it sorted... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7 or 8 within the day - $24.95!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

  • I cannot import music I bought from another site into iTunes.  The files are there but they won't import into Itunes.  How can I fix this?  Thanks!

    I cannot import music I bought from another site into iTunes.  The files are there but they won't import into Itunes.  How can I fix this?  Thanks

    What format are they in?
    What happens when you try?
    Have you tried placing a copy in the Automatically add to iTunes folder?
    tt2

  • To Place the XML file from one folder to another folder in AL11

    Hi All,
      Here my requirement is to create the quotes using XML document. The XML document will come from the Application server. this one is fine.
    Now my prob is after processing the XML file, we have to place the XML file into another folder.
    Please let me know how to move the data inot XML file.
    Now iam reading the data into one variable V_string(it will contains the total XML file). From this variable how to move the data into APplication server.
    Please do the needful.
    Regards,
    Sreehari

    Hi,
    Use FM WS_FILE_COPY To FIrst Copy the File to some Location
    and Next Use FM TMP_GUI_DELETE_FILE To Delete the File from Old LOcation.
    Regards
    Bala.M

  • How can I move a Pages file from a folder to another one?

    I Have done the upgrade to mac os Yosemite but now i'm Not able to move a file from a folder to another one Inside iCloud
    now it's impossible to organize MY archive

    Thankyou Winston, you guess right. What i don't understand is why with the older version of mac os (10.9) i can organize my document into icloud folders using the Pages app window. But now with the new version i'm no longer able to do that. Using ipad in the same window there is no problem, but in mac os it doesn't work. 

Maybe you are looking for

  • Does CS3 work on Mac OS X Lion?

    I have installed the Adobe CS3 Design Premium (from original package discs) on my iMac but although I am able to open Photoshop, the other applications won't open and instead return "the application has unexpectedly quit" notification. I was able to

  • How to add/change missing header lines in RNIF B2B?

    Hi all, We are using RNIF exchange protocol. We have sent invoice from BPEL to B2B. The message invoice reaches the trading partner but they are unable to process it or sent ack back as few header lines are missing in the RNIF envelope. Can anyone te

  • Sound Recorder doesnot records sound !!

    Hello i have Hp Pavilion DV-6 6010tx Operating System windows 7 (64-bit) my sounds are played but the sound recorder and skype dont record sound

  • Report is very Slow,!!!

    Hi Every1; I am building a report of statements of different account holders, but it take much time as each page took more than 10 mins consisting of 25 rows only, please check my query is there any problem in it or not. Query i m taking the accounts

  • Dual 2ghz G5 appears with only one processor in Activity Monitor

    Here's something I haven't seen before... a dual 2ghz G5 appears as a single processor machine in Activity Monitor. I ran the hardware test from the CD and everything checked out fine. I then rebooted and zapped PRAM using commandoption+PR... I held