Netbeans nightmare Converting a JFrame  class to a JApplet Class

Hello im not exactly new to java but im having problems getting my applets to work when i try other peoples example applets they always work but mine never seem to. here is what i am doing i wrote a card game in VB6 long story short i completely rewrote it in java because only ie supports ActiveX.
It works awesome as a stand alone App whilst in Jframe and with a main() sub.
I tried about 15 tutorials on how to convert a jframe to a applet with no success i always got errors and applet never loaded in browser.
then i found these tips on how to do it "really easy" of course when my applet loads and im not sure it even really does i get nothing but a grey box i never seem my components a bunch of jlabels with icons loaded that look like card images it all looks great in the design tab of NetBeans. I never see any of the controls in browser. These are the links to the two tutorials that spawned my trying this. http://forums.java.net/jive/thread.jspa?threadID=57965&tstart=0 http://forums.java.net/jive/thread.jspa?threadID=57965&tstart=0
well to quote this guy it feels like its going to take 100 years to figure this out google has a million links to junk when i try searches and sun has no great help for searching either on their documentation. my program is rediculously low tech and i cant seem to get it to do anything or work at all as an applet.
my class looks like this: i removed all the constructor code as it was making post too long my applet shows up normal in the preview window of Netbenas but just a grey square of browser not sure whats wrong please someone help me.. Thanks You
import java.util.Random;
public class AcesKingsJApplet extends javax.swing.JApplet {
/** Initializes the applet AcesKingsJApplet */
public void init() {
try {
java.awt.EventQueue.invokeAndWait(new Runnable() {
public void run() {
initComponents();
System.out.println("InitCOmpleted");
// NewGame(1);
} catch (Exception ex) {
ex.printStackTrace();
public void TableCardClick(int arg1){
public void DiscardPileClick(int arg1){
public void PerformUndoAction(){
public void NewGame(int arg1){
//new game code here
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel12;
private javax.swing.JLabel jLabel13;
private javax.swing.JLabel jLabel14;
private javax.swing.JLabel jLabel15;
private javax.swing.JLabel jLabel16;
private javax.swing.JLabel jLabel17;
private javax.swing.JLabel jLabel18;
private javax.swing.JLabel jLabel19;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel20;
private javax.swing.JLabel jLabel21;
private javax.swing.JLabel jLabel22;
private javax.swing.JLabel jLabel23;
private javax.swing.JLabel jLabel24;
private javax.swing.JLabel jLabel25;
private javax.swing.JLabel jLabel26;
private javax.swing.JLabel jLabel27;
private javax.swing.JLabel jLabel28;
private javax.swing.JLabel jLabel29;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel30;
private javax.swing.JLabel jLabel31;
private javax.swing.JLabel jLabel32;
private javax.swing.JLabel jLabel33;
private javax.swing.JLabel jLabel34;
private javax.swing.JLabel jLabel35;
private javax.swing.JLabel jLabel36;
private javax.swing.JLabel jLabel37;
private javax.swing.JLabel jLabel38;
private javax.swing.JLabel jLabel39;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel40;
private javax.swing.JLabel jLabel41;
private javax.swing.JLabel jLabel42;
private javax.swing.JLabel jLabel43;
private javax.swing.JLabel jLabel44;
private javax.swing.JLabel jLabel45;
private javax.swing.JLabel jLabel46;
private javax.swing.JLabel jLabel47;
private javax.swing.JLabel jLabel48;
private javax.swing.JLabel jLabel49;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel50;
private javax.swing.JLabel jLabel51;
private javax.swing.JLabel jLabel52;
private javax.swing.JLabel jLabel53;
private javax.swing.JLabel jLabel54;
private javax.swing.JLabel jLabel55;
private javax.swing.JLabel jLabel56;
private javax.swing.JLabel jLabel58;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel60;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JPanel jPanel1;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField jTextField2;
private javax.swing.JTextField jTextField3;
// End of variables declaration
int tableCardIndex = 99; //array only cause it has to be or game fails
int discardPileIndex = 99;
int[] cardDeckArray = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54};
int[] cardDeckArrayPlayed = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
//int[] precheckarg1;
boolean GoAheadWithPlay;
int gameUndoCount;
int gamePlayCount;
int gameCurrentRound = 1;
int cardPointValue;
int discardCardValue;
int tableCardValue;
int tableCardsRemaining = 35;
int discardPileCards;
int currentDiscardPileCard;
int playerScore;
// loss checking variables
int badPlaysCount = 0;
// variables for undo related activity below
int[] undogamePlayCount = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
int[] undodiscardPileCards = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
int[] undocurrentDiscardPileCard = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
int[] undoMethod = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
int[] undoTableCard ={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
int[] undoDiscardCard ={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
//end undo variable collection
}

You shouldn't start a new thread when you've already created a recent one with the exact same subject matter:
[http://forums.sun.com/thread.jspa?threadID=5447497|http://forums.sun.com/thread.jspa?threadID=5447497]
And my advice in the previous thread still stands. Put your program in a JPanel so it's environment-agnostic, then create two wrappers for standalone apps and applets.
(or just use Java Web Start)
Also your program has all sorts of other problems. This is terrible coding:
private javax.swing.JLabel jLabel37;If you need lots of labels that all have the same meaning, put them in a collection. Give things meaningful names. etc.
If that code was generated by Netbeans....then this is an example why you shouldn't use code generation tools...

Similar Messages

  • Need to convert a JFrame to an jinternalframe

    Hello,
    I have an application that is comprised of 7 classes. I'm attempting to rewrite it so that the one class that I have which is for the JFrame is converted to an internal frame so that I can add the complete application to the desktop pane of a gui which I've created, to be a part of a bigger application. I've tried the code that converts JFrames to JInternalFrames but that doesn't seem to work, maybe I'm missing something here. I'm relatively new to the Java Programming world but I'm moving along. Any help is more than welcomed.

    Hello,
    I don't think you can directly convert a JFrame to JInternalFrame
    But panels are compatible
    (for example you can do this : yourJInternalFrame.setContent(yourJFrame.getContent);
    When i program in java, my main classes extends JPanel and not JFrame or JInternalFrame, then you can use this application into every frames or applets :)
    If you do that, set in your main:
    JFrame myJFrame = new JFrame(...);
    MyClass myClassWhichExtendsJPanel = new MYClass(...);
    yourJFrame.setContent(myClassWhichExtendsJPanel);

  • Creating a java thread in a jframe class?

    hello is this possible to create a thread for a jframe class? so that everytime a connection is established, a new thread along with the gui is opened automaticly? if so, would i just need to insert extends Thread on my declaration of my class?
    i already have this code at the top of my jframe class..
    public class ChatDialog extends javax.swing.JFrame implements WindowListenerwhere and how would i implement the run() method in thsi class?
    full code:
    package icomm;
    import java.net.*;
    import java.io.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    public class ChatDialog extends javax.swing.JFrame implements WindowListener {
        protected String messege;
        private Socket client_user = null;
        /** Creates new form ChatDialog */
        public ChatDialog()
            initComponents();
            addWindowListener( this );
        // <editor-fold defaultstate="collapsed" desc=" Generated Code ">
        private void initComponents() {
            jScrollPane1 = new javax.swing.JScrollPane();
            convo_txt = new javax.swing.JTextArea();
            jScrollPane2 = new javax.swing.JScrollPane();
            txt_messege = new javax.swing.JTextArea();
            send_button = new javax.swing.JButton();
            jMenuBar1 = new javax.swing.JMenuBar();
            jMenu1 = new javax.swing.JMenu();
            Option = new javax.swing.JMenu();
            getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
            jScrollPane1.setViewportView(convo_txt);
            getContentPane().add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 20, 220, 270));
            jScrollPane2.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
            txt_messege.setLineWrap(true);
            jScrollPane2.setViewportView(txt_messege);
            getContentPane().add(jScrollPane2, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 310, 220, 70));
            send_button.setText("Send");
            send_button.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    send_buttonActionPerformed(evt);
            getContentPane().add(send_button, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 390, -1, -1));
            jMenu1.setText("File");
            jMenuBar1.add(jMenu1);
            Option.setText("Option");
            jMenuBar1.add(Option);
            setJMenuBar(jMenuBar1);
            pack();
        // </editor-fold>
        private void send_buttonActionPerformed(java.awt.event.ActionEvent evt) {                                           
            //get txt from textbox   
            String text = txt_messege.getText();
        public void windowClosing(WindowEvent e)
            public void windowActivated(WindowEvent e) {}
         public void windowClosed(WindowEvent e) {}
         public void windowDeactivated(WindowEvent e) {}
         public void windowDeiconified(WindowEvent e) {}
         public void windowIconified(WindowEvent e) {}
          public void windowOpened(WindowEvent e)
         * @param args the command line arguments
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new ChatDialog().setVisible(true);
        // Variables declaration - do not modify
        private javax.swing.JMenu Option;
        private javax.swing.JTextArea convo_txt;
        private javax.swing.JMenu jMenu1;
        private javax.swing.JMenuBar jMenuBar1;
        private javax.swing.JScrollPane jScrollPane1;
        private javax.swing.JScrollPane jScrollPane2;
        private javax.swing.JButton send_button;
        private javax.swing.JTextArea txt_messege;
        // End of variables declaration
    }

    Instead of attempting to have the frame extend thread (or implement Runnable which is actually possible since you cannot have multiple inferitance). You might want to just create the frame and have that frame lauch an associated thread to take care of the processing required.

  • Problem with setContentPane() in JFrame class

    I recently discovered a problem with the setContentPane method in the JFrame class. When I use setContentPane(Container ..), the previously existing contentPane remains in the stack. I have tried nullifying getContentPane(), and all manner of things, but, each time I use setContentPane, I have another instance of a JPanel in the stack.
    I'm using code similar to setContentPane(new CustomJPanel()); and each time the user changes screens, and a similar call to that is made, the old CustomJPanel instance remains in the stack. Can anyone suggest a way around this? On their own the panels do not take up very much memory, but after several hours of usage, they will build up.

    I tried what you suggested; it only resulted in a huge performance decrease. The problem with memory allocation is still there.
    Here is the method I use to switch screens in my app:
    public static void changeScreen (JPanel panel){
              try{
                   appFrame.setTitle("Wordinary : \""+getTitle()+"\"");
                   appFrame.setContentPane(panel);
                   appFrame.setSize(appFrame.getContentPane().getPreferredSize());     
                   appFrame.getContentPane().setBackground(backColour);
                   for (int i = 0; i < appFrame.getContentPane().getComponents().length; i++)
                        appFrame.getContentPane().getComponents().setForeground(textColour);
                   //System.out.println("Background colour set to "+backColour+" text colour set to "+textColour);
                   appFrame.validate();
              catch (Exception e){
                   //System.out.println("change");
                   e.printStackTrace();
    And it is called like this:
    changeScreen(new AddWordPanel());The instantiation of the new instance is what is causing the memory problems, but I can't think of a way around it.

  • Cannot convert ÿØÿà of type class java.lang.String to class BFileDomain.

    Hi All,
    I am using Jdeveloper 11.1.2.3.0.
    I have a scenario of making an ADF page where I have a IMAGE field to show on the page. So,I have a table called "PRODUCT" with fields called photo with BFILE type. Now when I the data i have inserted using the DML command and i can see the path at the backend.
    However,when i am runnig my ADF page in the Filed called "PHOTO" I can only see a junk character stating 'yoyo'.
    When I click on it, it says ERROR "Cannot convert ÿØÿà of type class java.lang.String to class oracle.jbo.domain.BFileDomain".
    Your help will be appreciated ASAP.
    Regards,
    Shahnawaz

    Hi,
    did you show the id-value in the user interface as a input-component, and did the input-component include a converter?
    If yes, show the id as output-text and remove any existing converter-components.
    Best Regards

  • Problem with JFrame class.

    To risolve my problem i need for few diferent frame
    ( for esample in one i put JTextFild that take the user input, in a nother one i need for program output ) . But, th problem is, all my frames using the same object.
    If i construct diferent JFrame window class i have problem that i don't acess in the same object from all the window. And if i dont use a object, i have static acess .
    I risolve the problem with 1 JFrame class with diferent constructors, but i wont a diferent way to risolve my problem, because there are few windows.
    Help me.....

    Make the class that extends JFrame an inner class of the the main class. You can then access all members of the outer class.

  • XML file in the form of .config file how to convert it to class and store it in single object

    Hi,
    I have a config file in which i have to convert it to class and get an object.
    example:
    <?xml version="1.0" encoding="utf-8" ?>
    <xyz xmlns="">
      <Container name ="Basic">
        <Connectivity user="" server="" protocol="udp"/>
        <Connectivity user="" server="" protocol="udp"/>
      </Container>
      <Container name ="Cp">
        <settings version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.counterpath.com/cps">
          <domain name="audio">
            <section name="headset">
              <setting name="audio_in_agc_enabled " value="1"/>
            </section>
            <section name="incoming">
              <setting name="use_agc" value="1"/>
            </section>
            <section name="vad">
            </section>
          </domain>
          <domain name="system">
            <section name="qos">
              <setting name="audio" value="tos 46"/>
            </section>
            <section name="dtmf">
              <setting name="force_send_in_band" value="0"/>
              <setting name="minimum_rfc2833_play_time" value="40"/>
            </section>
            <section name="network">
              <setting name="dtx_enabled" value="0"/>
            </section>
            <section name="diagnostics">
              <setting name="enable_logging" value="1"/>
              <setting name="log_level" value="Error"/>
            </section>
            <section name="general">
              <setting name="add_OS_version_to_user_agent_header" value="1"/>
            </section>
            <section name="indialog_notify">
              <setting name="enable_indialognotify" value="1"/>
            </section>
          </domain>
          <domain name="rtp">
            <section name="2833">
              <setting name="enabled" value="1"/>
              <setting name="packet_time_in_ms" value="60"/>
              <setting name="payload_number" value="101"/>
            </section>
            <section name="inactivity">
              <setting name="timer_enabled" value="0"/>
            </section>
          </domain>
          <domain name="proxies">
            <section name="proxy0">
            </section>
            <section name="proxy1">
            </section>
          </domain>
          <domain name="ggg">
            <section name="device">
              <setting name="use_headset" value="1"/>
              <setting name="rrr" value="1"/>
              <setting name="eee" value="480"/>
              <setting name="eme" value="hhh"/>
              <setting name="headset_name" value="vvv"/>
              <setting name="manual_audio_devices_configure" value="0"/>
              <setting name="audio_in_device" value=""/>
              <setting name="audio_out_device" value=""/>
              <setting name="ringer_device" value=""/>
            </section>
            <section name="system">
              <setting name="export_settings" value="EndpointSettings.xml"/>
              <setting name="enable_export_settings" value="0"/>
              <setting name="log_level_AbstractPhone" value="0"/>
              <setting name="log_level_Audio" value="0"/>
              <setting name="log_level_Auto Configuration" value="0"/>
              <setting name="log_level_CCM" value="0"/>
              <setting name="log_level_Conferencing" value="0"/>
              <setting name="log_level_Contacts" value="0"/>
              <setting name="log_level_DNS" value="0"/>
              <setting name="log_level_GUI" value="0"/>
              <setting name="log_level_Jitter" value="0"/>
              <setting name="log_level_Licensing" value="0"/>
              <setting name="log_level_Media" value="0"/>
              <setting name="log_level_Privacy" value="0"/>
              <setting name="log_level_RTP" value="0"/>
              <setting name="log_level_STUN" value="0"/>
              <setting name="log_level_Security" value="0"/>
              <setting name="log_level_Storage" value="0"/>
              <setting name="log_level_Transport" value="0"/>
              <setting name="log_level_USB Devices" value="Info"/>
              <setting name="log_level_Utilities" value="0"/>
              <setting name="log_level_Video" value="0"/>
              <setting name="log_level_Voice Quality" value="0"/>
              <setting name="log_level_XMPP" value="0"/>
              <setting name="log_level_Endpoint" value="6"/>
            </section>
            <section name="beeptone">
              <setting name="play_locally" value="0"/>
              <setting name="enable_beeptone" value="1"/>
              <setting name="beeptone_file" value="beep.wav"/>
              <setting name="beeptone_timeout" value="30000"/>
            </section>
            <section name="dtmf">
              <setting name="play_locally" value="1"/>
              <setting name="pause_start_stop_dtmf" value="100"/>
            </section>
            <section name="control">
              <setting name="auto_answer" value="0"/>
            </section>
            <section name="ctrol">
              <setting name="auto_ans" value="0"/>
            </section>
          </domain>
        </settings>
      </Container>
    </xyz>
    Please help me out in creating an object from it.
    Thanks,
    Hiranmayee

    It's one of those things you usually start from the other end.
    IE with a class and then serialise / deserialize to xml.
    Because you have a namespace in there:
    <settings version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.counterpath.com/cps">
    I think you will find linq to xml will have issues with that.
    You could still use xpath to pick data out of there and there's been a thread on the c# forum recently which is relevent:
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/2dc0581e-f2fd-4fd3-89ee-e59280c398e6/read-xml?forum=csharpgeneral
    Why do you want to turn that into an object?
    By the way.
    This isn't a wpf question and you should probably have posted it on the c# forum.
    Hope that helps.
    Recent Technet articles: Property List Editing;
    Dynamic XAML

  • How to convert JSP Compiled class file back to JSP

    Is their any way to convert the JSP converted class file back into JSP file, I have few JSP files missing in my application but i do have class files deployed corresponding to the JSP file. Is their any way where i can convert my JSP class file back to JSP. I tried used decompliers but it conerts the class file into JAVA files, Is their any such decompiler that converts the JSP converted class file into Java files.
    Thanks in Advance.

    nope...its not et al possible...!!!
    You cant convert class file back to JSP....!!

  • Doubt in processing of  statements after calling JFrame class

    I have two java classes.
    The first one is Normal class and the second one is a JFrame class.
    In the first Class, i created an object for second JFrame class followed by a set of statements.
    Based on the input from the second class, i must process the statements, the problem i am facing is after creating the object for second frame class , the first class continues execution of the remaining statements. I must stop the execution of the statements until i get an input from the second class.
    How can i make the first class wait for an input from the second class.
    if possible provide me some source code.
    Thanks for your help!.

    Use a modal JDialog instead of a JFrame.
    db

  • Converting String to Class?

    I'm trying to convert a String to a Class name and then instantiate an object from that class. It's proving to be quite difficult. I have a Query object which is a superclass and has several subclasses, one of which is CommonQuery. Here's my code so far. Basically I need "c" to be the specific type of Query that it should be. What am I doing wrong?
    for(Query q:results)
                Class cl = Class.forName(myClass);//myClass is the String that I'd like to convert to a class, CommonQuery for example
                Constructor ct = cl.getConstructor(new Class[]{Query.class});//Query is the superclass but they all have the same constructor
                Query c = (Query)(ct.newInstance(new Object[]{q.getWords(),q.getFile()}));
                c.computeRank();
                unsorted.add(c);
    }

    This is the error that I'm getting:
    Exception in thread "main" java.lang.NoSuchMethodException: nano.CommonQuery.<init>(nano.Query)
         at java.lang.Class.getConstructor0(Unknown Source)
         at java.lang.Class.getConstructor(Unknown Source)I guess this is what you meant about not overriding the constructors. How do I get the constructor from a class that I don't know what it is yet?
    What goes in here where I have Query.class?
    Constructor ct = cl.getConstructor(new Class[]{Query.class});I'm not familiar with the reflection forums. Should I go post in there now?

  • Beginner: Can't convert a hello.class file into a jar file: HELP PLEASE!!!

    Hi, I created a hello.java file, converted into a hello.class file by using the java 2SDk compiler. The problem is that the hello.class file is in a directory I created: C:\JavaBuilder\hello.class
    I have a problem converting the hello class file into a jar file. I don't know which approach to take. I've looked at tutorials...but I keep getting more confused each time I view the tutorials on creating jar files. Please can someone help..by taking me through a step by step process. Please be explicit and do not leave or assume that I know any details because I'm a new born beginner. Thank you very much, I seriously appreciate it.

    Hi i did as you suggested, only with these exceptions:
    jar -cvf hello.jar C:\JavaBuilder\hello.class
    I did this and got the message: "adding : C:\JavaBuilder\hello.class (in=1150) (out=708) (deflated=38%)"
    The problem is that when I tried to execute the jar file...by typing: " java -jar hello.jar" I received the error message: "Failed to load Main-Class Manifest attribute from hello.jar" Is there any way to correct this problem? please help, thank you.

  • How sholud we call one jframe class from another jframe class

    Hi
    In my application i am calling one jframe class from another jframe clas.
    how sholud we make previous jframe inactve when another jframe is invoked?(user sholud not able to make any changes on on parent jframe window when another jframe is invoked)
    Pls reply.

    Sorry for me it is not possible to change existing code,
    pls suggest me any other solution so that i can inactive parent jframe when child jframe execution is going on.

  • Why we extends JFrame class in java

    Hello Java Developers,
    I am new to Java & Currently I am trying my hands on Java Swings.
    I wrote a very simple program in Java to display a JFrame on screen. My code is as follows:
    import javax.swing.*;
    public class JavaFrame {
    public static void main(String args[]){
    JFrame frame = new JFrame();
    frame.setTitle("My Frame");
    frame.setSize(400, 150);
    frame.setLocation(300, 300);
    frame.setVisible(true);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    I saw some examples on internet & they are extending "JFrame" in their every example. I want to know what is the benefit of this ??? here is code:
    import javax.swing.*;
    public class JavaFrame extends JFrame {
    public static void main(String args[]){
    JFrame frame = new JFrame();
    frame.setTitle("My Frame");
    frame.setSize(400, 150);
    frame.setLocation(300, 300);
    frame.setVisible(true);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    My second question is what is the meaning of line "frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);"
    frame - This object of class created by me.
    setDefaultCloseOperation() - This is predefined method in JFrame class.
    JFrame.EXIT_ON_CLOSE - what is the meaning of this ??

    I saw in JFrame API as you suggested & I found that
    EXIT_ON_CLOSE is an "public static final" method.Look again. It's not a method.
    final: this mehod must be executed
    am I right ???No. final means that the value cannot be reassigned.
    Use code tags to post codes -- [code]CODE[/code] will display asCODEOr click the CODE button and paste your code between the {code} tags that appear.
    db

  • No option to convert control to class

    Hi,
    I got fairly deep into a project here and realized that I really ought to make one of my controls into a class (I want to flatten it to an XML file to save it, and unflatten to load even if the control has been updated).
    I was under the impression that it should be fairly straightforward, according to the help file on the subject, but when I go to the project explorer and try to right-click the control, I get no such option.  Not even greyed out.  See attached picture... I censored some file names for company confidentiality but the right click menu and project explorer are visible.
    I am using LabVIEW 2011 SP1 on Windows 7 64-bit.
    I am using this control in 37 VIs according to the "find callers" option so I am really hoping to not have to manually replace it and all of the wires to it in every single one.
    Any ideas?
    Attachments:
    labview no convert control to class.png ‏35 KB

    Not a single one of my controls can be converted to a class.  Even if I create a new project and a new control with just a couple things in it.
    The control in question has a bunch of other controls in it (7 enums, 3 U8s, 2 booleans, and a string) as well as an array of strings and 3 arrays of other custom controls.  But seeing as how even the most primitive control doesn't work, I don't think this is the issue.
    The control and all sub-controls are currently strict typedefs, but like I said, any new control with just one numeric in it also has this same issue, so this is also probably not the issue.
    No x-controls.
    The control isn't part of an existing class, so it's not private.  It nor any control it contains is locked.
    I checked, and despite being a 64-bit version of Windows 7 the LabVIEW version I have is 32-bit.

  • Beginner: Can't convert a hello.class file into a jar file. Please Help!!!

    Hi, I created a hello.java file, converted into a hello.class file by using the java 2SDk compiler. The problem is that the hello.class file is in a directory I created: C:\JavaBuilder\hello.class
    I have a problem converting the hello class file into a jar file. I don't know which approach to take. I've looked at tutorials...but I keep getting more confused each time I view the tutorials on creating jar files. Please can someone help..by taking me through a step by step process. Please be explicit and do not leave or assume that I know any details because I'm a new born beginner. Thank you very much, I seriously appreciate it.

    Hi!
    first of all, you should use an upper-case character for the first letter of your classes...
    To answer your question :
    1) you must create a directory named "meta-inf" in your directory "C:\JavaBuilder"
    2) then,you must create a file named "manifest.mf" in this directory
    it's like a property file and it must contain this :
    Main-Class: hello
    (don't forget to type <enter> after "hello")
    3) in the directory "C:\JavaBuilder", you can enter the following command :
    "jar cvfM hello.jar meta-inf\manifest.mf hello.class"
    (check jar.exe is in your path)
    4) you can run your jar by the command :
    "java -jar hello.jar"

Maybe you are looking for