INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Application blocked by security settings?

Application blocked by security settings?

(OP)
My java applet yields the "Application blocked by security settings" dialog. It occurs whether I use FireFox or IExplorer. I've tried adjusting all the security settings I can find and the browsers' Java applet appears to be enabled. This same behavior occurs on my desktop computer running Xp, or my laptops running Vista. The applet is pretty simple:
"
import javax.swing.*;
import java.awt.event.*;

public class LottoApplet extends JApplet implements ActionListener
{
// Components.
JPanel pnl = new JPanel();
ClassLoader ldr = this.getClass().getClassLoader();
java.net.URL imageURL = ldr.getResource("Lotto.png");
ImageIcon icon = new ImageIcon( imageURL );
JLabel img = new JLabel(icon);
JTextField txt = new JTextField( "", 18 );
JButton btn = new JButton("Get My Lucky Numbers");

// Applet entry point.
public void init()
{

pnl.add( img );
pnl.add( txt );
pnl.add( btn );
btn.addActionListener( this );

// Background color selecter.
String bgStr = getParameter("BgColor");
int bgHex = Integer.parseInt( bgStr, 16 );
pnl.setBackground( new java.awt.Color( bgHex ));

add( pnl );
}

// Event-handler.
public void actionPerformed( ActionEvent event )
{
if( event.getSource() == btn )
{
// Declare working variables.
int[] nums = new int[50];
String str = "";

// Fill elements 1-49 with integers 1-49.
for( int i = 1; i < 50; i++ ) { nums[i] = i; }

// Shuffle the values in elements 1-49.
for( int i = 1; i < 50; i++ )
{
int r = (int) Math.ceil(Math.random() * 49) ;
int temp=nums[i]; nums[i]=nums[r]; nums[r]=temp;
}

// Display the values in elements one to six.
for ( int i = 1; i < 7; i++ )
{
str += " " + Integer.toString(nums[ i ]) + " ";

}
txt.setText( str );
}
}
}
"
Any suggestions?

RE: Application blocked by security settings?

Well, the problem is with the net access. Is the applet signed? If not you can try modifying the java.policy file as shown here

Cheers,
Dian

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close