🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: aus.computers.java
1 messages
1 total messages Started by Richie Mon, 22 May 2000 00:00
URL
#700
Author: Richie
Date: Mon, 22 May 2000 00:00
117 lines
4189 bytes
HI  my names Richie and i'm 13. I'm writeing this application for my dad
that when you press a button it transferes you to the site. I'm using
Jbuilder 2. This is the code.

package Project;

import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import java.net.*;
import java.lang.*;
import borland.jbcl.control.*;
import borland.jbcl.layout.*;

public class Frame1 extends DecoratedFrame {

  file://Construct the frame
  MenuBar menuBar1 = new MenuBar();
  Menu menuFile = new Menu();
  MenuItem menuFileExit = new MenuItem();
  MenuItem menuFileZD = new MenuItem();
  MenuItem Yahoo = new MenuItem();
  MenuItem menuItem1 = new MenuItem();
  CheckboxPanel checkboxPanel1 = new CheckboxPanel();
  FlowLayout flowLayout1 = new FlowLayout();
  TextArea opinion = new TextArea();
  BevelPanel bevelPanel1 = new BevelPanel();
  Button No = new Button();
  Button Yes = new Button();
  FlowLayout flowLayout2 = new FlowLayout();

  public Frame1() {
    try  {
      jbInit();
    }
    catch (Exception e) {
      e.printStackTrace();
    }
  }
file://Component initialization

  private void jbInit() throws Exception  {
    this.setLayout(flowLayout1);
    this.setSize(new Dimension(475, 450));
    this.setTitle("Frame");
    menuFile.setLabel("File");
    menuFileExit.setLabel("Exit");
    menuFileZD.setFont(new Font("Dialog", 0, 12));
    menuFileZD.setLabel("ZD Net");
    menuFileZD.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(ActionEvent e) {
        menuFileZD_actionPerformed(e);
      }
    });
    Yahoo.setLabel("Yahoo");
    menuItem1.setEnabled(false);
    checkboxPanel1.setGrouped(true);
    checkboxPanel1.setLabels(new String[] {"Yahoo", "ZD Net", "None"});
    checkboxPanel1.setSelectedLabels(new String[] {"None"});
    checkboxPanel1.setSelectedLabel("");
    checkboxPanel1.setTextureName("");
    opinion.setBackground(Color.white);
    opinion.setText("What is your opinion of this Java applet");
    bevelPanel1.setOpaque(false);
    bevelPanel1.setVisible(false);
    No.setLabel("button1");
    Yes.setLabel("button2");
    bevelPanel1.setLayout(flowLayout2);
    opinion.addKeyListener(new java.awt.event.KeyAdapter() {
      public void keyPressed(KeyEvent e) {
        opinion_keyPressed(e);
      }
    });
    menuItem1.setLabel("New Link");

    menuFileExit.addActionListener(new ActionListener()  {
      public void actionPerformed(ActionEvent e) {
        fileExit_actionPerformed(e);
      }
    });


    this.setBackground(SystemColor.info);
    menuFile.add(menuItem1);
    menuFile.add(Yahoo);
    menuFile.add(menuFileZD);
    menuFile.addSeparator();
    menuFile.add(menuFileExit);
    menuBar1.add(menuFile);
    this.add(checkboxPanel1, BorderLayout.CENTER);
    this.add(opinion, null);
    this.add(bevelPanel1, null);
    bevelPanel1.add(Yes, null);
    bevelPanel1.add(No, null);
    this.setMenuBar(menuBar1);
  }
file://File | Exit action performed

  public void fileExit_actionPerformed(ActionEvent e) {
    System.exit(0);
  }

  public void menuFileZD_actionPerformed(ActionEvent evt) {
    URL url = null;
  try {
    url = new URL("http://www.mp3corner.net/hitmix.shtml");
  }
  catch (MalformedURLException a) {
    System.out.println("Bad url :" + url);
  }

}
}

The end bit is what I think needs something to chage to the page. I tried to
put in this but it wouldn't allow it,
getAppletContext().showDocument(url);
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads