View Single Post
  #1 (permalink)  
Old 07-05-2007, 07:24 PM
JToolTip JToolTip is offline
Member
 
Join Date: Jul 2007
Posts: 2
JToolTip is on a distinguished road
Why isn't this showing?
I don't see whats wrong with this code. It looks fine, but the applet on the website doesn't show the gui at all

Code:
import java.applet.*; import java.awt.*; import java.awt.event.*; import java.io.*; import java.net.*; import javax.swing.*; public class Client extends JApplet implements ActionListener { public void init() { setContentPane(new Client()); } public static JMenuBar menuBar = new JMenuBar(); public static JMenu file = new JMenu("File"); public static JMenuItem home = new JMenuItem("Main Page"); public static JPanel panel = new JPanel(new BorderLayout()); public static JLabel intro = new JLabel("Welcome."); public Client() { setLayout(new BorderLayout()); setJMenuBar(menuBar); menuBar.add(file); file.add(home); home.addActionListener(this); setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS)); panel.add(intro); } public void actionPerformed(ActionEvent e) { Object s = e.getSource(); if(s == home) { intro.setText("Once again, welcome!"); } } }
Reply With Quote
Sponsored Links