• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Invisible Applet Text field in IE

 
Muhammad Imad Qureshi
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have a browse button and a text filed in my applet. But When the applet loads this part is not visible (in IE 6 only it works fine in Mozilla). But when I place mouse at that location then these things become visible. How do I fix this ?

Thanks
Imad
 
Sravan Kumar
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Please post your code. We might be able to get a clearer picture of the problem.
 
Muhammad Imad Qureshi
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here is the code sir

package com.r911.applet.fod;

import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;

import javax.swing.JApplet;
import javax.swing.JButton;
import javax.swing.UIManager;


import com.r911.applet.fod.ui.DocumentChooser;
import com.r911.utils.RemoteDelegateHandler;

import javax.swing.JTextField;
/**
*
*
* @author jabrisco
* @since Dec 27, 2004
*/
public class FodBrowser extends JApplet {

private int faxTypeId;
private javax.swing.JPanel fodJContentPane = null;

private JButton browseJButton = null;
private DocumentChooser documentChooser = null;
private JTextField filePathJTextField = null;
private RemoteDelegateHandler remoteDelegateHandler;

/**
* This method initializes this
*
* @return void
*/
public void init() {
initSystemProperties();
setLookAndFeel();
this.setSize(240, 30);
faxTypeId = new Integer(this.getParameter("faxTypeId")).intValue();
remoteDelegateHandler = new RemoteDelegateHandler(this.getCodeBase());
this.setContentPane(getFodJContentPane());
}
/**
* This method initializes fodJContentPane
*
* @return javax.swing.JPanel
*/
private javax.swing.JPanel getFodJContentPane() {
if(fodJContentPane == null) {
GridBagConstraints gridBagConstraints11 = new GridBagConstraints();
GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
fodJContentPane = new javax.swing.JPanel();
fodJContentPane.setLayout(new GridBagLayout());
gridBagConstraints1.gridx = 1;
gridBagConstraints1.gridy = 0;
gridBagConstraints11.gridx = 0;
gridBagConstraints11.gridy = 0;
gridBagConstraints11.weightx = 1.0;
gridBagConstraints11.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints11.anchor = java.awt.GridBagConstraints.EAST;
fodJContentPane.setPreferredSize(new java.awt.Dimension(250,26));
fodJContentPane.setBackground(new java.awt.Color(213,217,222));
fodJContentPane.add(getBrowseJButton(faxTypeId), gridBagConstraints1);
fodJContentPane.add(getFilePathJTextField(), gridBagConstraints11);
}
return fodJContentPane;
}
/**
* This method initializes browseJButton
*
* @return javax.swing.JButton
*/
private JButton getBrowseJButton(int faxTypeId) {
if (browseJButton == null) {
browseJButton = new JButton();
browseJButton.setText("Browse...");
browseJButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
if(documentChooser == null){
documentChooser = new DocumentChooser(
FodBrowser.this.getAppletContext(),
filePathJTextField,
FodBrowser.this.faxTypeId,
FodBrowser.this.remoteDelegateHandler);
}
documentChooser.setVisible( true );
}
});
}
return browseJButton;
}

private void setLookAndFeel() {
// Set as OS's look and feel
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
e.printStackTrace();
}
}

private void initSystemProperties(){
// Applet Specific Properties
System.setProperty(
"com.r911.property.application.server.host.protocol",
this.getCodeBase().getProtocol());

System.setProperty(
"com.r911.property.application.server.host.port",
new Integer(this.getCodeBase().getPort()).toString());

System.setProperty(
"com.r911.property.application.server.host.name",
this.getCodeBase().getHost());

}
/**
* This method initializes filePathJTextField
*
* @return javax.swing.JTextField
*/
public JTextField getFilePathJTextField() {
if (filePathJTextField == null) {
filePathJTextField = new JTextField();
filePathJTextField.setEditable(true);
filePathJTextField.setPreferredSize(new java.awt.Dimension(150,20));
}
return filePathJTextField;
}
}
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic