在出错处写上SplashScreen s = new SplashScreen();
解决方案 »
- this所代表对象的问题
- String类中的substring(String.length())怎么能取为空?
- 为什么运行第一次一开始不能显示标签,而运行多次便可以显示标签.
- Class这个类到底是干嘛用的。看了一些解释还是不明白,请高手指教?
- 输入用户名后回车,为什么无法把焦点传给密码框,几句小代码,谢谢了。
- JAVA里面怎么使用ICO格式个图标文件?
- 求教!!!!像一般IDE我们写了一个方法,但未使用过,他会在下面做个下划线标识一下,这个是怎么实现的??
- 求助!(300分)java中如何合并多张图片。分不够,解决问题,另开贴给分
- J2SE V1.4.2 如何安装,急死了!
- 很可气的问题:double a=20011130;System.out.println("实际是:"+a); 显示结果是2.00111E7
- 请问java中多态性是怎么解决的?
- 关于Jbuilder5和weblogic6的集成……
类'SplashScreen'中没有匹配的构造函数'SplashScreen()',看看类'SplashScreen'的定义,查一下它的构造函数的定义。或者它的父类的构造函数。
import com.ms.wfc.app.*;
import com.ms.wfc.core.*;
import com.ms.wfc.ui.*;
import com.ms.wfc.html.*;
import com.ms.wfc.io.*;/**
* This class can take a variable number of parameters on the command
* line. Program execution begins with the main() method. The class
* constructor is not invoked unless an object of type 'SplashScreen'
* created in the main() method.
*/
public class SplashScreen extends Form
{
//声明私有成员变量
private String m_sProduct =new String ();
private String m_sVersion= new String ();
private String m_sCopyright= new String ();
private String m_sWarningText= new String ();
private String m_sUserName= new String ();
private String m_sCompanyName= new String ();
private String m_sBackPath= new String ();
private Bitmap m_bmBackSplash;
public SplashScreen(String product,
String version,
String copyright,
String userName,
String company,
String warning)
{
this();
setProduct(product);
setVersion(version);
setCopyright(copyright);
setUserName(userName);
setCompany(company);
setWarningText(warning);
}
private void setSplashDelay(int delay)
{
if (delay>0)
tmrSplash.setInterval(delay);
}
public void setProduct(String product)
{
m_sProduct=product;
}
public void setVersion(String version)
{
m_sVersion=version;
}
public void setCopyright(String copyright)
{
m_sCopyright=copyright;
}
public void setUserName(String userName)
{
m_sUserName=userName;
}
public void setCompany(String company)
{
m_sCompanyName=company;
}
public void setWarningText(String warning)
{
if (warning.length ()>0)
{
m_sWarningText=warning;
}
if (warning.equals ("NA")==true)
{
m_sWarningText="";
}
}
public void setLogoImage(String logoImage)
throws IOException
{
if (logoImage.length ()>0 && File.exists(logoImage)==true)
{
try
{
picLogo.setImage(new Bitmap (logoImage));
picLogo.setVisible(true);
}
catch (IOException ex)
{
MessageBox.show ("载入图片时发生错误!"+"请检查图片的路径和文件名","Splash Example",MessageBox.ICONERROR +MessageBox.OK );
picLogo.setVisible(false);
return;
}
}
}
public void setSplashBackground(String backImage)
{
m_sBackPath =backImage;
}
public void showSplash(int interval) throws IOException
{
setSplashDelay(interval);
if (m_sBackPath.length ()>0
&&File.exists(m_sBackPath)==true)
{
try
{
m_bmBackSplash=new Bitmap (m_sBackPath);
}
catch(IOException ex)
{
MessageBox.show ("载入图片时发生错误!"+"请检查图片的路径和文件名","Splash Example",MessageBox.ICONERROR +MessageBox.OK );
}
}
tmrSplash.setEnabled(true);
this.showDialog ();
}
public void closeSplash(Object sender,Event e)
{
tmrSplash.setEnabled(false);
this.dispose ();
}
public void paintSplash(Object sender,PaintEvent e)
{
Graphics gdi;
if (m_bmBackSplash==null)
{
gdi=this.createGraphics ();
}
else
{
gdi=m_bmBackSplash.getGraphics ();
}
gdi.setOpaque (false);
gdi.setFont(new Font ("Arial",12.0f,FontSize.CHARACTERHEIGHT ,FontWeight.BOLD ,false,false,false));
gdi.drawString ("本窗体实例允许下列公司或个人使用:",170,40);
if (m_sUserName.length ()>0)
gdi.drawString(m_sUserName,170,60);
if (m_sCompanyName.length ()>0)
gdi.drawString (m_sCompanyName,170,90);
gdi.setFont(new Font("Arial",18.0f));
if (m_sVersion.length()>0)
gdi.drawString(m_sVersion,170,210);
gdi.setFont(new Font("Arial",14.0f,FontSize.CHARACTERHEIGHT ,FontWeight.BOLD ,false,false,false));
if (m_sCopyright.length()>0)
gdi.drawString(m_sCopyright,170,240);
gdi.setFont(new Font("Arial",12.0f,FontSize.CHARACTERHEIGHT ,FontWeight.BOLD ,false,false,false));
if (m_sWarningText.length()>0)
gdi.drawString(m_sWarningText,10,280);
gdi.setFont(new Font("Arial",36.0f,FontSize.CHARACTERHEIGHT ,FontWeight.BOLD ,false,false,false));
gdi.setTextColor (Color.GRAYTEXT);
gdi.drawString (m_sProduct,172,172);
gdi.setTextColor (Color.BLACK );
gdi.drawString (m_sProduct,170,170);
if (m_bmBackSplash!=null){
gdi=this.createGraphics ();
gdi.drawImage (m_bmBackSplash,0,0);
}
} /**
* SplashScreen overrides dispose so it can clean up the
* component list.
*/
public void dispose()
{
super.dispose();
components.dispose();
}
/**
* NOTE: The following code is required by the Visual J++ form
* designer. It can be modified using the form editor. Do not
* modify it using the code editor.
*/
Container components = new Container();
PictureBox picLogo = new PictureBox();
Timer tmrSplash = new Timer(components); private void initForm()
{
this.setText("\"*!\"");
this.setAutoScaleBaseSize(new Point(6, 12));
this.setBorderStyle(FormBorderStyle.NONE);
this.setClientSize(new Point(455, 310));
this.setControlBox(false);
this.setMaximizeBox(false);
this.setMinimizeBox(false);
this.setShowInTaskbar(false);
this.setStartPosition(FormStartPosition.CENTER_SCREEN); picLogo.setLocation(new Point(16, 16));
picLogo.setSize(new Point(145, 145));
picLogo.setTabIndex(0);
picLogo.setTabStop(false);
picLogo.setText("pictureBox1");
picLogo.setSizeMode(PictureBoxSizeMode.STRETCH_IMAGE); tmrSplash.setInterval(2500);
/* @designTimeOnly tmrSplash.setLocation(new Point(288, 208)); */ this.setNewControls(new Control[] {
picLogo});
} /**
* The main entry point for the application.
*
* @param args Array of parameters passed to the application
* via the command line.
*/
public static void main(String args[])
{
Application.run(new SplashScreen());
}
}