Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

List Box programs not running

Zulfi KhanAug 28 2015 — edited Aug 28 2015

Hi,

i am trying to create List Box. I have tried different programs downloaded from internet but i am getting Xlint:unchecked warning.


G:\Zulfi\java prog\2015\gui\ListBox>javac ListBox1.java

Note: ListBox1.java uses unchecked or unsafe operations.

Note: Recompile with -Xlint:unchecked for details.

G:\Zulfi\java prog\2015\gui\ListBox>javac -Xlint:unchecked ListBox1.java

ListBox1.java:17: warning: [unchecked] unchecked call to JList(E[]) as a member

of the raw type JList

        JList list = new JList(options);

                     ^

  where E is a type-variable:

    E extends Object declared in class JList

1 warning

G:\Zulfi\java prog\2015\gui\ListBox>javac ListBox1.java

Note: ListBox1.java uses unchecked or unsafe operations.

Note: Recompile with -Xlint:unchecked for details.

G:\Zulfi\java prog\2015\gui\ListBox>type ListBox1.java

import java.awt.*;

import javax.swing.*;

public class ListBox1 extends Object{

    public static void main(String[] args) {

        JFrame frame = new JFrame("Test Frame");

        frame.setSize(new Dimension(300,200));

        frame.setLocation(100,100);

        Container contentPane = frame.getContentPane();

        JLabel label = new JLabel("HERE IS A LABEL");

        contentPane.add(label, BorderLayout.NORTH);

        JButton button = new JButton("BUTTON");

        contentPane.add(button, BorderLayout.SOUTH);

        String[] options = {"Option 1", "Option 2",

                            "Option 3"};

        JList list = new JList(options);

        contentPane.add(list, BorderLayout.CENTER);

        frame.setVisible(true);

    }

}

However, i have tried and the program is running. Some body please guide me.

Zulfi.

Comments

alabala_kiril
One more question:

Do I need to configure the JRE on the Client side in order to open the Applet on the kerberized server?

Currently the JRE can't authenticate and the applet is not loaded due to Not authenticated (401) error.


Any advice is greatly appreciated!
955427
Hi,

Were you able to resolve this issue? I am having the same problem, server does authentication, but fails when downloading the applet jar file.

Thanks,
Gopi
1 - 2
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Sep 25 2015
Added on Aug 28 2015
1 comment
558 views