I am trying to validate a string places in my HTML as a tag inside of my Java program so that if someone changes the HTML tag string my Java program checks the string if it is what I wrote.
Here is my java...
public void init()
{
String name = getParameter("author");
String course = getParameter("class");
if (name == "goes here")
JOptionPane.showMessageDialog (null, "Good, it will setVisible(true)", "Library System", JOptionPane.WARNING_MESSAGE);
if (name != "goes here")
JOptionPane.showMessageDialog (null, "NOT good and will setVisible(false)", "Library System", JOptionPane.WARNING_MESSAGE);
Container contain = getContentPane();
contain.add(new LibraryPanel(name, course));
setVisible(true);
}
Here is my HTML...
<html>
<body>
<applet code=3.LibraryFrame.class width=650 height=700>
<param name=author value="goes here">
<param name=class value="className">
</applet>
</body>
</html>
So when my string in my HTML tag is correct however it always says it doesnt match. I even have placed the name and course variable in my showMessageDialog and it matches.
Any ideas on why it isn't correctly validating?