JBuilder code...

Hello everybody,
I've written a program in JBuilder wich can store encrypted passwords in a textfile. It works fine when using the 'run project' function in JBuilder, but when i try to compile or run it in the std DOS jdk I'm getting the error: 'NoClassDefFound'. This is propably thanks to some JBuilder specific classes.
Since i'm not plannning on rewriting my whole program, is there anyway to make my JBuilder code exportable???
I'm very desperate so please help,
Jasper

the class that it can't find may be something that you have imported for your program. your classpath needs to tell java where to find any classes you are using, as well as those you have written, in order for it to run.
try using the same classpath that JBuilder uses. when you run your project in JBuilder, the message pane at the bottom should say something like:
C:\JBldr\bin\javaw -classpath "c:\blah\wibble.jar;c:\foo\bar.jar ... "
that classpath must be working if you can run from within JBuilder, so you could try copying the whole classpath string and using it in your javac/java calls from the DOS window. in theory that should work - let us know if you have any success

Similar Messages

  • JTable Column Headers are Squashed!

    Hi there,
    I'm using JBuilder, and have created a simple enough JTable that I place inside a JScrollPane. I am using my own implementation of the AbstractTable model.
    When I run the code, the Column headers are only about 5 pixels high! I have hunted around the JBuilder code (which if you have used JBuilder you will know is extensive!), but it doesn't seem to be doing anything extraordinary.
    So has anyone else had this problem? If so, what did you do to rectify.
    Yours hopefully
    Richard

    Hello there, my abstract implementation looks a little like this:
      public static final String columns[] = { "", "Request Id", "Date", "Component Name", "Version", "Type" };
      public String getColumnName(int columnIndex) {
        return columns[columnIndex];
      public Class getColumnClass(int columnIndex) {
        if (columnIndex == 0) {
          return Boolean.class;
        } else if (columnIndex == 1) {
          return Integer.class;
        } else {
          return String.class;
      }Thanks
    Richard

  • Applet loading as seperate window

    Hi,
    I'm porting jEdit's help system into an applet form. Its complete, except for an annoyance - it loads as a seperate window, leaving a dead HTML page behind. I'd like to instead embed the applet inside the HTML page, so I can have a link create a popup window. As it is now, if you close the HTML page it closes the applet.
    I used the generic jBuilder code to create the applet, and added this like to start()
    HelpViewer frame = new HelpViewer();
    The GUI is created using in the HelpViewer's constructor:
    /** HelpViewer
    * Creates a new HelpViewer for specified URL
    * @param URL
    public HelpViewer(String url)
    this.setTitle("Insight Help");
    utilities = MiscUtilities.getInstance();
    // Chack if valid URL
    try
    // Check if protocal included
    new URL(url).getProtocol();
    // Valid protocol, so if pointing to specific HTML file, remove
    Log.log(Log.ERROR, this, "Parse URL for hostname");
    catch (MalformedURLException e)
    // No protocol - therefore assume local
    if (e.getMessage().startsWith("no protocol"))
    baseURL = utilities.getRemoteURL() + "/docs/";
    else
    Log.log(Log.ERROR, this, e.getMessage());
    //Set to error page?
    // Create history
    history = new String[25];
    ActionHandler actionListener = new ActionHandler();
    // Setup tabs
    JTabbedPane tabs = new JTabbedPane();
    tabs.addTab("Contents", toc = new HelpTOCPanel(this));
    tabs.addTab("Search", new HelpSearchPanel(this));
    tabs.addTab("Glossary", new HelpGlossary(this));
    tabs.setMinimumSize(new Dimension(0,0));
    // Setup toolbar
    JToolBar toolBar = new JToolBar();
    toolBar.setFloatable(false);
    toolBar.add(title = new JLabel()); // title of current page
    toolBar.add(Box.createGlue());
    JPanel buttons = new JPanel();
    buttons.setLayout(new BoxLayout(buttons,BoxLayout.X_AXIS));
    buttons.setBorder(new EmptyBorder(0,12,0,0));
    // Add back button
    back = new JButton(utilities.loadIcon("ArrowL.png"));
    back.setToolTipText("Back");
    back.addActionListener(actionListener);
    toolBar.add(back);
    // Add forward button
    forward = new JButton(utilities.loadIcon("ArrowR.png"));
    forward.setToolTipText("Forward");
    forward.addActionListener(actionListener);
    toolBar.add(forward);
    back.setPreferredSize(forward.getPreferredSize());
    // Add home button
    home = new JButton(utilities.loadIcon("Home.png"));
    home.setToolTipText("Home");
    home.addActionListener(actionListener);
    toolBar.add(home);
    // Add toolbar to panel
    JPanel rightPanel = new JPanel(new BorderLayout());
    rightPanel.add(BorderLayout.NORTH,toolBar);
    // Setup Viewer Panel
    viewer = new JEditorPane();
    viewer.setEditable(false);
    viewer.addHyperlinkListener(new LinkHandler());
    viewer.setFont(new Font("Monospaced",Font.PLAIN,12));
    viewer.addPropertyChangeListener(new PropertyChangeHandler());
    rightPanel.add(BorderLayout.CENTER,new JScrollPane(viewer));
    // Split Pane
    splitter = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, tabs, rightPanel);
    splitter.setBorder(null);
    getContentPane().add(BorderLayout.CENTER,splitter);
    setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    getRootPane().setPreferredSize(new Dimension(750,500));
    pack(); // causes window to fit the preferred size
    setVisible(true);
    SwingUtilities.invokeLater(new Runnable()
    public void run()
    splitter.setDividerLocation(250);
    viewer.requestFocus();
    gotoURL(url,true);
    Any advice would be appreciated!
    -Ben

    There are 2 possible solution.
    1. Do not leave that window empty. I.e. write there a message "DO NOT CLOSE THIS WINDOW"
    2. Do not open new frame. Add all components to your applet. This is not very difficult.

  • JBuilder Question -  Where do i put the code?

    I am building a jList using the designer in
    Jbuilder. In what event procedure do i put the
    code that assigns an array and so on?
    thanks for any help
    maggie evans

    Typically you'll code the initial population of UI components in the jbInit method. If you want to dynamically populate the list as a result of a selectable UI component being clicked then put the code in the action performed method for the 'clicked' component.

  • Trying to figure out why code is inoperable in Jbuilder

    Dear Fellow Programmers,
    Yesterday, I went to a site that contained sample java code. I found a basic construct for a simple "Hello World" Gui. I proceeded to copy and paste the code into the jbuilder edit window. However, the program would not compile until I made certain changes to the code. Additionally, I learned a great deal during the debugging process.
    I will the list the original code-listing first, and the altered listing second.
    I guess if there is anyone willing to help, I need to know if the code used in jbuilder is program specific. Basically, do you have to make changes to regular java code in order for it to work in JBUILDER?
    import java.applet.*;
    import java.awt.*;
    public class HelloWorld extends Applet
    public void init()
    public void stop()
    public void paint(Graphics g)
    g.drawString("Hey hey hey",20,20);
    g.drawString("Hellooow World",20,40);
    IN ORDER TO GET THE ABOVE CODE TO COMPILE/RUN, I HAD TO MAKE THE FOLLOWING CHANGES:
    package test2;
    import java.awt.*;
    //import java.awt.event.*;
    import java.applet.*;
    import javax.swing.*;
    public class SIMPLE extends JApplet
    boolean isStandalone = false;
    /**Get a parameter value*/
    public String getParameter(String key, String def) {
    return isStandalone ? System.getProperty(key, def) :
    (getParameter(key) != null ? getParameter(key) : def);
    public SIMPLE() {
    public void init(){
    try {
    jbInit();
    catch(Exception e) {
    e.printStackTrace();
    public void stop()
    private void jbInit() throws Exception {
    this.getContentPane().setBackground(Color.red);
    /**Main method*/
    // I HAD TO ADD THIS MAIN FUNCTION TO RUN THE PROGRAM FROM THE COMMAND LINE
    public static void main(String[] args) {
    SIMPLE applet = new SIMPLE();
    applet.isStandalone = true;
    JFrame frame = new JFrame();
    //EXIT_ON_CLOSE == 3
    frame.setDefaultCloseOperation(3);
    frame.setTitle("I CAN'T WORK");
    frame.getContentPane().add(applet, BorderLayout.CENTER);
    applet.init();
    applet.start();
    frame.setSize(400,320);
    Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
    frame.setLocation((d.width - frame.getSize().width) / 2, (d.height - frame.getSize().height) / 2);
    frame.setVisible(true);

    The example that you were trying to run was an Applet.
    The first line tells you this:
    public class HelloWorld extends Applet
    It requires that it be run within a browser.
    The sample you wrote is a stand alone application. It contains a main method. It runs from the console.

  • Jbuilder + Apache ADF = free production license code?

    Can I use Jbuilder with the Apache ADF components to create production use code with a no cost license?
    Can the Oracle 10G database be used at any level of production use with a no cost license?
    Is J2EE required for code developed end to end on Jbuilder?
    Thanks,
    JOD

    JBuilder is a Borland product which costs money.
    If you are talking about JDeveloper - than JDeveloper is free - and you can use any free libraries in it such as the Apache components.
    The only thing to be aware of is that the ADF Framework has a cost if you deploy it to non Oracle application servers.
    As far as the database goes there is the free Oracle XE database - it has some limitation in its license and features - you can read about this when you download it.
    For more information on JDeveloper and ADF pricing google for "JDeveloper pricing FAQ".

  • I can't get this command line code to work in JBuilder...

    Dear Experts,
    I built a simple JAVA program, in JBuilder, that displays a GUI with a label. It works when I am in JBuilder clicking on the Run button. But when I try to run
    "-classpath /[home]/ jbProject/ProjectNameRob/RobClasses ProjectNameRob.RobClsJav" from the command line I get this message:
    "Could not create Java Virtual Machine."
    I am in the jdk/bin directory and I still can't figure out how this thing works. Could the experts come forth and help me with this problem?
    Thank you,
    Robert L. Perkins

    Well, this won't be an exact answer for you because I'm not sure which run of "java -cp ...." did it for me, but I was able to get a run of a class in JBuilder 3.0 from the command line.
    I created a project called test_1.jpr. It has the following 3 files:
    Controller.java // contains a main( ) method
    test_1.html
    Test1.java // extends from JFrame
    On my system, the directory structure is:
    C:\JBuilder3\myclasses\test_1
    Tried:
    C:\JBuilder3\myclasses\test_1>java Controller // no good
    C:\JBuilder3\myclasses>java test1.Controller // no good
    C:\JBuilder3\myclasses>java -cp %CLASSPATH%;C:\JBuilder3\myclasses Controller // no good
    C:\JBuilder3\myclasses>java -cp %CLASSPATH%;c:\JBuilder3\myclasses\test_1 Controller // no good
    C:\JBuilder3\myclasses>java -cp %CLASSPATH%;C:\jbuild~1\myclas~1\test_1\Controller
    That resulted in the "usage" output to appear for the "java" .exe. But right after that, I did:
    C:\JBuilder3\myclasses>java test_1.Controller
    and wham, the application ran fine. I'm running Windows 98 SE, if that helps. Probably won't help you much, but I just kept messing around with it and then it worked. Voodoo.
    HTH
    Jeff

  • Old school code :-(

    Hey,
    I been writing my game and wanted to show somone my game. However i can only get the newer java vm to work on his computer. Well i been writing my code for an older version becuase JBuilder wouldnt configure properly.
    Well, the game works but the buttons dont work and i get a white background instead of black in the newer java vm. but everything works in the old one.
    Well i want to update my code to the newest java VM.
    The one i been using is:
    java version "1.2"
    Classic VM (build JDK-1.2-V, native threads)
    ok, i post my code and i be most thankfulif you can show me where i need to modify the code. There are images in the program which i feel are not needed, so if you wanna compile it and run it, just use random images or block the code that does it so it can be tested
    OK, thanks in advance, sorry for the length of the program but i kinda kept it tidy and readable.
    ALso sorry its not documented :-(
    ====spacy.java=================
    //Title:      Space Shooter
    //Version:   
    //Copyright:  Copyright (c) 2004
    //Author:     Tom Lorentsen
    //Company:    MATX Software
    //Description:Space shooter game
    package spacy;
    import javax.swing.UIManager;
    import java.awt.*;
    public class spacy {
      boolean packFrame = false;
      //Construct the application
      public spacy() {
        game frame = new game();
        //Validate frames that have preset sizes
        //Pack frames that have useful preferred size info, e.g. from their layout
        if (packFrame)
          frame.pack();
        else
          frame.validate();
        //Center the window
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        Dimension frameSize = frame.getSize();
        if (frameSize.height > screenSize.height)
          frameSize.height = screenSize.height;
        if (frameSize.width > screenSize.width)
          frameSize.width = screenSize.width;
        frame.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2);
        frame.setBackground(Color.black);
        frame.setVisible(true);
      //Main method
      public static void main(String[] args) {
        //try  {
          //UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        //catch(Exception e) {
        new spacy();
    ====game.java==================
    //Title:      Space Shooter
    //Version:
    //Copyright:  Copyright (c) 2004
    //Author:     Tom Lorentsen
    //Company:    MATX Software
    //Description:Space shooter game
    package spacy;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.GraphicsDevice;
    import java.util.Random;
    import java.applet.*;
    import java.io.*;
    import java.net.URL;
    public class game extends JFrame {
      BorderLayout borderLayout1 = new BorderLayout();
      CardLayout cc = new CardLayout();
      int gamespeed = 20;
      boolean ismenu = true;
      boolean isgame = false;
      int menuspace = -10;
      int menuchoice = 0;
      MediaTracker track = new MediaTracker(this);
      Image[] title = new Image[1];
      Image[] spaceships = new Image[10];
      Image[] planets = new Image[10];
      int[][] spaceshipsize = new int[10][2];
      boolean[] keys = new boolean[256];
      int[] playerpos = {10, 200};
      int weapon = 0;
      String[] weaponname = {"Laser","Dual Laser","Chain Gun","Flak","Homer","Blaster","Rail Gun","Bomb","9","10"};
      int[] weaponpower = { 1,1,1,4,4,4,15,15,1,1};
      int[] weaponammo = {0,0,100,100,100,100,100,100,100,100};
      int[] shield = {50,100,1};
      int[] chaingunpos = {0,0};
      int[][] playerlasers = new int[100][6];
      long bullettime = System.currentTimeMillis();
      int[][] ship = new int[100][5];
      long[] shiplasertimer = new long[100];
      int[] packet = {0,0,0};
      Random r = new Random();
      int maxship = 1;
      long score = 0;
      int level = 0;
      long nextscore = 1000;
      long multiplyertime = 0;
      int multiplyer = 1;
      boolean multiplyerok = false;
      boolean sleepy = false;
      int[][] shipspecs = {//Hits, Speed, Points, laser, timer
                          {  1   , 1    , 1     , 0        },
                          {  2   , 3    , 100   , 0         },
                          {  4   , 6    , 200   , 0         },
                          {  6   , 2    , 300   , 0         },
      int spacepos = 0;
      int[][] planetpos = {{100,200,0},{600,300,1},{1000,150,2},{1500,200,0}};
      Graphics bufferGraphics;
      Image offscreen;
      Dimension dim;
      Font bigtext = new Font("Tahoma",Font.BOLD,20);
      Font smalltext = new Font("Tahoma",Font.BOLD,12);
      //Construct the frame
      public game() {
        enableEvents(AWTEvent.WINDOW_EVENT_MASK);
        try  {
          jbInit();
        catch(Exception e) {
          e.printStackTrace();
      //Component initialization
      private void jbInit() throws Exception  {
        this.getContentPane().setLayout(borderLayout1);
        this.getContentPane().setBackground(Color.black);
        this.setSize(new Dimension(600, 500));
        this.setTitle(".:Space Shooter:.");
        addKeyListener(new java.awt.event.KeyAdapter() {
          public void keyPressed(KeyEvent e) {
            this_keyPressed(e);
          public void keyReleased(KeyEvent e) {
            this_keyReleased(e);
        new Thread(new display()).start();
        new Thread(new animatemenu()).start();
        new Thread(new menuchoiceselection()).start();
        Toolkit kit = Toolkit.getDefaultToolkit();
        spaceships[0] = kit.getImage("littleship.gif");
        //URL imageResource = getClass().getResource("/littleship.gif");
          //spaceships[0] = kit.getImage(imageResource);
        track.addImage(spaceships[0],0);
        spaceships[1] = kit.getImage("littleship1.gif");
        //imageResource = getClass().getResource("/littleship1.gif");
          //spaceships[1] = kit.getImage(imageResource);
        track.addImage(spaceships[1],1);
        spaceships[2] = kit.getImage("littleship2.gif");
        //imageResource = getClass().getResource("/littleship2.gif");
          //spaceships[2] = kit.getImage(imageResource);
        track.addImage(spaceships[2],2);
        spaceships[3] = kit.getImage("littleship3.gif");
        //imageResource = getClass().getResource("/littleship3.gif");
          //spaceships[3] = kit.getImage(imageResource);
        track.addImage(spaceships[3],3);
        planets[0] = kit.getImage("planet1.jpg");
        //imageResource = getClass().getResource("/planet1.gif");
          //spaceships[4] = kit.getImage(imageResource);
        track.addImage(planets[0],4);
        planets[1] = kit.getImage("planet2.jpg");
        //imageResource = getClass().getResource("/planet2.gif");
          //spaceships[5] = kit.getImage(imageResource);
        track.addImage(planets[1],5);
        planets[2] = kit.getImage("planet3.jpg");
        //imageResource = getClass().getResource("/planet2.gif");
          //spaceships[5] = kit.getImage(imageResource);
        track.addImage(planets[2],6);
        title[0] = kit.getImage("spaceshooter.gif");
        track.addImage(title[0],7);
        System.out.println("Loading map images");
        try {
          track.waitForAll();
        } catch (InterruptedException e){}
        System.out.println("Loaded map images");
        spaceshipsize[0][0] = 20;
        spaceshipsize[0][1] = 20;
        spaceshipsize[1][0] = 15;
        spaceshipsize[1][1] = 15;
        spaceshipsize[2][0] = 15;
        spaceshipsize[2][1] = 20;
        spaceshipsize[3][0] = 25;
        spaceshipsize[3][1] = 32;
        //this.getContentPane().add(jPanel1, BorderLayout.CENTER);
        this.getContentPane().setLayout(cc);
        jPanel1.setBackground(Color.black);
        jPanel2.setBackground(Color.black);
        this.getContentPane().add(jPanel1, "jPanel1");
        this.getContentPane().add(jPanel2, "jPanel2");
        cc.show(this.getContentPane(),"jPanel1");
      //Overridden so we can exit on System Close
      protected void processWindowEvent(WindowEvent e) {
        super.processWindowEvent(e);
        if(e.getID() == WindowEvent.WINDOW_CLOSING) {
          System.exit(0);
      JPanel jPanel1 = new JPanel() {
        public void paintComponent(Graphics g) {
          Graphics2D c = (Graphics2D)g;
          c.clearRect(0,0,jPanel1.getWidth(),jPanel1.getHeight());
          c.setColor(Color.blue);
          c.fillRoundRect((jPanel1.getWidth()/2)-50,186 + (menuchoice*20),100,20,5,5);
          c.setColor(Color.black);
          //c.drawLine(menuspace,100,menuspace+10,105);
          //c.drawLine(menuspace,110,menuspace+10,105);
          c.drawImage(spaceships[0],menuspace,105,this);
          c.setColor(Color.white);
          c.drawImage(title[0],(jPanel1.getWidth() - 482)/2,20,this);
          c.drawString("START",(jPanel1.getWidth()/2)-20,200);
          c.drawString("CONTINUE",(jPanel1.getWidth()/2)-32,220);
          c.drawString("HIGH SCORES",(jPanel1.getWidth()/2)-44,240);
          c.drawString("OPTIONS",(jPanel1.getWidth()/2)-28,260);
          c.drawString("CHEATS",(jPanel1.getWidth()/2)-24,280);
          c.drawString("EXIT",(jPanel1.getWidth()/2)-16,300);
          c.drawString("Programming by Thomas Lorentsen",(jPanel1.getWidth()/2)-104,jPanel1.getHeight()-20);
          c.drawString("Graphics by Craig Taft",(jPanel1.getWidth()/2)-77,jPanel1.getHeight()-5);
    //-------------------------panel------------------------------------------------
      JPanel jPanel2 = new JPanel() {
        public void paintComponent(Graphics g) {
          dim = getSize();
          offscreen = createImage(dim.width,dim.height);
          bufferGraphics = offscreen.getGraphics();
          Graphics2D c = (Graphics2D)g;
          bufferGraphics.clearRect(0,0,dim.width,dim.height);
          for (int i = 0; i!=4;i++) {
            if (-50 < planetpos[1] && 600 > planetpos[i][1]) {
    bufferGraphics.drawImage(planets[planetpos[i][2]],planetpos[i][0]-spacepos,planetpos[i][1],this);
    //bufferGraphics.clearRect(0,0,jPanel2.getWidth(),jPanel2.getHeight());
    bufferGraphics.setColor(Color.white);
    bufferGraphics.drawImage(spaceships[0],playerpos[0]-15,playerpos[1]-15,this);
    if (weapon == 2) {
    bufferGraphics.drawLine(playerpos[0]+7,playerpos[1]+chaingunpos[0],playerpos[0]+11,playerpos[1]+chaingunpos[0]);
    for (int i = 0; i != 100; i++) {
    if (playerlasers[i][0] > 0) {
    if(playerlasers[i][2] == 0) {
    bufferGraphics.setColor(Color.yellow);
    bufferGraphics.drawLine(playerlasers[i][0]-5,playerlasers[i][1],playerlasers[i][0],playerlasers[i][1]);
    else if(playerlasers[i][2] == 1) {
    bufferGraphics.setColor(Color.green);
    bufferGraphics.drawLine(playerlasers[i][0]-5,playerlasers[i][1],playerlasers[i][0],playerlasers[i][1]);
    else if(playerlasers[i][2] == 2) {
    bufferGraphics.setColor(Color.getHSBColor(100,100,20));
    bufferGraphics.drawLine(playerlasers[i][0]-3,playerlasers[i][1],playerlasers[i][0],playerlasers[i][1]);
    else if(playerlasers[i][2] == 3) {
    bufferGraphics.setColor(Color.white);
    bufferGraphics.drawLine(playerlasers[i][0]-3,playerlasers[i][1],playerlasers[i][0],playerlasers[i][1]);
    else if(playerlasers[i][2] == 4) {
    bufferGraphics.setColor(Color.green);
    bufferGraphics.drawLine(playerlasers[i][0]-5,playerlasers[i][1]-2,playerlasers[i][0],playerlasers[i][1]);
    bufferGraphics.drawLine(playerlasers[i][0]-5,playerlasers[i][1]+2,playerlasers[i][0],playerlasers[i][1]);
    //bufferGraphics.drawString("Ship: " + playerlasers[3],playerlasers[i][0],playerlasers[i][1]+15);
    else if(playerlasers[i][2] == 5) {
    bufferGraphics.setColor(Color.yellow);
    bufferGraphics.drawRoundRect(playerlasers[i][0]-1,playerlasers[i][1]-1,3,3,3,3);
    bufferGraphics.setColor(Color.red);
    bufferGraphics.drawRect(playerlasers[i][0],playerlasers[i][1],0,0);
    else if(playerlasers[i][2] == 6) {
    bufferGraphics.setColor(Color.yellow);
    bufferGraphics.drawLine(playerlasers[i][0]-5,playerlasers[i][1],playerlasers[i][0],playerlasers[i][1]);
    bufferGraphics.setColor(Color.yellow);
    bufferGraphics.drawLine(playerlasers[i][0]+playerlasers[i][3],playerlasers[i][1],playerlasers[i][0]+playerlasers[i][3]+5,playerlasers[i][1]+5);
    else if(playerlasers[i][2] == 7) {
    bufferGraphics.setColor(Color.yellow);
    bufferGraphics.drawRoundRect(playerlasers[i][0]-5,playerlasers[i][1]-5,10,10,5,5);
    bufferGraphics.setColor(Color.yellow);
    //Enemy lasers
    else if(playerlasers[i][2] == 50) {
    bufferGraphics.setColor(Color.green);
    bufferGraphics.drawLine(playerlasers[i][0],playerlasers[i][1],playerlasers[i][0]-5,playerlasers[i][1]);
    if (packet[0] > 0) {
    bufferGraphics.setColor(Color.yellow);
    bufferGraphics.fillRect(packet[0],packet[1]-5,10,10);
    bufferGraphics.setColor(Color.white);
    for (int i = 0; i != 50; i++) {
    if (ship[i][0] > 0) {
    bufferGraphics.drawImage(spaceships[ship[i][2]],ship[i][0],ship[i][1]-15 ,this);
    //else {
    //break;
    bufferGraphics.setFont(bigtext);
    bufferGraphics.drawString("Score: " + score + " X " + multiplyer, 20, 20);
    bufferGraphics.drawString("Level: " + level, 500, 20);
    bufferGraphics.drawString("Weapon: " + weaponname[weapon], 300, 20);
    bufferGraphics.setFont(smalltext);
    bufferGraphics.drawRect(75,25,shield[1],14);
    bufferGraphics.drawString("Shield",25,38);
    bufferGraphics.fillRect(75,25,shield[0],14);
    bufferGraphics.setFont(smalltext);
    bufferGraphics.drawRect(260,25,weaponammo[weapon],14);
    bufferGraphics.drawString("Ammo",200,38);
    bufferGraphics.fillRect(260,25,weaponammo[weapon],14);
    bufferGraphics.setColor(Color.black);
    bufferGraphics.drawString(""+weaponammo[weapon],270,38);
    if (keys[107] == true || keys[109] == true) {
    bufferGraphics.setColor(Color.green);
    bufferGraphics.drawString("Speed: " + gamespeed, 250,250);
    c.drawImage(offscreen,0,0,this);
    class display implements Runnable {
    public void run() {
    Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
    while(true) {
    repaint();
    //try {
    //Thread.sleep(1);
    //} catch (InterruptedException e){}
    //sleepy = false;
    class animatemenu implements Runnable {
    public void run() {
    while(ismenu == true) {
    try {
    Thread.sleep(1000);
    } catch (InterruptedException e){}
    menuspace+=10;
    if (menuspace > jPanel1.getWidth()) {
    menuspace = -10;
    //=============================GAME=============================================
    class gamebuttons implements Runnable {
    boolean slowdown = false;
    private long timer = 0;
    public void run() {
    //Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
    while(isgame == true) {
    for (int i = 0; i != 100; i++) {
    if (playerlasers[i][0] > 500 || playerlasers[i][0] < 0) {
    playerlasers[i][0] = 0;
    else if (playerlasers[i][0] > 0) {
    if (playerlasers[i][2] == 3) {
    playerlasers[i][1]+=playerlasers[i][3];
    playerlasers[i][0]+=10;
    if (playerlasers[i][2] == 4) {
    if (ship[playerlasers[i][3]][0] < playerlasers[i][0]) {
    int pX = playerlasers[i][0];
    int pY = playerlasers[i][1];
    int closeNdx = -1;
    int closeSq = Integer.MAX_VALUE;
    for (int ii = 0; ii != maxship; ii++) {
    int dx = pX - ship[ii][0];
    int dy = pY - ship[ii][1];
    int distSq = dx * dx + dy * dy;
    if (distSq < closeSq) {
    closeNdx = ii;
    closeSq = distSq;
    playerlasers[i][3] = closeNdx;
    playerlasers[i][0]+=5;
    else {
    int temp1 = ship[playerlasers[i][3]][0]-playerlasers[i][0];
    int temp2 = ship[playerlasers[i][3]][1]-playerlasers[i][1];
    playerlasers[i][0]+=5;
    if (temp1 != 1 && temp1 != 0 && temp2 != 0) {
    playerlasers[i][1]+= temp2/5;
    if (playerlasers[i][2] == 7) {
    if (ship[playerlasers[i][3]][0] < playerlasers[i][0]) {
    int pX = playerlasers[i][0];
    int pY = playerlasers[i][1];
    int closeNdx = -1;
    int closeSq = Integer.MAX_VALUE;
    for (int ii = 0; ii != maxship; ii++) {
    int dx = pX - ship[ii][0];
    int dy = pY - ship[ii][1];
    int distSq = dx * dx + dy * dy;
    if (distSq < closeSq) {
    closeNdx = ii;
    closeSq = distSq;
    playerlasers[i][4] = closeNdx;
    playerlasers[i][0]+=5;
    else {
    int temp1 = ship[playerlasers[i][4]][0]-playerlasers[i][0];
    int temp2 = ship[playerlasers[i][4]][1]-playerlasers[i][1];
    playerlasers[i][0]+=5;
    if (temp1 != 1 && temp1 != 0 && temp2 != 0) {
    playerlasers[i][1]+= temp2/5;
    else if (playerlasers[i][2] == 6) {
    playerlasers[i][0]+=10;
    if (playerlasers[i][3] == 4)
    playerlasers[i][3] = -1;
    playerlasers[i][3]++;
    else if (playerlasers[i][2] == 50) {
    playerlasers[i][0]-=playerlasers[i][3];
    else {
    playerlasers[i][0]+=10;
    for (int ii = 0; ii != maxship; ii++){
    if (playerlasers[i][0] != 0 && playerlasers[i][0] > ship[ii][0]-spaceshipsize[ship[ii][2]][0] && playerlasers[i][0] < ship[ii][0]+spaceshipsize[ship[ii][2]][0] && playerlasers[i][1] > ship[ii][1]-spaceshipsize[ship[ii][2]][1] && playerlasers[i][1] < ship[ii][1]+spaceshipsize[ship[ii][2]][1] && playerlasers[i][2] < 50){
    ship[ii][3]-= weaponpower[weapon];
    if (playerlasers[i][2] == 7) {
    littlemines(playerlasers[i][0],playerlasers[i][1],shipspecs[ship[ii][2]][0],playerlasers[i][3]);
    if (ship[ii][3] <= 0) {
    ship[ii][0] = 0;
    if (multiplyertime > System.currentTimeMillis()) {
    multiplyer++;
    multiplyerok = true;
    new Thread(new multiply()).start();
    multiplyertime = System.currentTimeMillis()+1000;
    //maxship++;
    score+= shipspecs[ship[ii][2]][2]*multiplyer;
    if (score >= nextscore) {
    level++;
    nextscore*=2;
    maxship++;
    playerlasers[i][0] = 0;
    playerlasers[i][1] = 0;
    playerlasers[i][2] = 0;
    playerlasers[i][3] = 0;
    else if (playerlasers[i][0] != 0 && playerlasers[i][0] > playerpos[0]-spaceshipsize[0][0] && playerlasers[i][0] < playerpos[0]+spaceshipsize[0][0] && playerlasers[i][1] > playerpos[1]-spaceshipsize[0][1] && playerlasers[i][1] < playerpos[1]+spaceshipsize[0][1] && playerlasers[i][2] > 49) {
    shield[0] = 0;
    for (int i = 0; i != maxship; i++) {
    if (ship[i][0] <= 0) {
    ship[i][0] = 500;
    ship[i][1] = r.nextInt(400)+50;
    ship[i][2] = r.nextInt(3)+1;
    ship[i][3] = shipspecs[ship[i][2]][0];
    break;
    else {
    ship[i][0]-=shipspecs[ship[i][2]][1];
    if (r.nextInt(50) == 0 && shiplasertimer[i] < System.currentTimeMillis()) {
    enemylaser(i);
    if (r.nextInt(100) == 0 && packet[0] == 0) {
    packet[0] = 500;
    packet[1] = r.nextInt(400)+50;
    packet[2] = 1;
    if (packet[0] <= 0) {
    packet[0] = 0;
    else if (packet[0] >0) {
    packet[0]-=1;
    if (packet[0] > playerpos[0]-spaceshipsize[0][0] && packet[0] < playerpos[0]+spaceshipsize[0][0] && packet[1] > playerpos[1]-spaceshipsize[0][1] && packet[1] < playerpos[1]+spaceshipsize[0][1]) {
    packet[0] = 0;
    weaponammo[weapon]+=100;
    if (keys[32] == true && bullettime < System.currentTimeMillis()) {
    if (weapon == 0 && shield[0] > 10)
    laser();
    else if (weapon == 1 && shield[0] > 20)
    duallaser();
    else if (weapon == 2 && weaponammo[weapon] > 1)
    chaingun();
    else if (weapon == 3 && weaponammo[weapon] > 1)
    flak();
    else if (weapon == 4 && weaponammo[weapon] > 1)
    homer();
    else if (weapon == 5 && weaponammo[weapon] > 1)
    blaster();
    else if (weapon == 6 && weaponammo[weapon] > 1)
    railgun();
    else if (weapon == 7 && weaponammo[weapon] > 1)
    mine();
    if (shield[0] < shield[1])
    shield[0]+= shield[2];
    if (keys[38] == true && playerpos[1] > 50) {
    playerpos[1]-=5;
    else if (keys[40] == true && playerpos[1] < 450) {
    playerpos[1]+=5;
    if (keys[37] == true && playerpos[0] > 30) {
    playerpos[0]-=3;
    else if (keys[39] == true && playerpos[0] < 500) {
    playerpos[0]+=3;
    if (keys[49] == true) {
    weapon = 0;
    else if (keys[50] == true) {
    weapon = 1;
    else if (keys[51] == true) {
    weapon = 2;
    else if (keys[52] == true) {
    weapon = 3;
    else if (keys[53] == true) {
    weapon = 4;
    else if (keys[54] == true) {
    weapon = 5;
    else if (keys[55] == true) {
    weapon = 6;
    else if (keys[56] == true) {
    weapon = 7;
    else if (keys[57] == true) {
    weapon = 8;
    else if (keys[58] == true) {
    weapon = 9;
    else if (keys[48] == true) {
    weapon = 10;
    else if (keys[97] == true) {
    weaponammo[weapon]+=100;
    else if (keys[98] == true) {
    score+=1000;
    else if (keys[99] == true) {
    level++;
    else if (keys[100] == true) {
    maxship++;
    else if (keys[101] == true) {
    shield[2]++;
    else if (keys[107] == true) {
    gamespeed++;
    else if (keys[109] == true && gamespeed > 1) {
    gamespeed--;
    else if (keys[27] == true && gamespeed > 1) {
    isgame = false;
    ismenu = true;
    menuchoice = 1;
    new Thread(new animatemenu()).start();
    new Thread(new menuchoiceselection()).start();
    setpanel("jPanel1");
    try {
    Thread.sleep(gamespeed);
    } catch (InterruptedException e){}
    spacepos+=1;
    if (spacepos > 1600)
    spacepos = 0;
    class multiply implements Runnable {
    public void run() {
    //Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
    multiplyerok = false;
    try {
    Thread.sleep(1000);
    } catch (InterruptedException ie) {}
    if (multiplyerok == false) {
    multiplyer = 1;
    class menuchoiceselection implements Runnable {
    public void run() {
    Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
    while(ismenu == true) {
    try {
    Thread.sleep(1);
    } catch (InterruptedException e){}
    if (keys[38] == true && menuchoice > 0) {
    menuchoice--;
    try {
    Thread.sleep(200);
    } catch (InterruptedException e){}
    else if (keys[40] == true && menuchoice < 5) {
    menuchoice++;
    try {
    Thread.sleep(200);
    } catch (InterruptedException e){}
    else if (keys[10] == true && menuchoice == 0) {
    System.out.println("Play");
    ismenu = false;
    isgame = true;
    reset();
    //new Thread(new bg()).start();
    new Thread(new gamebuttons()).start();
    //new Thread(new animategame()).start();
    setpanel("jPanel2");
    else if (keys[10] == true && menuchoice == 1) {
    System.out.println("Continue");
    ismenu = false;
    isgame = true;
    //new Thread(new bg()).start();
    new Thread(new gamebuttons()).start();
    //new Thread(new animategame()).start();
    setpanel("jPanel2");
    else if (keys[10] == true && menuchoice == 2) {
    System.out.println("High scores");
    else if (keys[10] == true && menuchoice == 3) {
    System.out.println("Options");
    else if (keys[10] == true && menuchoice == 4) {
    System.out.println("Cheats");
    cheat();
    else if (keys[10] == true && menuchoice == 5) {
    System.out.println("BOOM");
    System.exit(0);
    void this_keyPressed(KeyEvent e) {
    keys[e.getKeyCode()] = true;
    //System.out.println("Key: \t" + e.getKeyCode());
    void this_keyReleased(KeyEvent e) {
    keys[e.getKeyCode()] = false;
    void setpanel(String panel) {
    cc.show(this.getContentPane(),panel);
    void cheat() {
    String cheater = JOptionPane.showInputDialog(this,"Enter Cheat","Cheat",JOptionPane.QUESTION_MESSAGE);
    if (cheater.equals("giveall")) {
    String ok = JOptionPane.showInputDialog(this,"Cheat Accepted","Cheat",JOptionPane.OK_OPTION);
    void laser() {
    bullettime = System.currentTimeMillis()+250;
    for (int i = 0; i!=100;i++) {
    if (playerlasers[i][0] == 0){
    playerlasers[i][0] = playerpos[0]+20;
    playerlasers[i][1] = playerpos[1];
    playerlasers[i][2] = 0;
    shield[0]-=10;
    break;
    void duallaser() {
    bullettime = System.currentTimeMillis()+250;
    int count = 0;
    for (int i = 0; i!=100;i++) {
    if (playerlasers[i][0] == 0){
    if (count == 0) {
    playerlasers[i][0] = playerpos[0]+20;
    playerlasers[i][1] = playerpos[1]-5;
    playerlasers[i][2] = 1;
    count++;
    else if (count == 1) {
    playerlasers[i][0] = playerpos[0]+20;
    playerlasers[i][1] = playerpos[1] +5;
    playerlasers[i][2] = 1;
    shield[0]-=20;
    break;
    void chaingun(){
    bullettime = System.currentTimeMillis()+100;
    if (chaingunpos[0] >= 8)
    chaingunpos[1] = 1;
    else if (chaingunpos[0] <= -8)
    chaingunpos[1] = 0;
    if (chaingunpos[1] == 0)
    chaingunpos[0]+= 3;
    else if (chaingunpos[1] == 1)
    chaingunpos[0]-= 3;
    for (int i = 0; i!=100;i++) {
    if (playerlasers[i][0] == 0){
    playerlasers[i][0] = playerpos[0]+20;
    playerlasers[i][1] = playerpos[1]+chaingunpos[0];
    playerlasers[i][2] = 2;
    weaponammo[weapon]--;
    break;
    void flak(){
    bullettime = System.currentTimeMillis()+1000;
    int count = -10;
    for (int i = 0; i!=100;i++) {
    if (playerlasers[i][0] == 0){
    if (count < 5) {
    //playerlasers[i][0] = playerpos[0]+20;
    //playerlasers[i][1] = playerpos[1]+count;
    playerlasers[i][0] = playerpos[0]+r.nextInt(10)+10;
    playerlasers[i][1] = playerpos[1]+(r.nextInt(10)-5);
    playerlasers[i][2] = 3;
    playerlasers[i][3] = count;
    if (count == 10) {
    weaponammo[weapon]-=10;
    break;
    count+=2;
    void homer() {
    bullettime = System.currentTimeMillis()+500;
    int[] small = {10000,10000};
    for (int i = 0; i!=100;i++) {
    if (playerlasers[i][0] == 0){
    playerlasers[i][0] = playerpos[0]+20;
    playerlasers[i][1] = playerpos[1];
    playerlasers[i][2] = 4;
    weaponammo[weapon]-=1;
    int pX = playerpos[0];
    int pY = playerpos[1];
    int closeNdx = -1;
    int closeSq = Integer.MAX_VALUE;
    for (int ii = 0; ii != maxship; ii++) {
    int dx = pX - ship[ii][0];
    int dy = pY - ship[ii][1];
    int distSq = dx * dx + dy * dy;
    if (distSq < closeSq) {
    closeNdx = ii;
    closeSq = distSq;
    playerlasers[i][3] = closeNdx;
    break;
    void blaster() {
    bullettime = System.currentTimeMillis()+100;
    for (int i = 0; i!=100;i++) {
    if (playerlasers[i][0] == 0){
    playerlasers[i][0] = playerpos[0]+20;
    playerlasers[i][1] = playerpos[1]+(r.nextInt(5)-2);
    playerlasers[i][2] = 5;
    weaponammo[weapon]--;
    break;
    void railgun() {
    bullettime = System.currentTimeMillis()+300;
    for (int i = 0; i!=100;i++) {
    if (playerlasers[i][0] == 0){
    playerlasers[i][0] = playerpos[0]+20;
    playerlasers[i][1] = playerpos[1];
    playerlasers[i][2] = 6;
    playerl

    Did you get any compile errors?
    Are you getting any messages/exceptions at runtime?
    The same code, compiled with a jdk 1.2 works fine?
    (( You've tested this.. (my thought is that maybe somewhere you changed something but didn't recompile that has no broken execution...) you've compiled those specific files with the old jdk, just to make sure))

  • Applet working on JBuilder but not on appletviewer!!!!!

    I ve made a keybord.Here some buttons are missing. The user presses the buttons and shapes a word!When the jButton22 is pressed(Comparison button) the applet tells him if the result is true or false and displays an image(imageIcon foruser in jlabel forusers) with the correct result!!The jlabel for users is setVisible(false) and setVisible(true) when the comparison button is pressed and the result is wrong.My problem is that the jlabel works fine in JBuilder but when i run the applet in appletviewer the jlabel forusers isnt showing!!If i minimize and maximize the window then the label appears and from that point is working properly!Any suggestions would be appreciated!Thank you!!
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import javax.swing.*;
    public class Applet5 extends Applet {
    JLabel frase = new JLabel();
    JLabel forusers = new JLabel();
    JLabel string = new JLabel();
    JLabel message = new JLabel();
    JLabel plikt = new JLabel();
    JLabel gram = new JLabel();
    JLabel sint = new JLabel();
    JLabel vrah = new JLabel();
    JLabel end = new JLabel();
    JLabel dior = new JLabel();
    JLabel befforusers = new JLabel();
    JLabel[] jLabel = new JLabel[6];
    ImageIcon myIcon1 = new ImageIcon((Applet5.class.getResource("drawing/1.jpg")));
    ImageIcon myIcon2 = new ImageIcon((Applet5.class.getResource("drawing/2.jpg")));
    ImageIcon myIcon3 = new ImageIcon((Applet5.class.getResource("drawing/3.jpg")));
    ImageIcon myIcon4 = new ImageIcon((Applet5.class.getResource("drawing/4.jpg")));
    ImageIcon myIcon5 = new ImageIcon((Applet5.class.getResource("drawing/5.jpg")));
         ImageIcon foruser1 = new ImageIcon((Applet5.class.getResource("foruser/foruser1.jpg")));
         ImageIcon foruser2 = new ImageIcon((Applet5.class.getResource("foruser/foruser2.jpg")));
         ImageIcon foruser3 = new ImageIcon((Applet5.class.getResource("foruser/foruser3.jpg")));
         ImageIcon foruser4 = new ImageIcon((Applet5.class.getResource("foruser/foruser4.jpg")));
         ImageIcon foruser5 = new ImageIcon((Applet5.class.getResource("foruser/foruser5.jpg")));
        ImageIcon frases1= new ImageIcon((Applet5.class.getResource("frase/frase1.jpg")));
        ImageIcon frases2= new ImageIcon((Applet5.class.getResource("frase/frase2.jpg")));
        ImageIcon frases3= new ImageIcon((Applet5.class.getResource("frase/frase3.jpg")));
        ImageIcon frases4= new ImageIcon((Applet5.class.getResource("frase/frase4.jpg")));
        ImageIcon frases5= new ImageIcon((Applet5.class.getResource("frase/frase5.jpg")));
    ImageIcon telos = new ImageIcon((Applet5.class.getResource("end/telos.jpg")));
    ImageIcon diorth = new ImageIcon((Applet5.class.getResource("dior/dior.jpg")));
    String[] user= new String[6];
    JButton jButton1 = new JButton("1..");
    JButton jButton2 = new JButton("2..");
    JButton jButton3 = new JButton("3..");
    JButton jButton4 = new JButton("4..");
    JButton jButton5 = new JButton("5..");
    JButton jButton21 = new JButton("��������");
    JButton jButton22 = new JButton("��������");
    JButton jButton23 = new JButton("����������");
    JButton jButton24 = new JButton("������� ������");
    JButton jButton25 = new JButton("������");
    Font f = new Font("Palatino LinoType", Font.PLAIN, 18);
    Font g = new Font("TimesRoman", Font.PLAIN, 0);
    Font c = new Font("Palatino Linotype",Font.PLAIN, 14);
    Font p = new Font("Palatino Linotype",Font.PLAIN, 14);
    String s = new String();
    int nextLabelToShowIcon = 1;
    int l=0;
    int current = 0;
    int cur = 0;
    int str = 1;
    FlowLayout flowLayout1 = new FlowLayout();
        public void init() {
          try {
                    jbInit();
                  catch(Exception e) {
                    e.printStackTrace();
         user[1]=new String("82."+"ken"+"62."+"82."+"59."+"77."+"82."+"94."+"ken"+"107"+"127"+"77."+"ken"
             +"151"+"ken"+"1.."+"69."+"107"+"53."+"93."+"59."+"82."+"94."+"ken"+"30."+"1.."+"13."+"82."+"114"
             +"82."+"94.");
          user[2]=new String("1.."+"66."+"23."+"ken"+"74."+"31."+"77."+"ken"+"82."+"ken"+"30."+"62."+"1.."
           +"59."+"82."+"94."+"ken"+"62."+"1.."+"59."+"ken"+"82."+"114"+"62."+"ken"+"1.."+"77."+"ken"+"107"+"59."+"94."
           +"ken"+"1.."+"93."+"77."+"53."+"99."+"82.");
          user[3]=new String("59."+"77."+"2.."+"ken"+"107"+"59."+"ken"+"30."+"ken"+"31."+"74."+"31."+"ken"+"29."
           +"46."+"82."+"107"+"2.."+"ken"+"107"+"82."+"ken"+"82."+"77."+"82."+"74."+"1.."+"ken"+"94."+"82."+"114"
           +"ken"+"13."+"65."+"1.."+"94."+"123"+"53."+"74."+"38."+"107"+"1.."+"59.");
          user[4]=new String("74."+"35."+"1.."+"65."+"127"+"94."+"ken"+"82."+"ken"+"159"+"ken"+"109"+"120"
           +"ken"+"82."+"59."+"62."+"38."+"82."+"120"+"ken"+"107"+"59."+"74."+"2.."+"ken"+"56."+"31."+"93."+"1.."
           +"85."+"82."+"77."+"107"+"2.."+"94.");
    jLabel[1] = new JLabel();
    jLabel[2] = new JLabel();
    jLabel[3] = new JLabel();
    jLabel[4] = new JLabel();
    jLabel[5] = new JLabel();
    jButton1.setPreferredSize(new Dimension(32, 30));
    jButton1.setIcon(myIcon1);
    jButton1.setFont(g);
    jButton1.setVerticalTextPosition(SwingConstants.CENTER);
    jButton1.setHorizontalTextPosition(SwingConstants.CENTER);
    jButton1.addActionListener(new Applet5_jButton1_actionAdapter(this));
    jButton2.setPreferredSize(new Dimension(32, 30));
    jButton2.setIcon(myIcon2);
    jButton2.setFont(g);
    jButton2.setVerticalTextPosition(SwingConstants.CENTER);
    jButton2.setHorizontalTextPosition(SwingConstants.CENTER);
    jButton2.addActionListener(new Applet5_jButton2_actionAdapter(this));
    jButton3.setPreferredSize(new Dimension(32, 30));
    jButton3.setIcon(myIcon3);
    jButton3.setFont(g);
    jButton3.setVerticalTextPosition(SwingConstants.CENTER);
    jButton3.setHorizontalTextPosition(SwingConstants.CENTER);
    jButton3.addActionListener(new Applet5_jButton3_actionAdapter(this));
    jButton4.setPreferredSize(new Dimension(36, 30));
    jButton4.setIcon(myIcon4);
    jButton4.setFont(g);
    jButton4.setVerticalTextPosition(SwingConstants.CENTER);
    jButton4.setHorizontalTextPosition(SwingConstants.CENTER);
    jButton4.addActionListener(new Applet5_jButton4_actionAdapter(this));
    jButton5.setPreferredSize(new Dimension(37, 30));
    jButton5.setIcon(myIcon5);
    jButton5.setVerticalTextPosition(SwingConstants.CENTER);
    jButton5.setHorizontalTextPosition(SwingConstants.CENTER);
    jButton5.setFont(g);
    jButton5.addActionListener(new Applet5_jButton5_actionAdapter(this));
    jButton21.addActionListener(new Applet5_jButton21_actionAdapter(this));
    jButton22.addActionListener(new Applet5_jButton22_actionAdapter(this));
    jButton23.addActionListener(new Applet5_jButton23_actionAdapter(this));
    jButton24.addActionListener(new Applet5_jButton24_actionAdapter(this));
    jButton25.addActionListener(new Applet5_jButton25_actionAdapter(this));
    frase.setIcon(frases1);
    frase.setPreferredSize(new Dimension(750,40));
    message.setPreferredSize(new Dimension(220, 30));
    befforusers.setPreferredSize(new Dimension(1000,50));
    forusers.setIcon(foruser1);
    forusers.setPreferredSize(new Dimension(1000,50));
    forusers.setVisible(false);
    end.setPreferredSize(new Dimension(210,30));
    end.setVisible(false);
    dior.setIcon(diorth);
    dior.setPreferredSize(new Dimension(81,30));
    dior.setVisible(false);
    plikt.setText("������������");
    gram.setText("�������� & ���������� ���������");
    sint.setText("����������");
    vrah.setText("������������");
    message.setFont(p);
    plikt.setFont(f);
    gram.setFont(c);
    sint.setFont(c);
    vrah.setFont(c);
    string.setVisible(false);
    this.setLayout(flowLayout1);
    jLabel[1].setPreferredSize(new Dimension(50, 50));
    jLabel[2].setPreferredSize(new Dimension(50, 50));
    jLabel[3].setPreferredSize(new Dimension(50, 50));
    jLabel[4].setPreferredSize(new Dimension(50, 50));
    jLabel[5].setPreferredSize(new Dimension(50, 50));
    this.add(plikt);
    this.add(gram);
    this.add(jButton1);
    this.add(jButton2);
    this.add(jButton3);
    this.add(jButton4);
    this.add(jButton5);
    this.add(dior);
    this.add(jButton21);
    this.add(jButton22);
    this.add(jButton23);
    this.add(jButton24);
    this.add(jButton25);
    this.add(end);
    this.add(frase);
    this.add(message);
    this.add(befforusers);
    this.add(forusers);
    this.add(jLabel[1]);
    this.add(jLabel[2]);
    this.add(jLabel[3]);
    this.add(jLabel[4]);
    this.add(jLabel[5]);
    this.add(string);
    private void next2(){
    if(str==0);
    string.setText(user[1]);
    if(str==1)
       string.setText(user[2]);
    if(str==2)
       string.setText(user[3]);
    if(str==3);
    string.setText(user[4]);
    if(str==4)
       string.setText(user[5]);
    str++;
      private void next1(){
        if(cur==0)
      forusers.setIcon(foruser2);
      else if(cur==1)
      forusers.setIcon(foruser3);
      else if(cur==2)
      forusers.setIcon(foruser4);
      else if(cur==3)
      forusers.setIcon(foruser5);
      else if(cur==4)
      forusers.setIcon(foruser6);
        cur++;
      private void next(){
        if(current==0)
    frase.setIcon(frases2);
    else if(current==1)
    frase.setIcon(frases3);
    else if(current==2)
    frase.setIcon(frases4);
    else if(current==3)
    frase.setIcon(frases5);
    current++;
    void jButton1_actionPerformed(ActionEvent e)  {
    if (nextLabelToShowIcon == 1)
    jLabel[1].setIcon(myIcon1);
    else if (nextLabelToShowIcon == 2)
    jLabel[2].setIcon(myIcon1);
    else if (nextLabelToShowIcon == 3)
    jLabel[3].setIcon(myIcon1);
    else if (nextLabelToShowIcon == 4)
    jLabel[4].setIcon(myIcon1);
    else if (nextLabelToShowIcon == 5)
    jLabel[5].setIcon(myIcon1);
    s = s + jButton1.getText();
    nextLabelToShowIcon++;l++; jButton21.setVisible(true); dior.setVisible(false);
    void jButton2_actionPerformed(ActionEvent e)  {
    if (nextLabelToShowIcon == 1)
    jLabel[1].setIcon(myIcon2);
    else if (nextLabelToShowIcon == 2)
    jLabel[2].setIcon(myIcon2);
    else if (nextLabelToShowIcon == 3)
    jLabel[3].setIcon(myIcon2);
    else if (nextLabelToShowIcon == 4)
    jLabel[4].setIcon(myIcon2);
    else if (nextLabelToShowIcon == 5)
    jLabel[5].setIcon(myIcon2);
    s = s + jButton2.getText();
    nextLabelToShowIcon++;l++; jButton21.setVisible(true); dior.setVisible(false);}
    void jButton3_actionPerformed(ActionEvent e)  {
    if (nextLabelToShowIcon == 1)
    jLabel[1].setIcon(myIcon3);
    else if (nextLabelToShowIcon == 2)
    jLabel[2].setIcon(myIcon3);
    else if (nextLabelToShowIcon == 3)
    jLabel[3].setIcon(myIcon3);
    else if (nextLabelToShowIcon == 4)
    jLabel[4].setIcon(myIcon3);
    else if (nextLabelToShowIcon == 5)
    jLabel[5].setIcon(myIcon3);
    s = s + jButton3.getText();
    nextLabelToShowIcon++;l++; jButton21.setVisible(true); dior.setVisible(false);}
    void jButton4_actionPerformed(ActionEvent e)  {
    if (nextLabelToShowIcon == 1)
    jLabel[1].setIcon(myIcon4);
    else if (nextLabelToShowIcon == 2)
    jLabel[2].setIcon(myIcon4);
    else if (nextLabelToShowIcon == 3)
    jLabel[3].setIcon(myIcon4);
    else if (nextLabelToShowIcon == 4)
    jLabel[4].setIcon(myIcon4);
    else if (nextLabelToShowIcon == 5)
    jLabel[5].setIcon(myIcon4);
    s = s + jButton4.getText();
    nextLabelToShowIcon++;l++; jButton21.setVisible(true); dior.setVisible(false);}
    void jButton5_actionPerformed(ActionEvent e)  {
    if (nextLabelToShowIcon == 1)
    jLabel[1].setIcon(myIcon5);
    else if (nextLabelToShowIcon == 2)
    jLabel[2].setIcon(myIcon5);
    else if (nextLabelToShowIcon == 3)
    jLabel[3].setIcon(myIcon5);
    else if (nextLabelToShowIcon == 4)
    jLabel[4].setIcon(myIcon5);
    else if (nextLabelToShowIcon == 5)
    jLabel[5].setIcon(myIcon5);
    s = s + jButton5.getText();
    nextLabelToShowIcon++;l++; jButton21.setVisible(true); dior.setVisible(false);}
    void jButton21_actionPerformed(ActionEvent e) {
    if(nextLabelToShowIcon>1){
    jLabel[l].setIcon(null);
    s = s.substring(0, s.length()-3);
    l = l - 1;
    nextLabelToShowIcon = nextLabelToShowIcon - 1;}
    else{
    jButton21.setVisible(false);
    dior.setVisible(true);
    l=0;
    s="";
    nextLabelToShowIcon=1;}
    void jButton22_actionPerformed(ActionEvent e) {
    if(s.length()>0){
        if (s.equals(user[str])) {
          message.setText("������ ����� �����");
        else {
          forusers.getIcon();
          forusers.setVisible(true);
          befforusers.setVisible(false);
          message.setText("�����. � ����� ������� ����� : ");
    repaint();
    jButton1.setDisabledIcon(myIcon1);
    jButton2.setDisabledIcon(myIcon2);
    jButton3.setDisabledIcon(myIcon3);
    jButton4.setDisabledIcon(myIcon4);
    jButton5.setDisabledIcon(myIcon5);
    jButton1.setEnabled(false);
    jButton2.setEnabled(false);
    jButton3.setEnabled(false);
    jButton4.setEnabled(false);
    jButton5.setEnabled(false);
    jButton21.setEnabled(false);
    void jButton23_actionPerformed(ActionEvent e) {
    dior.setVisible(false);
    jButton21.setEnabled(true);
    jButton21.setVisible(true);
    s="";
    l=0;
    nextLabelToShowIcon=1;
    message.setText("");
    befforusers.setVisible(true);
    forusers.setVisible(false);
    jLabel[1].setIcon(null);
    jLabel[2].setIcon(null);
    jLabel[3].setIcon(null);
    jLabel[4].setIcon(null);
    jLabel[5].setIcon(null);
      jButton1.setEnabled(true);
      jButton2.setEnabled(true);
      jButton3.setEnabled(true);
      jButton4.setEnabled(true);
      jButton5.setEnabled(true);
    void jButton24_actionPerformed(ActionEvent e) {
    jButton21.setVisible(true);
    jButton21.setEnabled(true);
    dior.setVisible(false);
    nextLabelToShowIcon=1;
      jButton1.setEnabled(true);
      jButton2.setEnabled(true);
      jButton3.setEnabled(true);
      jButton4.setEnabled(true);
      jButton5.setEnabled(true);
      jButton6.setEnabled(true);
    l=0;
    befforusers.setVisible(true);
    forusers.setVisible(false);
    next1();
    next();
    next2();
    s="";
    message.setText("");
    jLabel[1].setIcon(null);
    jLabel[2].setIcon(null);
    jLabel[3].setIcon(null);
    jLabel[4].setIcon(null);
    jLabel[5].setIcon(null);
    void jButton25_actionPerformed(ActionEvent e) {
    public void paint(Graphics g) {
    super.paint(g);}
    private boolean isStandalone = false;
    public String getParameter(String key, String def) {
      return isStandalone ? System.getProperty(key, def) :
      (getParameter(key) != null ? getParameter(key) : def);
    private void jbInit() throws Exception {
        public String getAppletInfo() {
          return "Applet Information";
      public String[][] getParameterInfo() {
        return null;
      public static void main(String[] args) {
        Applet5 applet = new Applet5();
        applet.isStandalone = true;
        Frame frame = new Frame();
        frame.add(applet, BorderLayout.CENTER);
        applet.init();
        applet.start();
        frame.setSize(450,400);
        Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
        frame.setLocation((d.width - frame.getSize().width) / 2, (d.height - frame.getSize().height) / 2);
        frame.setVisible(true);
        frame.setResizable(false);
    class Applet5_jButton1_actionAdapter
    implements java.awt.event.ActionListener {
    Applet5 adaptee;
    Applet5_jButton1_actionAdapter(Applet5 adaptee) {
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e) {
    adaptee.jButton1_actionPerformed(e);
    class Applet5_jButton2_actionAdapter
    implements java.awt.event.ActionListener {
    Applet5 adaptee;
    Applet5_jButton2_actionAdapter(Applet5 adaptee) {
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e) {
    adaptee.jButton2_actionPerformed(e);
    class Applet5_jButton3_actionAdapter
    implements java.awt.event.ActionListener {
    Applet5 adaptee;
    Applet5_jButton3_actionAdapter(Applet5 adaptee) {
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e) {
    adaptee.jButton3_actionPerformed(e);
    class Applet5_jButton4_actionAdapter
    implements java.awt.event.ActionListener {
    Applet5 adaptee;
    Applet5_jButton4_actionAdapter(Applet5 adaptee) {
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e) {
    adaptee.jButton4_actionPerformed(e);
    class Applet5_jButton5_actionAdapter
    implements java.awt.event.ActionListener {
    Applet5 adaptee;
    Applet5_jButton5_actionAdapter(Applet5 adaptee) {
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e) {
    adaptee.jButton5_actionPerformed(e);
    class Applet5_jButton21_actionAdapter
    implements java.awt.event.ActionListener {
    Applet5 adaptee;
    Applet5_jButton21_actionAdapter(Applet5 adaptee) {
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e) {
    adaptee.jButton21_actionPerformed(e);
    class Applet5_jButton22_actionAdapter
    implements java.awt.event.ActionListener {
    Applet5 adaptee;
    Applet5_jButton22_actionAdapter(Applet5 adaptee) {
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e) {
    adaptee.jButton22_actionPerformed(e);
    class Applet5_jButton23_actionAdapter
    implements java.awt.event.ActionListener {
    Applet5 adaptee;
    Applet5_jButton23_actionAdapter(Applet5 adaptee) {
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e) {
    adaptee.jButton23_actionPerformed(e);
    class Applet5_jButton24_actionAdapter
    implements java.awt.event.ActionListener {
    Applet5 adaptee;
    Applet5_jButton24_actionAdapter(Applet5 adaptee) {
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e) {
    adaptee.jButton24_actionPerformed(e);
    class Applet5_jButton25_actionAdapter
    implements java.awt.event.ActionListener {
    Applet5 adaptee;
    Applet5_jButton25_actionAdapter(Applet5 adaptee) {
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e) {
    adaptee.jButton25_actionPerformed(e);
    }

    I performed some testing on your program, and get an ArrayIndexOutOfBoundsException on one of the buttons. So, I guess there have to be some implementation logic error.
    Since I have no idea what your program is trying to achieve, here's what you can do:
    1. Try to shorten your program.
    2. Add your code piece by piece.
    3. Perform some logic testing.
    4. Repeat steps 2 & 3.

  • How can I generate a component array using JBuilder?

    Now I'm using JBuilder to design my program's GUI. I wanted a JTextField array like this:nums[0]~nums[2].So I draged three JTextFields into the container at JBuilder's design view. But when I set the names of them as nums[x](x=0,1,2). I got a Error Message. It told me that I used a illegal name. How should I do, please?
    thank you a million!

    The DIO ports on a MIO will not satisfy your needs (unless you move to LV RT).
    They do not support buffered outputs.
    Your update rate (how often you can set the port and clear it) is going to be limited by how fast (a-hem slow) windows will let you iterate,
    and,
    be non-determinstic.
    You could use,
    1) LV RT with the existing board, or
    2) FieldPoint PWM module, or
    3) Arbitrary waveform generators, or
    4) HS DIO board, or
    5) use the analog output of your baord where you que-up a 0 -5V waveform of the proper shape (i.e. make sure that the duty cylce fraction of the update values are high, the rest low).
    This is just to get a PWM signal out.
    Now there is another issue. Determinism. How often do you plan on reading your inputs and making a change to you
    r PWM? If you plan on doing more often that 10/second, write your code to handle windows going out to la-la land when you expect it to be working.
    Can you tell I like LV-RT.
    I hope my ramblings have helped.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Mysql driver and Jbuilder 2005 foundation

    I am trying to connect to a mysql server using jdbc and the mysql drivers. Specifically version 3.1.7. I will post my code here although I believe the code is correct and that I have a classpath issue with jbuilder. The error I am receiving on both build and run time is:
    Exception in thread "main" java.sql.SQLException: No suitable driver
         at java.sql.DriverManager.getConnection(Unknown Source)
         at java.sql.DriverManager.getConnection(Unknown Source)
         at methodclassespkg.DummyTester.main(DummyTester.java:39)
    I installed the mysql .jar driver file in the jdk1.5/lib/ext as the read me file that came with the drivers stated. I have changed the default jdk to the jdk1.5 update 2 that I installed. I imoprted the .jar driver file into the project and even added the file under tools/configure/libraries. But I still receive this error witht his code
    package methodclassespkg;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import java.io.*;
    Class Name: Dummy Tester Class
    Description: A dummy class with a main to test the other classes functionality.
    Company: Team SSJ (7)
    Copyright (c) 2005
    Version 1.0
    public class DummyTester {
    public DummyTester() {
    try {
    jbInit();
    } catch (Exception ex) {
    ex.printStackTrace();
    public static void main(String[] args) throws SQLException, IOException{
    try{
    Class.forName("com.mysql.jdbc.Driver");
    catch(ClassNotFoundException e){
    System.out.println("Could not load the driver");
    Connection conn = DriverManager.getConnection("ServerName", "user", "password");
    System.out.println("test");
    private void jbInit() throws Exception {
    Again I am running the free version which does not allow me to access the enterprise tab, I mention this because I saw a solution to this issue that allowed for importing the database driver using tools/enterprisesetup/database drivers. but I do not have access to this functionalitity.
    Jeremy Reed

    Thank you for the fast response from everyone. WIth you assistance I did reach a solution. I turns out I wasnt calling the driver correctly, syntactlically.
    For anyone googling a similar issue as mine, for j connect, your statement must be in the form of jdbc:mysql://yourhost/database?user=name&password=password
    that was my mistake

  • UML & Code Generation (RAD)

    Hey everyone,
    I'm evaluating Java IDE's right now and I'm working with a group that uses a tool called Popkin to do their design in UML. I'm trying to find a Java IDE that can import (via XMI) those diagrams to do the code generation.
    Rational and TogetherSoft have integrated environments that couple the code and design (As you code, the UML is updated and as you create UML, the code is updated, etc.)
    I'm wondering though, if you use something like JBuilder, how can you import the UML from another tool? Has anyone messed with Popkin before or tried to integrate something like this?
    Thanks,
    Will

    bump
    i don't care about this topic any longer, but need to give out a duke dollar, first one to respond wins!

  • Why there is no UML tab in JBuilder X developer?

    I have just started to use JBuilder X Developer Evaluation edition. And to
    my surprise, I did not see UML tab there (I did see Source, Design, and other
    three tabs there). So is it that I did not do something right, or the software just
    does not have UML tab (A JBuilder Enterprise book did mention the UML tab.)?
    I hope the UML tab is not solely for JBuilder Enterprise Edition. Please help
    me to clarify the myth. Thank you.

    I have never used JBuilder, but I have heard from a lot of people that dislike it! Personally, I use TogetherJ for UML, but I don't really like the fact that it ties your diagrams to code that it generates behind the scenes, and also it is not free. ArgoUML is very good (and free), and doesn't constrain you as much (there are arguments for and against this). I appreciate that you might want to use JBuilder because you are used to it, but I am writing this follow-up in case you don't know of any other tools that can create UML diags ;o)

  • Need someone to chek my code n tell me if the asserts work. Please!!

    Hi , its importante that someone could help me on my code.
    the code is the greatest common divisor ( Maximo divisor comum)
    Well , the code is all right but i can't run it with the asserts , im using Eclipse 3.1 , the level of compilation is 1.3 .
    It says that ignores de asserts but when i compile it gives me error on assert expression.
    I would like to someone could test this code in another JAva editor like XEmacs or JBuilder ,anything that works with asserts and accept them.
    Someone working with linux could test this too?
    Just wanna see if the assertions are right , because i can't run the program with them in the eclipse. :S
    Its importante, help me please.
    Code:
    import pt.iscte.io.*;
    public class gCommonDivisor {
    public static void main(String[] args){
          assert 0 < n : n;     //  <--  THERE THEY ARE  : (
          assert 0 < d : d;  // n is the numerator and d is the denomi.
    System.out.println("Insira valor do numerador: ");
              int n = Teclado.intLido();
              System.out.println("Insira valor do denominador: ");
              int d = Teclado.intLido();
              int r = mdc( n, d); // modulo para o maximo divisor comum
              int den = denominador(r , d); // modulo para denominador simplificado
              int num = numerador(r, n); // modulo para numerador simplificado
              // Output do Maximo divisor comum e da frac�ao reduzida
              System.out.println("Maximo divisor comum entre "+ n +" e "+ d +" � "+ r);
              System.out.print("Frac��o reduzida de "+ n +"/"+ d +" = "+ num +"/"+ den);
               * @pre V.
               * @post gcd = maximo divisor comum
              static int mdc(int n, int d){
              int gcd = 1;
              int k =1;
              while (k <= n && k <= d) {
                   if (n % k == 0 && d % k == 0)
                        gcd =k;
                   k++;
                   return gcd;
              // numerador simplificado
              static int numerador(int r , int n ) {
              int numerador = n / r;
              return numerador;
              // denominador simplificado
              static int denominador(int r , int d ) {
              int denominador = d / r;
              return denominador;
    } Thank you so much .
    Please help me!
    Sorry about the language of the code. but dont worry about it, the code works fine without those two asserts after the main.
    kind regards,
    Josh

    wow i forgot to say that u just need to change the
    expression to read the input from the console.
    U dont have the iscte_io.jar
    change int n = Teclado.intLido();
    and int m = Teclado.intLido();
    cuz u don't have the Teclado( Keyboard) i had to import pt.iscte.io.Teclado;
    to read the input given by the user.
    thks

  • Import JBuilder into Sun Java Studio Enterprise 8

    I have a few JBuilder projects that I would like to import into SJSE8.
    I have read all the guides for migrating projects from JBuilder but I cannot see how I actually get the Import Project module.
    SJSE8 is supposed to be built on NetBeans5.5 but when I use the Update Center I cannot see the Import JBuilder Project module. How can I find the module and install it? Perhaps I need to get the .nbm file, but finding this seems to be difficult.
    Please Help,
    Rob

    For questions on 'Java Studio Creator', you may want to post on the Creator forum at http://forum.java.sun.com/forum.jspa?forumID=881 .
    The following are possible options but they are not guaranteed to work:
    Have you tried connecting to the all the available update centers in Creator ide's autoupdate client and check if 'jbuilder importer' plugin is available from one of them?
    If not, you should be able to download the nbm separately from:
    http://www.netbeans.info/uc/show_uc_content.php?nbver=50&auver=1.15&uctype=stable
    You can then use 'Install manually downloaded nbm' option in the autoupdate wizard. Again, this may or may not work..
    Also: You should consider upgrading to NetBeans 6.0.
    NetBeans 6.0 is an all-in-one-ide that is the recommended migration path for both Creator and Studio users and is the latest version available:
    http://www.netbeans.org/
    Documentation: http://www.netbeans.org/kb/index.html
    Community: http://www.netbeans.org/community/index.html
    Register to Join the NetBeans Community
    Once registered you have the opportunity to submit bugs and feature requests in IssueZilla, submit news for the NetBeans Community, and contribute code or even create a project of your own. Welcome to the team!
    You can also joint the mailing lists (http://www.netbeans.org/community/lists/top.html), especially [email protected] , to discuss issues and get community help on NetBeans related questions

Maybe you are looking for

  • Adding electronic signatures to the purchase order layout

    Hi Experts I want to add the signatures to the purchase order layout based on the approvals that has been obtained by that purchase order. What are the possibilities of doing this in SAP B1. Thanks & Regards Kanishka Wickrama

  • Speed up your Booklet 3G the right way

    I bought this booklet and was not impressed at all with the preformance issues. After a little work, here are some things that helped speed the machine up. ReadyBoost; I got an 8gb SD card, used the disk utility to reformat the card to NTFS from FAT3

  • Can't Open Library file

    I reinstalled iTunes and now it askes me to choose a library or create a new one. When I go to choose my existing library, the xml file is greyed out (disabled) and I can't choose it. Any ideas on why this is happening and how I can resolve it would

  • Problem with playing mu

    hi everyone, sorry if this is posted somewhere else. well i have a audigy 2 sound card and a plaintronics usb connected headphones with mic. my problem is that when im on a teamspeak server and talking with friends some times we play music through th

  • Firefox not working when PC wakes up after sleep but Chrome is working.

    When laptop wakes up from sleep, already opened tabs in Firefox are not getting connected to internet. After two minutes opening a new Firefox window is connecting to internet. But this problem is not happening with Chrome.