To load an Xlet from another one

Hi verybody.
I'm new about Xlets and mhp.
I've a problem: I want to load an xlet from a running one.
I've read about this in this forum, but the solutions I've found don't work on my project. Probably I mistake something.
I use the following classes:
Myremote:
public interface MyRemote extends java.rmi.Remote {
public void setValue (int a) throws java.rmi.RemoteException;
public int getValue () throws java.rmi.RemoteException;
} MyFilter:
import org.dvb.application.AppAttributes;
import org.dvb.application.AppID;
import org.dvb.application.AppsDatabase;
import org.dvb.application.AppsDatabaseFilter;
public class MyFilter extends AppsDatabaseFilter {
private String name;
public MyFilter (String name){
super();
this.name = name;
private MyFilter() {
public boolean accept(AppID appid) {
AppAttributes appAttributes = AppsDatabase.getAppsDatabase().getAppAttributes(appid);
if (appAttributes != null) {
String name = appAttributes.getName(); 
if(name.equals(this.name)) 
return true; 
return false; 
} In the running Xlet, in the KeyListner, I try to load XletIWantToLoad (that is in the same package of the running Xlet )using the following code:
filter = new MyFilter("XletIWantToLoad.class");
System.out.println("After Filter");
if(this.theDatabase != null){ 
System.out.println("theDatabase: "+theDatabase); 
attributes = theDatabase.getAppAttributes(filter);
System.out.println("Attributes");
if (this.attributes != null){
while(this.attributes.hasMoreElements()){
AppAttributes info;
AppProxy proxy; 
info = (AppAttributes)attributes.nextElement();
proxy = (AppProxy)theDatabase.getAppProxy(info.getIdentifier());
proxy.start(null); 
}So that:
The problem is that the filter remains null....
Please, may you answer me about this?
Tanx a lot anyway....
Bye
Mauro

Hi verybody.
I have the same problem.
I'm using the following code in my running xlet
public void keyPressed(java.awt.event.KeyEvent keyEvent) {
switch (keyEvent.getKeyCode()) {
case KeyEvent.VK_1 : {
System.out.println("Premuto il tasto 1");
System.out.println("theDatabase: "+theDatabase);
AppsDatabase theDatabase;
AppProxy proxy;
theDatabase = AppsDatabase.getAppsDatabase();
System.out.println("DOPO theDatabase: "+theDatabase);
AppsDatabaseFilter filter;
filter = new CurrentServiceFilter();
Enumeration attributes;
attributes = theDatabase.getAppAttributes(filter);
while(attributes.hasMoreElements()) {
AppAttributes info;
info = (AppAttributes)attributes.nextElement();
System.out.println("info: "+info);
AppID id = info.getIdentifier();
System.out.println("Id: "+id);
proxy = (AppProxy)theDatabase.getAppProxy(id);
System.out.println("Proxy: "+proxy);
proxy.start();
} Thanks
Regards
Mantequilla

Similar Messages

  • Load a new xlet from arunning one

    Hi,
    Does anybody knows how can i load anew class (an xlet)
    from arunning one.
    I have an xlet, i catch apress on the remote control, by
    the KeyEvent, when that happens i want to load a new
    java xlet class, how can i do that???

    Hi,
    if you are using MHP, you can do this via the application listing and launching API in org.dvb.application:
    get an instance of AppsDatabase, retrieve available applications using getAppAttributes (use a CurrentServiceFilter as AppsDatabaseFilter) and find your application. Then, get the Application ID via getAppID and from the AppsDatabase, get the ApplicationProxy using getAppProxy(AppID). Using the AppProxy, you can start your application. Note that your initial application will not automatically be destroyed but hover around untill you exlicitely kill it. Note also that using this API is tricky and needs a lot of dealing with states, events, and exceptions to work properly. My AppController class is some 40k in size... and for a reason.
    Good luck!
    Thomas
    Hi,
    Does anybody knows how can i load anew class (an
    xlet)
    from arunning one.
    I have an xlet, i catch apress on the remote control,
    by
    the KeyEvent, when that happens i want to load a new
    java xlet class, how can i do that???

  • Will not load sites linked from another website--have cleared cache, cookies, history, restarted, checked in Safe Mode--still does not work.

    Some sites load fine. But some sites will not load when linked from another web site, or, occasionally, even from my bookmarks. I went through troubleshooting routine--cleared cache and cookies, history, checked in Safe Mode for extensions, etc., but still will not work in Safe Mode. No other problems with computer or browser.

    What happens when you click the link that does not open up the new page? Is it a blank page? Does this also happen if you Shift Click the link?
    Sometimes a problem with Firefox may be a result of malware installed on your computer, that you may not be aware of.
    You can try these free programs to scan for malware, which work with your existing antivirus software:
    * [http://www.microsoft.com/security/scanner/default.aspx Microsoft Safety Scanner]
    * [http://www.malwarebytes.org/products/malwarebytes_free/ MalwareBytes' Anti-Malware]
    * [http://support.kaspersky.com/viruses/disinfection/5350 Anti-Rootkit Utility - TDSSKiller]
    * [http://general-changelog-team.fr/en/downloads/viewdownload/20-outils-de-xplode/2-adwcleaner AdwCleaner] (for more info, see this [http://www.bleepingcomputer.com/download/adwcleaner/ alternate AdwCleaner download page])
    * [http://www.surfright.nl/en/hitmanpro/ Hitman Pro]
    * [http://www.eset.com/us/online-scanner/ ESET Online Scanner]
    [http://windows.microsoft.com/MSE Microsoft Security Essentials] is a good permanent antivirus for Windows 7/Vista/XP if you don't already have one.
    Further information can be found in the [[Troubleshoot Firefox issues caused by malware]] article.
    Did this fix your problems? Please report back to us!

  • Not able to execute one Java program from another one via. exec()

    Hi,
    I am new to this forum, so I might be asking a very trivial quetion.
    My program Ap1 is :
    class Ap1
    public static void main(String a[]) throws Exception
    Runtime rt=Runtime.getRuntime();
    Process p=null;
    p=rt.exec("javac,Pr.java");
    Runtime.getRuntime().exec("javac,Pr.java");
    When I run the above program, I get below error at the line 7(bold one):
    D:\batchwe>javac Ap1.java
    D:\batchwe>java Ap1
    Exception in thread "main" java.io.IOException: CreateProcess: javac,Pr.java err
    or=2
    at java.lang.ProcessImpl.create(Native Method)
    at java.lang.ProcessImpl.<init>(ProcessImpl.java:81)
    at java.lang.ProcessImpl.start(ProcessImpl.java:30)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:451)
    at java.lang.Runtime.exec(Runtime.java:591)
    at java.lang.Runtime.exec(Runtime.java:429)
    at java.lang.Runtime.exec(Runtime.java:326)
    at Ap1.main(Ap1.java:7)
    Path is set as below(which seems correct):
    D:\batchwe>path
    PATH=C:\Program Files\Java\jdk1.5.0_05\bin
    I am just wondering how to call one Java program from another one?!
    Please help.
    thanks
    Rashmi

    Hi diptaPB,
    Thanks for your suggestion.
    Here is how I tried it again, but not getting the desired output:
    Class Pr looks like below -->
    class Pr
    public static void main(String a[])
    System.out.println("hi from process");
    When I run 'Pr' from command prompt, i get the desired output:
    D:\batchwe>java Pr
    hi from process
    However, when I call 'Pr' from another program Ap2.java, it seems that it does not call 'Pr':
    class Ap2
    public static void main(String a[]) throws Exception
    Runtime rt=Runtime.getRuntime();
    Process p=null;
    String[] cmd=new String[2];
    cmd[0]="javac";
    cmd[1]="Pr.java";
    p=rt.exec("cmd");
    D:\batchwe>javac Ap2.java
    D:\batchwe>java Ap2
    ************* no output appears here***********************
    Looking forward for your help.
    regards
    Rashmi

  • How to load a plugin from another plugin?

    Hi,
    I'm trying to load a plugin, which is not located in the plugin-paths of After Effects from another plugin. It seems to load the aex(dll) and execute the main function fine, but afterwards it crashes immediately and I have no idea why.
    This is how my pluginLoader-PlugIn looks like:
    1. I created a commandHook to be able to trigger the pluginLoad from the Edit Menu
    2. for the actual load of the dll I use the following commands:
              AEGP_SuiteHandler    suites(basic_suite);
            std::string dllName = "C:/PATH/TO/plugin.aex";
            // defining type and order of the arguments of the entry function
            typedef A_Err (*args_type)(SPBasicSuite *pica_basicP, A_long major_versionL, A_long minor_versionL, A_long aegp_plugin_id, AEGP_GlobalRefcon *global_refconP);
            args_type pluginEntryMethod = NULL;
            // loading the dll(aex) and the entry function
            # ifdef _WIN32
            HMODULE hDLL = LoadLibrary(dllName.c_str());
            if (hDLL != NULL)
                pluginEntryMethod = (args_type) GetProcAddress(hDLL, "EntryPointFunc");
            else
                return err;
            # else
            void *pLib = ::dlopen(szMyLib, RTLD_LAZY);
            if (pLib != NULL) {
                pluginEntryMethod = (args_type)::dlsym(pLib, "EntryPointFunc");
            else
                return err;
            # endif
            if (pluginEntryMethod != NULL)
                // hardcoding the plugin version
                A_long mavL = 0L;
                A_long mivL = 1L;
                AEGP_PluginID plId;
                // to get a valid plugin-id I use this command
                suites.UtilitySuite3()->AEGP_RegisterWithAEGP(*globalRefcon, "nameOfPlugin", &plId);
                // I create copy of the refcon and the suite
                AEGP_GlobalRefcon newRefcon(*globalRefcon);
                SPBasicSuite newSuite(*basic_suite);
                pluginEntryMethod(&newSuite, mavL, mivL, plId, &newRefcon);
            # ifdef _WIN32
                FreeLibrary(hDLL);
            # else
                dlclose(pLib);
            # endif
    If I run After Effects with the debugger, the EntryFunction of the new plugin runs through without errors. But Then it crashes and stops at random positions: sometimes in the IdleHook of the newly loaded Plugin, sometimes in the MenuHook.
    Does anyone have an idea, what I am doing wrong?
    btw: when I copy the second plugin in the default Afx-Plugin-Folder it loads fine and seems to work correct.
    Thanks for your help!
    Martin

    Okay, unfortunately it had nothing to do with static or dynamic linking of the dependencies.
    I was able to boil it down to the following problem but I'm still stuck on how to solve the situation:
    The problem has to do with an invalid AEGP_GlobalRefcon of the Plugin I load:
    the plugin loader:
    // the load of the inner plugin..
    AEGP_GlobalRefcon newRefcon; // generating a new refcon
    suites.UtilitySuite5()->AEGP_RegisterWithAEGP(newRefcon, pluginName.c_str(), &plId); // gathering a plugin id
    pluginEntryMethod(basic_suite, mavL, mivL, plId, &newRefcon) // calling the entry function
    the loaded plugin:
    A_Err EntryPointFunc(
        struct SPBasicSuite        *pica_basicP,
        A_long                     major_versionL,
        A_long                    minor_versionL,
        AEGP_PluginID            aegp_plugin_id,
        AEGP_GlobalRefcon        *global_refconP)
        *global_refconP = (AEGP_GlobalRefcon) new CustomClass(pica_basicP, aegp_plugin_id); // this is where the refcon gets invalid
        return err;
    To gather a valid plugin id, I register the plugin and assign a new AEGP_GlobalRefcon to it, which is for instance at address 0x0001234abcd (plugin-loader line 3)
    then I call the entry function(plugin-loader line 4) and the entry function creates a custom class and stores a pointer to its instance in the global_refconP pointer, which changes the address from 0x0001234abcd to 0x0a010b020c3d4.
    The crash happens later, when a hook (eg IdleHook) is called, which tries to reinterpret the refconPV-pointer of the plugin (address 0x0001234abcd) to a CustomClass-instance, because the actual instance is stored at 0x0a010b020c3d4.
    I reckon, that I can fix this if I either can change the global refcon of the plugin after the enty function has run or if I can get a valid plugin id before calling the entry function and doing the registration with the new refcon I got returned by the entry function of the loaded plugin.
    Does anyone know how to achieve one of these two goals?

  • How to create an image from another one with midp1.0 as in midp 2.0

    hi:
    we can create an image from part of another one in midp2.0 width the following method
    createImage(Image image, int x,int y,int width,int height,int transform)
    but have to work with midp1.0, then how?
    regards

    but i have six icons in one picture, (tow row ,three column, each size 14*14)
    it's ok to get the top-left icon with the following code
    Image image = Image.createImage("/myicon.png");
    Image tmp = Image.createImage(14, 14);
    Graphics g = tmp.getGraphics();
    g.drawImage(image, 0, 0, Graphics.TOP|Graphics.LEFT);
    but how to get other icon?
    regards

  • Bex exit Variable from another one.

    Hi Expert,
    Do you Know how to define a value for a variable from another that is navigable in the bex query. In other words, when i change a value during the OLAP navigation in the query, another variable must change on the basis of the first one. The first variable isn't a "variable selected from user" on the start of the query but is a "mandatory" with a default value. When the default is changed on the OLAP,  another variable must change.
    How can I do?
    Thanks.

    OK. I see - just to be sure: You dont want to call the variable screen, when making the change, right? That is how I understand it, if I am wrong, you can use an exit variable for ZC_FASCIA and fill it depending on what was set in 0calmonth variable.
    So, assuming you dont want to call the variable screen, have you tried setting the dependent variable to changeable during query navigation? I dont think it works, but anyway, try it out...
    One way of "solving" your requirement of "set value for Y when X is changed by user" could be to use a compounded characteristic where you compound ZC_FASCIA with 0calmonth. I think you should be able to compound ZC_FASCIA = 1 with 0calmonth = <blank>...
    Next, create a variable for this new char. Using a default should be possible and it would have to be changeable during query navigation and let users change the default month without calling the variable screen.
    I dont know if this works/helps...
    Regards
    Jacob
    P.S: Your requirement only seems to come from the "need" to have 0calmonth = #. If you did not need the #, you would always have 2 for ZC_FISCIA... so I was wondering why you need the blank month? Something with an annual value stored in # month??
    Edited by: Jacob Jansen on Jan 29, 2010 9:38 PM

  • [SOLVED] Bash: pkill a process after exiting from another one?

    Hi there, I use a program which calls another one, but when I close the first one, the second one is not closed automatically even if not anymore needed, so I have to do it manually.
    I tried a classic:
    firstprogram
    pkill secondprogram
    but, of course, this script closes immediately the secondprogram.
    So, what I supposed to do?
    Thank you in advance!
    Last edited by metre (2011-03-24 11:33:01)

    hbekel wrote:Hard to tell unless you show us some code or at least mention the method used to launch the subprocess. Generally you should wait(3) for your child processes to exit before exiting your parent process, or terminate the child manually when the parent exits, e.g decide yourself when it is "not needed anymore".
    thank you, I did it:
    firstprogram
    wait
    pkill secondprogram
    it works, woah

  • IWeb  Load a domain from another Mac onto my Mac

    Appreciate help given to get this far.
    I have obtained the domain I want to load but can't seem to load it.  (Domain.sites2)
    Whenever I try to load it I always get my test domain that I am using to learn iWeb.
    I am using IWeb 08 version 2.0.4.
    Not sure what version of IWeb the domain is coming from.

    What happens when you try to open the domain file?  If the domain file was created with iWeb 3 then you will have to upgrade your iWeb in order to use it.
    With that in mind the following may be of some help:
    It is now apparent that iWeb, and iDVD, will no longer be supported by Apple. This is evidenced by the fact that new Macs are shipping with iLife 11 installed but without iWeb and iDVD.  iWeb will still continue to work but without the following:
    Features No Longer Available Once MobileMe is Discontinued:
    ◼ Password protection
    ◼ Blog and photo comments
    ◼ Blog search
    ◼ Hit counter
    All of these issues can be replaced with 3rd party options.
    I found that if I published my site to a folder on my hard drive and then uploaded with a 3rd party FTP client subscriptions to slideshows and the RSS feed were broken.  If I published directly from iWeb to the FPT server those two features continued to work correctly.
    There's another problem and that's with iWeb's popup slideshows.  Once the MMe servers are no longer online the popup slideshow buttons will not display their images.
    Click to view full size
    However, Roddy McKay and I have figured out a way to modify existing sites with those slideshows and iWeb itself so that those images will display as expected once MobileMe servers are gone.  How to is described in this tutorial: #26 - How to Modify iWeb So Popup Slideshows Will Work After MobileMe is Discontinued.
    Apple has announced that iLife is now an unsupported product and those iApps will only be available thru the App Store from now on.  However, the boxed iLife 11 at the online Apple Store (Store button at the top of the page) and those still on the shelves of retailers will include iWeb and iDVD.  Those two apps were listed in small, gray text on the iLife 11 box that I bought. Personally, if I already didn't have a copy I would purchase one to have it for reinstallation purposes if ever needed.
    OT

  • Loading master data from another infoObject (generate export datasource)

    Hi All,
    We are using a 0MATERIAL that is loaded every day, and we would like to use another infoObject that contains data updated every end of last month (and ont daily).
    For instance, on 15th april, we would like use data from 31th march and not 15th april.
    We saw that we could use "Generate export datasourse" from 0MATERIAL to the nex infoObject.
    1) Is there the best solution?
    2) If yes, could you explain us how to do this (generate export datasource), because we didn't do this?
    3) Do we do this from InfoObject (0MATERIAL) or Infosource?
    Thank you.
    Edited by: Radjech Radjech on May 11, 2009 10:44 AM

    Hi,
    Check : [Generating the Master Data Export DataSource|http://help.sap.com/saphelp_nw04/helpdata/EN/11/1a5038d2c1ba03e10000009b38f8cf/frameset.htm] to generate export datasouce.
    If MATERIAL is time dependent data then, Use To Date field as selection(31st March) to load data into new infoobject. Restict at infopackage level.
    Srini

  • Calling A Form From Another One

    hi i am trying to call a form that i have constructed before named "MENU_form" from the "LOGIN" form. I have imported the "MENU_form" but i can't use it as an another frame inside the LOGIN form.
    At Login Form, after the user enters the correct usrname and password, i want to redirect the form to Menu_Form. Need your help...
    Also here is the code...
    package project;
    import java.sql.Connection;
    import java.sql.*;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import project.IConnect;
    import project.MENU_form;
    * @author buro
    public class login extends javax.swing.JFrame {
    /** Creates new form login */
    public login() {
    initComponents();
    private void initializeComponent()
    /** 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.
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">
    private void initComponents() {
    jLabel1 = new javax.swing.JLabel();
    jTextField1 = new javax.swing.JTextField();
    jTextField2 = new javax.swing.JTextField();
    jButton1 = new javax.swing.JButton();
    jLabel2 = new javax.swing.JLabel();
    jLabel3 = new javax.swing.JLabel();
    jLabel4 = new javax.swing.JLabel();
    jButton2 = new javax.swing.JButton();
    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    jLabel1.setText("KULLANICI G\u0130R\u0130S\u0130");
    jButton1.setText("G\u0130R\u0130S");
    jButton1.addMouseListener(new java.awt.event.MouseAdapter() {
    public void mouseClicked(java.awt.event.MouseEvent evt) {
    jButton1MouseClicked(evt);
    jLabel2.setText("Kullan\u0131c\u0131 Ad\u0131");
    jLabel3.setText("\u015eifre");
    jLabel4.setForeground(new java.awt.Color(255, 0, 51));
    jLabel4.setText("a");
    jButton2.setText("\u00c7IKI\u015e");
    jButton2.addMouseListener(new java.awt.event.MouseAdapter() {
    public void mouseClicked(java.awt.event.MouseEvent evt) {
    jButton2MouseClicked(evt);
    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addGap(20, 20, 20)
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
    .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE))
    .addGap(24, 24, 24)
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
    .addComponent(jTextField2, javax.swing.GroupLayout.Alignment.LEADING)
    .addComponent(jTextField1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 110, Short.MAX_VALUE)))
    .addComponent(jLabel4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 257, javax.swing.GroupLayout.PREFERRED_SIZE))
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 146, Short.MAX_VALUE)
    .addComponent(jButton2)
    .addGap(23, 23, 23))
    layout.setVerticalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addContainerGap()
    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addGap(27, 27, 27)
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addComponent(jLabel2))
    .addGap(20, 20, 20)
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addComponent(jLabel3))
    .addGap(15, 15, 15)
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
    .addComponent(jButton2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    .addComponent(jButton1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 32, Short.MAX_VALUE))
    .addGap(20, 20, 20)
    .addComponent(jLabel4)
    .addContainerGap(281, Short.MAX_VALUE))
    pack();
    }// </editor-fold>
    private void jButton2MouseClicked(java.awt.event.MouseEvent evt) {                                     
    // TODO add your handling code here:
    System.out.println("User exited application");
    System.exit(3);
    private void methodName22()
    private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {                                     
    // TODO add your handling code here:
    String nul="";
    if( (nul.equals(jTextField1.getText())) || (nul.equals(jTextField2.getText())) )
    jLabel4.setText("Bos Alanlar? Doldurunuz!!!");
    else
    String usr= jTextField1.getText();
    String pwd= jTextField2.getText();
    try {  
    Connect baglan= new Connect();
    Connection connection=baglan.Connect();
    Statement stm = connection.createStatement();
    String sql;
    //SELECT
    ResultSet rs=stm.executeQuery("select * from login where username='"+usr+"' and passwor='"+pwd+"'");
    if(rs.next()==true)
    jLabel4.setText("Success!!!");
    this.setVisible(false);
    // ************* HERE I want to call "MENU_form". HOW ??????
    else
    jLabel4.setText("fault!!!");
    } catch(Exception e)
    {  e.printStackTrace(); }//end of catch
    }//end of else
    private void initialize()
    jLabel4 = new JLabel();
    jLabel4.setText("");
    public static void main(String args[])
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    new login().setVisible(true);
    //initialize();
    // Variables declaration - do not modify
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField2;
    // End of variables declaration

    Hi,
    this is the way i am showing a password dialog: i derive this class from JDialog (not from JFrame).
    In its constructor, i make it a modal dialog.
    public class PasswordDlg extends JDialog {
    private boolean ok; // this flag should indicate whether the User has pressed OK or CANCEL
                                 // i omit the code for OK and CANCEL here...
    public PasswordDlg(JFrame owner, String DisplayText) {
         super(owner,DisplayText,true); // true -> modal!
      public boolean showDialog()
        { ok = false;
          show();
          return ok;}
    } Now in my main frame (this is derived from JFrame) in its constructor, i make an instance of my PasswordDlg, call its showDialog method, ask the password from the dialog (i have omitted this method), and then i decide, whether the program should go on or whether i call System.exit(0) in case the password is wrong.
    regards
    BugBunny

  • Calling a class from another one (newbie)

    (cib; 2003-oct28)
    Hi,
    PLugin for JSPWIKI;
    Error when calling a class from a plugin.
    Why is it wrong to call the class :
    public class XercesChecker {
    public static void main(String[] args) {
    by:
    String filepath = (fileList.getPath());
    XercesChecker xc = new XercesChecker(filepath);
    ---COMPILATION ERROR MESSAGE-------*
    javac -classpath"../;E:\prog\Tomcat41\webapps\JSPWiki\WEB-INF\lib\JSPWiki.jar"
    XercesCheckerLoopPlugin.java
    XercesCheckerLoopPlugin.java:40: cannot resolve symbol
    symbol : constructor XercesChecker (java.lang.String)
    location: class vendo.XercesChecker
    XercesChecker xc = new XercesChecker(filepath);
    ^
    1 error
    ---XercesCheckerLoopPlugin.java------*
    package vendo;
    import vendo.XercesChecker;
    import java.io.*;
    import java.io.Writer;
    import java.io.File;
    import com.ecyrd.jspwiki.WikiContext;
    import java.util.Map;
    import com.ecyrd.jspwiki.plugin.WikiPlugin;
    import com.ecyrd.jspwiki.plugin.PluginException;
    public class XercesCheckerLoopPlugin implements WikiPlugin
    StringBuffer output = new StringBuffer();
    public String execute(WikiContext context,
    Map params)
    throws PluginException
    String message="";
    // Get the names of the directory to loop through
    String dirName = (String)params.get( "dir" );
    String monresult="";
    try {
    File dirObj = new File (dirName);
    if (dirObj.exists() == true) {
    if (dirObj.isDirectory() == true) {
    // Create an array of File objects, one for each file or directory in
    dirObj.
    File [] fileList = dirObj.listFiles();
    // Display Source Directory Name.
    output.append("Source Directory: "+dirName);
    // Loop through File array and display.
    for (int i = 0; i < fileList.length; i++) {
    // Print the path to each file.
    String filepath = (fileList[i].getPath());
    output.append ("<br />D�b:" + fileList[i].getPath() + "Fin<br />" );
    XercesChecker xc = new XercesChecker(filepath);
    //output.append (xc(filepath));
    } // for loop
    } else { output.append (dirName+" is not a directory."); }
    } else { output.append ("Directory "+dirName+" does not exist."); }
    monresult = output.toString();
    catch(Exception e){}
    return monresult;
    ----------XercesChecker------------*
    package vendo;
    import org.apache.xerces.parsers.DOMParser;
    import org.xml.sax.SAXException;
    import java.io.IOException;
    //http://www.ibiblio.org/xml/books/xmljava/chapters/ch09s06.html
    public class XercesChecker {
    public static void main(String[] args) {
    if (args.length <= 0) {
    System.out.println("Usage: java XercesChecker URL");
    return;
    String document = args[0];
    DOMParser parser = new DOMParser();
    try {
    parser.parse(document);
    System.out.println(document + " is well-formed.");
    catch (SAXException e) {
    System.out.println(document + " is not well-formed.");
    catch (IOException e) {
    System.out.println(
    "Due to an IOException, the parser could not check "
    + document
    Thanks for any help
    webmaster.cib(at)laposte.net

    I do not see a constructor in the XercesChecker class that accepts a String.

  • Load java class from another directory

    Hi. I am new to Java. I am trying to load a java object from a subdirectory. Is that possible? Thanks in advance!

    Thanks for the quick reply!
    I tried this:
    set CLASSPATH =
    Data;Application;Entertainment;MiniGames;
    but it doesn't seem to work...
    The actual subdirectory is
    \Data\Application\Entertainment\MiniGames
    I am new to Java, so please bear with me with my
    stupidity... please advice again.
    Thanks in advanceClasspath needs to contain the actual directory paths, not a relative path. So it should be something like .;c:\Data\Application\Entertainment\MiniGames

  • Load video/music from another computer

    How do I add music or video from a computer other than the one I use to sync?

    If you want to connect and use an iPod on more than one computer or with more than one library you need to change the update preference in the iPod Summary tab to "Manually manage music and videos" and click Apply. The content of iTunes and the iPod are not syncronised in this mode so the two can be different. You can directly access the content of the iPod and play it through iTunes and you can drag and drop whatever you want to the iPod from either library:
    Using iPod with Multiple computers
    Managing content manually on iPod
    Syncing Music to iPod
    Something else to be aware of when using an iPod in manual mode is that the "Do Not Disconnect" message will remain on the display until you physically eject the device: Safely Disconnect IPod

  • How can i download to iphone from another one of my computers itunes?

    I just put itunes on my work PC. how can i download stuff to my iphone? I have my iphone connected to my work PC and it wont let my drag tracks to my iphone.

    You don't. The iPhone can only sync media with ONE computer. If you try to sync with another, it will first erase media already on it.

Maybe you are looking for