Jump to content
Excelsior Forums
acewang

Can't display contents with JET 3.7

Recommended Posts

support@excelsior-usa.com

Hello:

I had buy your JET Professional 3.7 ,and install in my IBM T42 2373-8UU,the video card is ATI Mobility Tadeon 7500,OS is Microsoft XP.

After install the JET, it can't display content(see attachment Capture_2.jpg);

I use command line to compile my program, it can't display the picture too.(in java mode is OK) i think it may be the same bug.

waiting your answer.

(the program run ok in another computer)

=======================================================================

Showpanel canvas = new Showpanel();

icon = new ImageIcon(file.getAbsolutePath());

  // interFrame.getContentPane().add(label);

  canvas.setPresize();

  canvas.validate();

  canvas.repaint();

  getWorkPane().add(new JScrollPane(canvas));

class Showpanel extends JPanel {

 /**

  * Comment for <code>serialVersionUID</code>

  */

 private static final long serialVersionUID = 3835150640853694517L;

 private AffineTransform trans;

 private double scalex = 1.0;

 private double scaley = 1.0;

 private double x = 1.0, y = 1.0;

 private double width, height;

 /**

  * 构造函数

  *

  */

 public Showpanel() {

  trans = new AffineTransform();

 }

 /**

  * 绘制函数

  *

  * @param g

  */

 public void paintComponent(Graphics g) {

  super.paintComponent(g);

  Graphics2D g2 = (Graphics2D) g;

  g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,

    RenderingHints.VALUE_ANTIALIAS_ON);

  g2.drawImage(icon.getImage(), trans, this);

  g2.transform(trans);

 }

 public void setPresize() {

  int w = (new Double(this.getImagewidth())).intValue();

  int h = (new Double(this.getImageheight())).intValue();

  setPreferredSize(new Dimension(w, h));

 }

 /**

  * 放大

  *

  */

 public void setBigger() {

  x = scalex * x * 2;

  y = scaley * y * 2;

  width = x * icon.getIconWidth();

  height = y * icon.getIconHeight();

  trans.setToScale(x, y);

  setPresize();

  revalidate();

  repaint();

 }

 /**

  * 缩小

  *

  */

 public void setSmaller() {

  x = scalex * x / 2;

  y = scaley * y / 2;

  width = x * icon.getIconWidth();

  height = y * icon.getIconHeight();

  trans.setToScale(x, y);

  setPresize();

  revalidate();

  repaint();

 }

 /**

  * 顺时针旋转

  *

  */

 public void setClockRotate() {

  trans.rotate(Math.toRadians(90), icon.getIconWidth() / 2, icon

    .getIconHeight() / 2);

  repaint();

 }

 /**

  * 逆时针旋转

  *

  */

 public void setAntiClockRotate() {

  trans.rotate(Math.toRadians(-90), icon.getIconWidth() / 2, icon

    .getIconHeight() / 2);

  repaint();

 }

 /**

  * 翻转180度

  *

  */

 public void setTurnover() {

  trans.rotate(Math.toRadians(180), icon.getIconWidth() / 2, icon

    .getIconHeight() / 2);

  repaint();

 }

 /**

  * 获得图片宽度

  *

  * @return double

  */

 public double getImagewidth() {

  return width;

 }

 /**

  * 获得图片高度

  *

  * @return double

  */

 public double getImageheight() {

  return height;

 }

}

Share this post


Link to post
Share on other sites

Probably, the problem with displaying pictures is different.

If your application classes and resources (including pictures) reside in jar files, compile it from command line as

jc +bindresources YourApp.jar1 YourApp.jar2..

If resources are placed in a directory, say C:\FOO\ResourceDirectory, try this script

---------------------- run.bat

SET CLASSPATH=C:\FOO\ResourceDirectory

YourApp.exe

---------------------------------

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×