VersionsProbleme bei DialogBox

Status
Nicht offen für weitere Antworten.
O

olly7519

Gast
hallo java-forum members ,

zu allererst muß ich erwähnen das ich keinen großen plan von java allgemein habe.

ich bin in der situation java 1.3.1 (www.blackdown.org) in eine linux machine (debian3.1) integrieren zu müssen.
Es muß speziel die v1.3.1 sein da das java hauptprogramm (ein applet in einer webseite)
nur mit dieser version kompatibel ist.

es funktioniert auch einwandfrei !! alles menus, funktionen und was nicht alles *!funktionieren!* !!!

bis auf :

zusätzlich wurde eine authentifizierung eingebaut , eine java dialogbox fordert mich auf meinn usernamen
und ein passwort einzugeben.

SO : Es wird kein zeichen von der "dialogbox" akzeptiert ! außer ä,ö,ü,ß !


ich denke mir mal das es etwas mit fonts zu hat ?? wie auch immer wenn ich die java version 1.4.1 (www.blackdown.org) verwende funktioniert zwar die dialogbox :) aber dafür nicht mehr das
java hauptprogramm :-(

daher muß ich bei der v1.3.1 bleiben und hoffe das das problem mit der dialogbox unter 1.3.1 zu lösen ist.

HILFE !


Bin dankbar über alle antworten und hilfeversuche ´

gruß
olly

edit deathbyaclown: Titel geändert ! Bitte Boardregeln beachten !!!
 
O

olly7519

Gast
deathbyaclown hat gesagt.:
thE_29 hat gesagt.:
tjo ohne sourc oder sonstiges können wir dir net wirklich helfen ;)
nicht nur net wirklich - gar net.....

schade ! leider kann/darf ich das nicht machen :-(


aber vielleicht könnt ihr mir ansatzpunkte geben ?

kann es sich um fontprobleme handeln ?

liegt es eher am code des applets ?
oder eher an der j2re1.3.1 configuration ?

oder wie/wo kann ich ansetzen.


ich hoffe das ihr trotzdem eine spekulative einschätzung abgeben könnt.


danke trotzdem für euere antworten

gruß
olly
 
B

bygones

Gast
mir ist keinerlei verhalten irgendeiner Java Version bekannt, daher tippe ich auf Code des Applets!
 
O

olly7519

Gast
deathbyaclown hat gesagt.:
mir ist keinerlei verhalten irgendeiner Java Version bekannt, daher tippe ich auf Code des Applets!

vielen dank bis hierher !
ich habe mir mal die source besorgt und poste jetzt einfachmal die "AuthFrame.java" da sollte nichts drin stehen
was für andere interessant ist !

hoffe das bringt was ...

gruß
olly


Code:
import javax.swing.*;
import javax.swing.border.*;
import java.awt.event.*;
import java.awt.*;
/**
This class represents the first window occurs, wherein the user type his username and password to authenticate against NIS respective LDAP.
*/
public class AuthFrame extends JFrame implements ActionListener,  WindowListener{
    int FRAMEHEIGHT=180;
    int FRAMEWIDTH=210;
    jcham j;
    ChannelFrame channelFrame;
    JPanel panel;
    JLabel la_user;
    JLabel la_password;
    JLabel la_message;
    JTextField tf_user;
    JPasswordField tf_password;
    /*
      Parameter of this constructor is the object of the main-class jcham. 
    **/
    public AuthFrame(jcham j) {
	this.j=j;
	la_user = new JLabel("username:");
	la_password = new JLabel("password:");
	la_message = new JLabel(" ");
	la_message.setForeground(Color.red);
	tf_user = new JTextField(7);
	tf_user.addActionListener(this);
	tf_password = new JPasswordField(7);
	tf_password.addActionListener(this);
	
	panel = new JPanel();
	GridBagLayout gr1 = new GridBagLayout();
	GridBagConstraints co1 = new GridBagConstraints();
	panel.setBorder(new BevelBorder(BevelBorder.LOWERED));
	panel.setLayout(gr1);
	co1.insets = new Insets(10,10,2,5);
	gr1.setConstraints(la_user, co1);
	panel.add(la_user);
	co1.insets = new Insets(10,5,2,10);
	co1.gridwidth = GridBagConstraints.REMAINDER;
	gr1.setConstraints(tf_user, co1);
	panel.add(tf_user);
	co1.insets = new Insets(2,10,10,5);
	co1.gridwidth = 1;
	gr1.setConstraints(la_password, co1);
	panel.add(la_password);
	co1.insets = new Insets(2,5,10,10);
	gr1.setConstraints(tf_password, co1);
	panel.add(tf_password);
	
	GridBagLayout gr2 = new GridBagLayout();
	GridBagConstraints co2 = new GridBagConstraints();
	this.getContentPane().setLayout(gr2);
	co2.gridwidth = GridBagConstraints.REMAINDER;
	gr2.setConstraints(panel, co2);
	this.getContentPane().add(panel);
	co2.ipady=10;
	gr2.setConstraints(la_message, co2);
	this.getContentPane().add(la_message);
	
	setTitle(j.title);
	setSize(FRAMEWIDTH, FRAMEHEIGHT);
	setVisible(true);
	addWindowListener(this);
    }
    /**
      This method will be invoked, if the user finish his authentication-entries. The password will be compared with the crypted-password out of NIS respective LDAP. If access is granted, the ChannelFrame will be displayed. 
    */
    public void actionPerformed(ActionEvent event) {
	String rec[] = null;
	String cryptedpassword;
	String admin;
	la_message.setText(" ");
	if(event.getSource() == tf_password) {
	    //String cryptedpassword=null;
	    if(tf_user.getText().trim().equals("")) {
		la_message.setText("no username");
	    }
	    else if(tf_password.getDocument()==null) {
		la_message.setText("no password");
	    }
	    // else {
	    try {
	    rec=j.rmiClient.getCryptedPassword(j.vmid, tf_user.getText().trim());
	    }
	    catch(java.rmi.RemoteException e) {
		System.out.println(e);
	    }
	    cryptedpassword = rec[0];
	    admin = rec[1];
 		if(cryptedpassword.equals("NA")) {
 		    la_message.setText("wrong username");
 		}
 		else if (UnixCrypt.matches(cryptedpassword, new String(tf_password.getPassword()))) {
 		    this.setVisible(false);
 		    //j.channelFrame.setVisible(true);
		    channelFrame = new ChannelFrame(j);
		    if(rec[1].equals("ADMIN")) {
			channelFrame.menuAdmin.setEnabled(true);
		    }
		    channelFrame.show();
		    //j.user=tf_user.getText().trim();
 		}
 		else {
 		    la_message.setText("permission denied");
 		}
// 	    }
	    
	}
    }
      /** This method will be invoked when closing the frame. */
    public void windowClosing(WindowEvent e) {
	j.exit();
    }
     /** This method is empty but must be present, because jcham implements the interface WindowListener */
    public void windowOpened(WindowEvent e) {
      
    }
    
    /** This method is empty but must be present, because jcham implements the interface WindowListener */
    public void windowIconified(WindowEvent e) {
       
    }
    /** This method is empty but must be present, because jcham implements the interface WindowListener */
    public void windowDeiconified(WindowEvent e) {
      
    }
    /** This method is empty but must be present, because jcham implements the interface WindowListener */
    public void windowActivated(WindowEvent e) {
      
    }
    /** This method is empty but must be present, because jcham implements the interface WindowListener */
    public void windowDeactivated(WindowEvent e) {
       
    }
    /** This method is empty but must be present, because jcham implements the interface WindowListener */
    public void windowClosed(WindowEvent e) {
	j.exit();
    }
}
 
Status
Nicht offen für weitere Antworten.

Ähnliche Java Themen

Neue Themen


Oben