Linking Swing classes

I need the link the two classes I have pasted below. Please examine the code, I have created a new object of the type, the second class, but it doesnt execute when the option dialog is pressed, please advise on how i can get it to work... but classes are error free and work. Help would be much appreciated
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class MainMenu extends JFrame implements ActionListener {
JButton exRwButton;
JButton exQsButton;
JButton dspExButton;
JButton exitButton;
JButton exInButton;
JLabel MainMenuLabel;
JFrame frame;
public MainMenu() {
MainMenuLayout customLayout = new MainMenuLayout();
getContentPane().setFont(new Font("Helvetica", Font.PLAIN, 12));
getContentPane().setLayout(customLayout);
exRwButton = new JButton("Excercise Review");
getContentPane().add(exRwButton);
          exRwButton.addActionListener(this);
          exQsButton = new JButton("Excercise Questionaire");
getContentPane().add(exQsButton);
exQsButton.addActionListener(this);
          dspExButton = new JButton("Display Current Excercise Plan");
getContentPane().add(dspExButton);
dspExButton.addActionListener(this);
exitButton = new JButton("Exit Excercise Asistant");
getContentPane().add(exitButton);
exitButton.addActionListener(this);
exInButton = new JButton("Initial Questionaire");
getContentPane().add(exInButton);
          exInButton.addActionListener(this);
          MainMenuLabel = new JLabel("Excercise Asistant Main Menu");
getContentPane().add(MainMenuLabel);
setSize(getPreferredSize());
public static void main(String args[]) {
MainMenu window = new MainMenu();
window.setTitle("MainMenu");
window.pack();
window.show();
public void actionPerformed(ActionEvent e)
     MainMenu frame = new MainMenu();
     //dispose();
     Object source = e.getSource();
     if(source instanceof JButton)
          if(source == exRwButton)
               Object[] options1 = {"Yes", "Cancel"};
JOptionPane.showOptionDialog(
frame, "Would you like to perform an Excercise Plan Review?",
"Confirm Selection",
JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options1, options1[0]);
          else if (source == exQsButton)
               Object[] options2 = {"Yes", "Cancel"};
JOptionPane.showOptionDialog(frame, "Would you like to perform an Excercise Plan Questionaire?",
"Confirm Selection",
JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options2, options2[0]);
          else if(source == exInButton)
               Object[] options3 = {"Yes", "Cancel"};
JOptionPane.showOptionDialog(
frame, "Would you like to perform an Intial Personal Questionaire?",
"Confirm Selection",
JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options3, options3[0]);
Menu1 me = new Menu1(); // i have added this statement to open the next java file with
                                             //the class name Menu1, but it doesnt seam to work
          else if(source == dspExButton)
               Object[] options4 = {"Yes", "Cancel"};
JOptionPane.showOptionDialog(
frame, "Would you like to display your current Excecise Plan?",
"Confirm Selection",
JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options4, options4[0]);
          else if(source == exitButton)
               Object[] options5 = {"Yes", "Cancel"};
JOptionPane.showOptionDialog(
frame, "Are you sure you want to exit the excercise assistant?",
"Confirm Selection",
JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options5, options5[0]);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
class MainMenuLayout implements LayoutManager {
public MainMenuLayout() {
public void addLayoutComponent(String name, Component comp) {
public void removeLayoutComponent(Component comp) {
public Dimension preferredLayoutSize(Container parent) {
Dimension dim = new Dimension(0, 0);
Insets insets = parent.getInsets();
dim.width = 510 + insets.left + insets.right;
dim.height = 242 + insets.top + insets.bottom;
return dim;
public Dimension minimumLayoutSize(Container parent) {
Dimension dim = new Dimension(0, 0);
return dim;
public void layoutContainer(Container parent) {
Insets insets = parent.getInsets();
Component c;
c = parent.getComponent(0);
if (c.isVisible()) {c.setBounds(insets.left+8,insets.top+72,240,24);}
c = parent.getComponent(1);
if (c.isVisible()) {c.setBounds(insets.left+264,insets.top+72,240,24);}
c = parent.getComponent(2);
if (c.isVisible()) {c.setBounds(insets.left+264,insets.top+112,240,24);}
c = parent.getComponent(3);
if (c.isVisible()) {c.setBounds(insets.left+168,insets.top+160,184,24);}
c = parent.getComponent(4);
if (c.isVisible()) {c.setBounds(insets.left+8,insets.top+112,240,24);}
c = parent.getComponent(5);
if (c.isVisible()) {c.setBounds(insets.left+152,insets.top+24,208,24);}
//class which precious code should connect to i.e. open when selection is made from option dialog
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Menu1 extends JFrame {
JLabel genderLabel;
JLabel titleLabel;
JLabel iniQLabel;
JLabel ageLabel;
JComboBox ageCombobox;
ButtonGroup cbg;
JRadioButton radio_1;
JRadioButton radio_2;
JLabel weightLabel;
JComboBox weightCombobox;
JLabel heightLabel;
JComboBox heightCombobox2;
JComboBox heightCombobox1;
JLabel q1Label;
JComboBox q1Combobox;
JLabel q2Label;
JComboBox q2Combobox;
JLabel q3Label;
JComboBox q3Combobox;
JLabel q1Label2;
JLabel q4Label;
JComboBox q4Combobox;
JLabel q4Label2;
JLabel q5Label;
JComboBox q5Combobox;
JButton submitButton;
JLabel decisionLabel;
JLabel label_2;
JLabel decisionLabel2;
public Menu1() {
Menu1Layout customLayout = new Menu1Layout();
getContentPane().setFont(new Font("Helvetica", Font.PLAIN, 12));
getContentPane().setLayout(customLayout);
genderLabel = new JLabel("Gender");
getContentPane().add(genderLabel);
titleLabel = new JLabel("Please answer the following questions:");
getContentPane().add(titleLabel);
iniQLabel = new JLabel("Personal Questions");
getContentPane().add(iniQLabel);
ageLabel = new JLabel("Age Range");
getContentPane().add(ageLabel);
ageCombobox = new JComboBox();
ageCombobox.addItem("Select");
ageCombobox.addItem("16 - 20");
ageCombobox.addItem("20 - 25");
ageCombobox.addItem("25 - 30");
ageCombobox.addItem("30 - 40");
ageCombobox.addItem("40 - 50");
ageCombobox.addItem("50+");
getContentPane().add(ageCombobox);
cbg = new ButtonGroup();
radio_1 = new JRadioButton("Male", false);
cbg.add(radio_1);
getContentPane().add(radio_1);
radio_2 = new JRadioButton("Female", false);
cbg.add(radio_2);
getContentPane().add(radio_2);
weightLabel = new JLabel("Weight Range");
getContentPane().add(weightLabel);
weightCombobox = new JComboBox();
weightCombobox.addItem("Select");
weightCombobox.addItem("40 - 50");
weightCombobox.addItem("50 - 60");
weightCombobox.addItem("60 - 70");
weightCombobox.addItem("70 - 80");
weightCombobox.addItem("80 - 90");
weightCombobox.addItem("90 - 120");
weightCombobox.addItem("120+");
getContentPane().add(weightCombobox);
heightLabel = new JLabel("Height Range");
getContentPane().add(heightLabel);
heightCombobox2 = new JComboBox();
heightCombobox2.addItem("cm");
heightCombobox2.addItem("10");
heightCombobox2.addItem("20");
heightCombobox2.addItem("30");
heightCombobox2.addItem("40");
heightCombobox2.addItem("50");
heightCombobox2.addItem("60");
heightCombobox2.addItem("70");
heightCombobox2.addItem("80");
heightCombobox2.addItem("90");
getContentPane().add(heightCombobox2);
heightCombobox1 = new JComboBox();
heightCombobox1.addItem("Metres");
heightCombobox1.addItem("0");
heightCombobox1.addItem("1");
heightCombobox1.addItem("2");
getContentPane().add(heightCombobox1);
q1Label = new JLabel("How many hours a week would would you like to excercise?");
getContentPane().add(q1Label);
q1Combobox = new JComboBox();
q1Combobox.addItem("Hours");
q1Combobox.addItem("1");
q1Combobox.addItem("2");
q1Combobox.addItem("3");
q1Combobox.addItem("4");
q1Combobox.addItem("5");
q1Combobox.addItem("10");
q1Combobox.addItem("15");
q1Combobox.addItem("20");
getContentPane().add(q1Combobox);
q2Label = new JLabel("What kind of excercise would suit you best?");
getContentPane().add(q2Label);
q2Combobox = new JComboBox();
q2Combobox.addItem("Excercise Type");
q2Combobox.addItem("Sports Activity");
q2Combobox.addItem("Group Sports");
q2Combobox.addItem("Aerobic");
q2Combobox.addItem("Anaerobic");
getContentPane().add(q2Combobox);
q3Label = new JLabel("if your choose \"Aerobic\" please specify type.");
getContentPane().add(q3Label);
q3Combobox = new JComboBox();
q3Combobox.addItem("Aerobic Types");
q3Combobox.addItem("Running");
q3Combobox.addItem("Circuit Training");
q3Combobox.addItem("Swimming");
q3Combobox.addItem("Stair Climbing");
getContentPane().add(q3Combobox);
q1Label2 = new JLabel("(Active hours per week for adult human is 60hrs approx)");
getContentPane().add(q1Label2);
q4Label = new JLabel("If you chose \"Anaerobic\" please specify type.");
getContentPane().add(q4Label);
q4Combobox = new JComboBox();
q4Combobox.addItem("Anerobic Type");
q4Combobox.addItem("Free Weights");
q4Combobox.addItem("General Weight Training");
q4Combobox.addItem("General Resistance");
getContentPane().add(q4Combobox);
q4Label2 = new JLabel("Note. Genral Resistance is for people whom have access to gym equipment");
getContentPane().add(q4Label2);
q5Label = new JLabel("What is the main Purpose of your Excercise Plan, What is your main excercise focus, ");
getContentPane().add(q5Label);
q5Combobox = new JComboBox();
q5Combobox.addItem("Goals");
q5Combobox.addItem("Muscle Gain");
q5Combobox.addItem("Fat Loss");
q5Combobox.addItem("Weight Loss");
q5Combobox.addItem("Increased Fitness");
getContentPane().add(q5Combobox);
submitButton = new JButton("Submit");
getContentPane().add(submitButton);
decisionLabel = new JLabel("When you have filled out questionaire press submit button to go back to the main");
getContentPane().add(decisionLabel);
label_2 = new JLabel("please select most appropriate option.");
getContentPane().add(label_2);
decisionLabel2 = new JLabel("menu where you can select the Excercise Questionsaire");
getContentPane().add(decisionLabel2);
setSize(getPreferredSize());
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
public static void main(String args[]) {
Menu1 window = new Menu1();
window.setTitle("Menu1");
window.pack();
window.show();
class Menu1Layout implements LayoutManager {
public Menu1Layout() {
public void addLayoutComponent(String name, Component comp) {
public void removeLayoutComponent(Component comp) {
public Dimension preferredLayoutSize(Container parent) {
Dimension dim = new Dimension(0, 0);
Insets insets = parent.getInsets();
dim.width = 594 + insets.left + insets.right;
dim.height = 593 + insets.top + insets.bottom;
return dim;
public Dimension minimumLayoutSize(Container parent) {
Dimension dim = new Dimension(0, 0);
return dim;
public void layoutContainer(Container parent) {
Insets insets = parent.getInsets();
Component c;
c = parent.getComponent(0);
if (c.isVisible()) {c.setBounds(insets.left+256,insets.top+72,64,16);}
c = parent.getComponent(1);
if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+16,272,16);}
c = parent.getComponent(2);
if (c.isVisible()) {c.setBounds(insets.left+32,insets.top+48,120,16);}
c = parent.getComponent(3);
if (c.isVisible()) {c.setBounds(insets.left+32,insets.top+72,96,16);}
c = parent.getComponent(4);
if (c.isVisible()) {c.setBounds(insets.left+128,insets.top+72,88,24);}
c = parent.getComponent(5);
if (c.isVisible()) {c.setBounds(insets.left+256,insets.top+88,88,16);}
c = parent.getComponent(6);
if (c.isVisible()) {c.setBounds(insets.left+256,insets.top+104,88,16);}
c = parent.getComponent(7);
if (c.isVisible()) {c.setBounds(insets.left+32,insets.top+128,96,16);}
c = parent.getComponent(8);
if (c.isVisible()) {c.setBounds(insets.left+128,insets.top+128,88,24);}
c = parent.getComponent(9);
if (c.isVisible()) {c.setBounds(insets.left+256,insets.top+128,80,16);}
c = parent.getComponent(10);
if (c.isVisible()) {c.setBounds(insets.left+432,insets.top+128,72,24);}
c = parent.getComponent(11);
if (c.isVisible()) {c.setBounds(insets.left+360,insets.top+128,72,24);}
c = parent.getComponent(12);
if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+168,512,16);}
c = parent.getComponent(13);
if (c.isVisible()) {c.setBounds(insets.left+32,insets.top+184,120,24);}
c = parent.getComponent(14);
if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+216,512,16);}
c = parent.getComponent(15);
if (c.isVisible()) {c.setBounds(insets.left+32,insets.top+232,168,24);}
c = parent.getComponent(16);
if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+264,512,16);}
c = parent.getComponent(17);
if (c.isVisible()) {c.setBounds(insets.left+32,insets.top+280,168,24);}
c = parent.getComponent(18);
if (c.isVisible()) {c.setBounds(insets.left+160,insets.top+184,376,16);}
c = parent.getComponent(19);
if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+320,512,16);}
c = parent.getComponent(20);
if (c.isVisible()) {c.setBounds(insets.left+32,insets.top+360,128,24);}
c = parent.getComponent(21);
if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+336,512,16);}
c = parent.getComponent(22);
if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+408,512,16);}
c = parent.getComponent(23);
if (c.isVisible()) {c.setBounds(insets.left+32,insets.top+456,176,24);}
c = parent.getComponent(24);
if (c.isVisible()) {c.setBounds(insets.left+208,insets.top+552,104,24);}
c = parent.getComponent(25);
if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+504,512,16);}
c = parent.getComponent(26);
if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+424,512,16);}
c = parent.getComponent(27);
if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+520,512,16);}

Compare the code in your listenerMenu1 me = new Menu1(); // i have added this statement to open the next java file with
//the class name Menu1, but it doesnt seam to workwith the code in the main method of Menu1Menu1 window = new Menu1();
window.setTitle("Menu1");
window.pack();
window.show();See anything missing above?

Similar Messages

  • How can I use java swing class in JSP page design

    I am a new developer in Java server pages. I want to use layout managers available in java swing classes to design the page. Can any body suggest me a way to do this.Is it possible if I do it with servelets.

    So, you want to use layout managers within your JSPs?
    The immediate answer is that "it isn't a good idea". The more considered answer is "tell us what you're up to".
    Are you coding all presentation within a traditional JSP? That is, HTML, customer or library tags and/java scriptlets?
    Or are you building your HTML within your servlets and sending that back to the browser?
    If the first, then you are probably better off either using explicit HTML tables (or the equivalent custom tags) or finding a library that you can use.
    If the second, you can write classes similar to the Swing layout managers that end up being a fancy way of putting elements into an HTML table. We have exactly that in my current environment. I wouldn't recommend rolling your own and I'd tend to leave all that presentation stuff to the JSP.
    In any case, you can't really use the Swing layout managers as they are for an entirely different pradigm.

  • Add swing classes to the jeode, is that legal?

    Hi All,
    I already know that the jeode not support Swing 1.1.1 but my question is: Is it legitimate to add some swing classes to the jeode, that are relevant to my project , that will be kind of part of he jeode on my PDA (i know how to do this!) .
    i repeat i know how to integrate those calss with the yours jvm (jeode)and it is working good.
    Thanks Sendy.

    Hi!
    Can you tell me how to add some swing classes to the jeode? I put "swingall.jar" on the PDA and i've got an warning: "warning: running version 1.1... " and does not work.
    Thank�s!

  • Link between Class and characteristics created for that class

    Hi All,
    Is there any table that I can look at to find a link between class and the characteristics created for that class. For all the list of characteristics created I am refereing to CABN table but my requirement is to find the logic to see all the characteristics created for a class. Can anyone suggest me the right table to look at?
    Regards,
    Shane

    Hi,
    I would like to thank you for your quick response. So based on your thoughts, here is the process i followed to find the characteristics for a existing class,  took the Internal class number and used the KSML table to find all the Characteristics created for that class.
    To find the list of values assigned to that characteristics, used the AUSP table for that characteristics internal number.
    Thank you again for your inputs
    Shane.

  • Implementation of Linked List class

    I am trying to implement the Linked List class for one week, but I couldn't figure it out. If you know, please let me know.

    Here is an example of a linked list. Hope that will help.
    // define a node of a linked list
    public class Node
    public int data; // point to data
    public Node next; // pointer to next node or point to null if end of list
    // listTest1
    public class ListTest1
    public static void main(String[] args)
    Node list;
    list = new Node();
    list.data = 3;
    list.next = new Node();
    list.next.data = 7;
    list.next.next = new Node();
    list.next.next.data = 12;
    list.next.next.next = null;
    Node current = list;
    while (current != null) {
    System.out.print(current.data + " ");
    current = current.next;
    System.out.println();
    // other listnode
    public class ListNode
    public int data;
    public ListNode next;
    public ListNode()
    // post: constructs a node with data 0 and null link
    this(0, null);
    public ListNode(int value)
    // post: constructs a node with given data and null link
    this(value, null);
    public ListNode(int value, ListNode link)
    // post: constructs a node with given data and given link
    data = value;
    next = link;
    Contents of ListTest2.java
    public class ListTest2
    public static void main(String[] args)
    ListNode list = new ListNode(3, new ListNode(7, new ListNode(12)));
    ListNode current = list;
    while (current != null) {
    System.out.print(current.data + " ");
    current = current.next;
    System.out.println();

  • Linking a class to a symbol

    I have a simple progress bar symbol (ProgBar) in the library of main.fla. If I don't define a class and allow Flash to assign a placeholder class of ProgBar, then the symbol displays ok using
    progBar = new ProgBar();
    addChild(progBar);
    If I define a class, even the basic empty version below, I get the following error:
    ReferenceError: Error #1056: Cannot create property percent_txt on ProgBar.
    at flash.display::Sprite/constructChildren()
    at flash.display::Sprite()
    at flash.display::MovieClip()
    Class code:
    package {
    import flash.display.*;
    import flash.text.*;
    public class ProgBar extends MovieClip {
      public function ProgBar(): void {
    percent_txt is a text field I've given an instance name to. If I delete the text field (or its instance name) the error changes to reference the next item in the symbol and so on until there are none left!
    What have I missed?

    Well, yes, I thought it was a great plan! As part of my AS3/OOP education I'm trying to design a progress bar symbol with an associated class file for use in various projects. So I have progBar.fla containing a symbol, progBarMC, linked to class file ProgBar.as (which currently only traces "ProgBar constructor" as each instance is created). To test this I have main.fla and its document class Main.as. I've dragged a copy of progBarMC into the library of main.fla. Main.as looks like this:
    package {
    import flash.display.MovieClip;
    import flash.text.*;
    public class Main extends MovieClip {
      var progBar:MovieClip;
      public function Main() {
       progBar = new ProgBar();
       addChild(progBar);
    This only seemed to work if the symbol files were in the same folder as main.fla, but I've fixed that now - I hadn't set a class path for the symbol files.
    Your question sort of implies that this might not be an ideal approach. Any advice gratefully received!

  • Can't find Swing classes

    I'm running RH8, but quite new to linux, so it's possible I just don't have something set up right. I downloaded and installed the rpm for J2SE 1.4.1, which I believe is supposed to include Swing, right? Then I typed in the first example out of my book, which happens to use a couple of the Swing classes, and I get the following errors when I try to compile it:
    [root@rissa HelloJava]# javac HelloJava1.java
    HelloJava1.java:2: Superclass `javax.swing.JComponent' of class `HelloJava1'
    found.
    public class HelloJava1 extends javax.swing.JComponent
    ^
    HelloJava1.java:6: Type `javax.swing.JFrame' not found in the declaration of
    local variable `f'.
    javax.swing.JFrame f = new javax.swing.JFrame("HelloJava1");
    ^
    2 errors
    Anyone have any ideas what's up with my install?
    Lisa

    So what do I set where to make this work?As you said you need to set your path variable. How
    that is done depends on the shell that you are
    running.
    But if I just add the j2sdk/bin to my paths, it still uses the one in /usr/bin by default. How do I keep it from using that one? Obviously, I can't take /usr/bin out of my path, since I'll need other stuff in that directory.
    >>
    Also, even if I am running 1.3.1, shouldn't Swingwork
    anyway? The book I'm using is actually written for
    1.3, so anything in it ought to work no matterwhich
    copy I'm actually using, I would think.
    That is correct. You can try the following to verify
    whether a class is found or not.
    java javax.swing.JComponent
    If you run the above if it does not find the class
    then you will get a class not found exception. If it
    finds it then you will get an error that says that
    'main' was not found.
    Trying this under both versions gives me different exceptions in thread "main". I'm not even sure where it should be looking for the classes, let alone where it is looking for them, or for that matter, if they're even there to find.
    Response in 1.3.1:
    Exception in thread "main" java.lang.NoClassDefFoundError: javax.swing.JComponen
    t
    at 0x4028115f: java.lang.Throwable.Throwable(java.lang.String) (/usr/lib/libg
    cj.so.3)
    at 0x4027408e: java.lang.Error.Error(java.lang.String) (/usr/lib/libgcj.so.3)
    at 0x40275b1a: java.lang.LinkageError.LinkageError(java.lang.String) (/usr/li
    b/libgcj.so.3)
    at 0x40276f76: java.lang.NoClassDefFoundError.NoClassDefFoundError(java.lang.
    String) (/usr/lib/libgcj.so.3)
    at 0x402c60f9: gnu.gcj.runtime.FirstThread.run() (/usr/lib/libgcj.so.3)
    at 0x40267fdc: JvThreadRun(java.lang.Thread) (/usr/lib/libgcj.so.3)
    at 0x4023478c: JvRunMain(java.lang.Class, byte const, int, byte const, bool
    ean) (/usr/lib/libgcj.so.3)
    at 0x08048900: ?? (??:0)
    at 0x420158d4: ?? (??:0)
    at 0x080486c1: ?? (??:0)
    Response in 1.4.1_02:
    Exception in thread "main" java.lang.NoSuchMethodError: main
    You are not setting the CLASSPATH correct?Correct, although I did briefly try that as well, out of desparation, but it seemed to have no effect on anything.
    Lisa

  • URGENT!! I can not see swing classes -:((((

    I am using Plug-In 1.3 and JRE but I do not see the swing classes.
    In addition there is an error InstantiationException when I use other applet with AWT.
    Microsoft (R) VM for Java, 5.0 Release 5.0.0.3234
    ==============================================
    ? help
    c clear
    f run finalizers
    g garbage collect
    m memory usage
    q quit
    t thread list
    ==============================================
    java.lang.ClassNotFoundException: javax.swing.JApplet
         at com/ms/vm/loader/URLClassLoader.loadClass
         at java/lang/ClassLoader.loadClassInternal
         at java/lang/ClassLoader.resolveClass
         at com/ms/vm/loader/URLClassLoader.loadClass
         at com/ms/vm/loader/URLClassLoader.loadClass
         at com/ms/applet/AppletPanel.processSentEvent
         at com/ms/applet/AppletPanel.processSentEvent
         at com/ms/applet/AppletPanel.run
         at java/lang/Thread.run

    Thank you very much for your answers, but although it seems that it has found swing classes without putting anything in the classpath, it continue giving me problems. I think both error are because I am using database classes, shoud I put this classes in the classpath???? How??????
    Java(TM) Plug-in: Version 1.3.1
    Using JRE version 1.3.1 Java HotSpot(TM) Client VM
    User home directory = C:\Documents and Settings\IRENE
    Proxy Configuration: Browser Proxy Configuration
    c: clear console window
    f: finalize objects on finalization queue
    g: garbage collect
    h: display this help message
    l: dump classloader list
    m: print memory usage
    q: hide console
    s: dump system properties
    t: dump thread list
    x: clear classloader cache
    0-5: set trace level to <n>
    java.lang.NoClassDefFoundError: symantec/itools/db/beans/binding/QueryNavigator
         at java.lang.Class.newInstance0(Native Method)
         at java.lang.Class.newInstance(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.plugin.AppletViewer.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    java.lang.NoClassDefFoundError: symantec/itools/db/beans/binding/ParentInvalidRecordException
         at Prueba.<init>(Prueba.java:59)
         at java.lang.Class.newInstance0(Native Method)
         at java.lang.Class.newInstance(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.plugin.AppletViewer.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)

  • Swing Class to send encoded url??

    Can a normal Java Swing class( NOT a SERVLET) able to use the
    javax.servlet.http.HttpServletRequest methods?
    Explaination:
    1). The user enters a handphone number into a textfield
    2). Then clicks on the "Send" button.
    3). The ActionListener of the "Send" button will retrieve the handphone number from above, performs some database retrieval.
    4). Encode a static url together with the handphone number, message and sender number.
    5). Create a HttpServletRequest and uses the sendRedirect(encodedURL) to the WWW.
    In Addition Info
    This Swing class will be running all the while
    The host computer has 24*7 internet connection
    Is it possible to do it in Java Swing?

    Can a normal Java Swing class( NOT a SERVLET) able to use the
    javax.servlet.http.HttpServletRequest methods?No, Swing cannot directly call request methods. But url may be encoded by other means.
    5). Create a HttpServletRequest and uses the sendRedirect(encodedURL) to the WWW.You may need to make Applet-Servlet/JSP communication.
    Thanks
    Hafizur Rahman
    SCJP

  • Should I extend swing classes from Oracle JDK

    While attempting to use Swing classes, I'm not sure where to entend from. I've seen some examples on Oracle's site which uses swing classes extended from JDeveloper's customized JDK DCaf. Is that the place where I should extend from? If so, where can I see the reference for those classes?
    Thanks for your help.

    Of course, one way to add a little bit of protection for yourself is to quote the part of the message that is relevant. Then the only one that can edit the quoted part, is you. A bit like that ;)
    Andrew Thompson wrote:
    we have lazy moderatorsMore seriously:
    Andrew Thompson wrote:
    we have community moderators that can ...Mods can also edit other's posts, such as discussed here: {thread:id=1246269}
    However I doubt they would be able or willing to do so on a large-scale.
    And I'm not sure they can retrieve a posts history to know which of the contenders lies.

  • Best swing class choices for overlaying instruments/marker data on map?

    Hi everyone. The title pretty much says it all.
    I'm looking for some insight into how to draw things correctly so I don't get glitches. This is a nautical GPS application. Right now I have the following classes:
    MapView extends JPanel
    VectorMap (standalone class)
    InstrumentOverlay extends JPanel
    BoatOverlay JPanel
    GPSGridOverlay (standalone class)
    MapView is simply a place to consolidate the drawing of everything. VectorMap is actually the data storage object for a series of contour lines and geographic points with associated text labels. GPSGridOverlay and InstrumentOverlay are things that will overlay and possibly move around on top of the map. When I drag my InstrumentOverlay around, it smears any other overlayed data (like the BoatOverlay or GPSGridOverlay). It doesn't smear the background map. I can only fix it by manually calling repaint on MapView. I can post a screenshot if that would help.
    My question is, am I doing this in a silly manner? What would be a better choice of Swing classes for this task? Is it alright to use standalone classes as I have done and pass them a Graphics object to paint into, or should they be made into Swing class objects like JPanels?
    the paintComponent method of my MapView object is:
    protected void paintComponent(Graphics g) {
         Graphics2D g2D = (Graphics2D) g;
    // clear screen
         g2D.setColor(new Color(255,255,255));
         g2D.fillRect(0,0,getWidth(),getHeight());
    // manually paint components that aren't JPanels
         vectormap.draw(g2D);
         gpsgridoverlay.draw(g2D);
    // JPanel children (instrument, boat) will paint automatically after this due to
    // paintChildren() call made by swing.
    }

    Here are some screenshots:
    before dragging compass:
    http://www.kulkarnicorp.com/coastnav1.jpg
    after dragging compass to the left in an S pattern:
    http://www.kulkarnicorp.com/coastnav2.jpg

  • Changing javax.swing class

    Hello,
         I am an experienced programmer new to java. I found a solution to a problem I am having with BoxLayout in the bug database. The solution makes a change to the SizeRequirements class in javax.swing. I found the source for the class and have recompiled it. But the recompiled class is not being picked up. What do I do next? The classes all seem to be in a jar file although I can't find one with SizeRequirements. Is there the concept of linking in Java or do I just need to put the class in the right path location?
    Thanks,
    Lori

    ...file although I can't find one with SizeRequirements. If you can't find it then you might want to go back to the drawing board since you probably have a different java version.
    I don't believe standard class files are loaded via the classpath.
    This command line option is taken from the javadocs
    -Xbootclasspath/p:path
    Specify a semicolon-separated path of directires, JAR archives, and ZIP archives to prepend in front of the default bootstrap class path. Note: Applications that use this option for the purpose of overriding a class in rt.jar should not be deployed as doing so would contravene the Java 2 Runtime Environment binary code license.
    The last sentence is important.

  • De-linking (Valuation class & GL A/c) automatic posting in Invoice booking

    Experts,
    I have a issue regarding link between FI & MM
    From what I understand,
    there is a link between Service & Valuation class
    & also a link between valuation class & GL.
    This link enables automatic FI line item posting while invoice booking.
    My question:
    1. Can we break the linkage between valuation class & GL i.e. we want to stop the automatic posting
    2. What is the effect of above
    3. Would you advise to do this .. ? Why?
    Regards,
    KPS007

    Hi,
    SAP standard process are the best business practises and it should changed only when we have genuine business problem and not for people issue.
    There are several scenarios will occur during MIGO and MIRO. For each scenario system should determine a correct Inventory account, GR/IR clearing account, Price difference account and etc. First you need to prepare an excel sheet with all your possible business scenario, valuation area/valuation grouping code and their respective GL accounts. Once you have listed out all the scenarios and correct GL accounts, you can configure the system as per your requirement. Initial home work is needed to avoid any difference in account posting. Hence try to fix the source of your problem rather than changing the best practise. Account determination is vast and it cannot be explained here but please refer the below link.
    http://help.sap.com/saphelp_46c/helpdata/en/12/1a39516e36d1118b3f0060b03ca329/content.htm
    Regards,
    Senthil

  • Calling a Swing class method from from another swing class method

    Hi guys,
    I'm desperate for help or a pointing in the right direction. Basically, I want to call the public void createUI method in class AddressUI in the public void createUI method of PartnerUI class. Is that legal? How do I go about it? Thanks.
    package com.client.gui;
    import java.awt.*;
    import javax.swing.*;
    import client.application.MainFrame;
    import client.gui.base.BasicDialogUI;
    import client.page.base.BasicDialogPage;
    import client.table.model.AddressModel;
    public class AddressUI extends BasicDialogUI{
         private static final long serialVersionUID = -1214150134433745466L;
         public AddressUI(MainFrame frame, BasicDialogPage page) {
              super(frame, page);
         @Override
         public void createUI() {
         AddressModel am = new AddressModel();
         JTable table = new JTable(am);
         table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
         table.setColumnSelectionAllowed(true);
         JScrollPane scroller = new JScrollPane(table);
         scroller.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
         scroller.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
         JPanel addressPanel = new JPanel(new FlowLayout());
         addressPanel.setBackground(Color.BLUE);
         addressPanel.setForeground(Color.WHITE);
         addressPanel.setOpaque(true);
         JLabel addressHeader = new JLabel("Anschriften:");
         JPanel addressHeaderPanel = new JPanel();
         addressHeaderPanel.setBackground(Color.BLUE);
         addressHeaderPanel.setForeground(Color.WHITE);
         addressHeader.setOpaque(true);
         addressHeaderPanel.add(addressHeader);
         JButton buttonNew = new JButton("Neu");
         JButton buttonChange = new JButton("Ändern");
         JButton buttonDelete = new JButton ("Löschen");
         JPanel buttonsPanel = new JPanel(new FlowLayout());
         buttonsPanel.add(buttonNew);
         buttonsPanel.add(buttonChange);
         buttonsPanel.add(buttonDelete);
         addressPanel.add(buttonsPanel, FlowLayout.RIGHT);
         addressPanel.add(scroller, FlowLayout.CENTER);
         addressPanel.add(addressHeaderPanel, FlowLayout.LEFT);
         public final void showUI() {
              createUI();
              getMainFrame().setDialogPanel(this);
              getMainFrame().pack();
              this.setVisible(true);
         @Override
         public void formToModel() {
         @Override
         public void modelToForm() {
         @Override
         public boolean validateUI() {
              return true;
    package com.impaqgroup.pp.client.gui;
    import java.awt.BorderLayout;
    import java.awt.Color;
    import javax.swing.JPanel;
    import javax.swing.JTable;
    import com.impaqgroup.pp.client.application.MainFrame;
    import com.impaqgroup.pp.client.gui.base.BasicDialogUI;
    import com.impaqgroup.pp.client.page.base.BasicDialogPage;
    import com.impaqgroup.pp.client.table.model.PartnerModel;
    public class PartnerUI extends BasicDialogUI{
         private static final long serialVersionUID = 1024614598666310834L;
         public PartnerUI(MainFrame frame, BasicDialogPage page) {
              super(frame, page);
         @Override
         public void createUI() {
              JPanel partnerPanel = new JPanel();
              partnerPanel.setBackground(Color.BLUE);
              partnerPanel.setForeground(Color.WHITE);
              partnerPanel.setOpaque(true);
              PartnerModel pm = new PartnerModel();
              JTable partnerTable = new JTable(pm);
              partnerTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
              partnerTable.setColumnSelectionAllowed(true);
              partnerPanel.add(partnerTable, BorderLayout.CENTER);
         @Override
         public final void showUI() {
              createUI();
              getMainFrame().setDialogPanel(this);
              getMainFrame().pack();
              this.setVisible(true);
         @Override
         public void formToModel() {
         @Override
         public void modelToForm() {
         @Override
         public boolean validateUI() {
              return true;
    }

    Have you tried adding something like the below to PartnerUI#createUI() ?
    AddressUI aui = new AddressUI( getMainFrame(), getPage() );
    aui.createUI();

  • Using text in a GUI without using .swing classes

    In a Java application, is there any way to create a text object that can be positioned in a GUI like an ImageIcon (using a class from the standard Java API)? For example, when using ImageIcon, you feed the x and y-coordinates, whereas with .swing, you'd have to create a new panel, position the panel, and re-position the panel using BorderLayout.(direction).
    Ex. (with ImageIcon, you'd place it like so):
    //construct ImageIcon w/ URL
    ImageIcon myImage = new ImageIcon(new URL("http://..."));
    //x and y are pixels to the right and to the bottom from the top left corner
    myImage.paintIcon( (Component), (Graphics), x, y);
    //I'm looking for one that does the same, like this (without using an image, preferrably), TextMessage is what the class might be:
    TextMessage myText = new TextMessage("Here is some string to print out");
    myText.printText( (Component), (Graphics), x, y)

    or you can paint a string, like this
    public void paint(Graphics g) {
         super.paint(g);
         g.drawString("Hello World!", x,y);  // replace x, y with your own coordinates
    }hope that helps

Maybe you are looking for