|
I was wondering if anyone could help me. I have a number of .JAR files which I want to be able to access from VB. I have downloaded a utility which converts the .JAR file into a .DLL which means I can access it using VB code. Unfortunately the software was evaluation only and very expensive. Does anyone know of a free utility that does this or another solution ? The software was from the following site:
http://www.ezjcom.com
Thanks,
Raj
|
|
|
|
|
Thank U Mr.RaJ...........
By Ramesh (GNIIT)
|
|
|
|
|
Dear All,
I've been trying to display the Tif image into the WebBrowser with the help of Applet embedded into a JSP through NetBeans IDE.
To achieve this goal, I've created 2 projects "NewApplet" which contains the Applet class and "WebApplication1" which has "Index.JSP" which embeds the Applet.
If i execute Only the Applet, it displays the TIF. But if i execute the JSP, it fires the following error:
"URL Scheme is not "file" http://localhost:8084/WebApplication1/alpesh.tif""
Following is the code written NewApplet.Java:
package display;
import javax.swing.JApplet;
import java.awt.BorderLayout;
import java.awt.image.RenderedImage;
import java.io.IOException;
import javax.swing.JDesktopPane;
import javax.swing.JInternalFrame;
import javax.swing.JScrollPane;
import com.sun.media.jai.codec.ImageCodec;
import com.sun.media.jai.codec.ImageDecoder;
import com.sun.media.jai.codec.TIFFDecodeParam;
import com.sun.media.jai.widget.DisplayJAI;
import java.io.File;
import java.io.FileInputStream;
import java.net.URI;
import javax.swing.JOptionPane;
public class NewApplet extends JApplet {
@Override
public void init() {
URI FileName = URI.create(getCodeBase().toString().concat(getParameter("imageSource")));
try
{
File f = new File(FileName);
FileInputStream stream = new FileInputStream(f);
// Create a decoder using that stream.
TIFFDecodeParam tiff = new TIFFDecodeParam();
ImageDecoder dec = ImageCodec.createImageDecoder("tiff", stream, tiff);
// Get the number of pages.
int pages;
pages = dec.getNumPages();
// Set the application title.
setTitle(pages+" pages in "+filename);
// Create a JDesktop to hold the pages in internal frames.
JDesktopPane desktop = new JDesktopPane();
//getContentPane().add(desktop,BorderLayout.CENTER);
desktop.setSize(400,400);
add(desktop,BorderLayout.CENTER);
// Open all images in the TIFF into the desktop pane.
for(int i=0;i<pages;i++)
{
// Get the image.
RenderedImage ri = dec.decodeAsRenderedImage(i);
// Create and set the user interface of an internal frame.
JInternalFrame jif = new JInternalFrame("Page "+i,true,true,true,true);
jif.getContentPane().add(new JScrollPane(new DisplayJAI(ri)));
jif.setSize(400,400);
jif.pack();
jif.setVisible(true);
// Add the internal frame to the JDesktop.
desktop.add(jif);
}
// Set the application closing behaviour, frame size, and show it.
//setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(400,400);
setVisible(true);
}
catch (Exception e)
{
JOptionPane.showMessageDialog(this, e.getMessage(), "alert", JOptionPane.ERROR_MESSAGE);
}
}
}
Following is the code written Index.JSP:
<APPLET code="display.NewApplet" ARCHIVE="NewApplet.jar" width=350 height=200>
<param name ="imageSource" value="alpesh.tif"/>
</APPLET>
Any Guesses?
I've added the "dist/NewApplet.jar" in WebApplication1 through the option of "Properties->Build->Packaging" in NetBeans.
Please help!
- Alpesh
- Alpesh Khunt
|
|
|
|
|
that doesn't to be reposted
|
|
|
|
|
Dear All,
I've been trying to display the Tif image into the WebBrowser with the help of Applet embedded into a JSP through NetBeans IDE.
To achieve this goal, I've created 2 projects "NewApplet" which contains the Applet class and "WebApplication1" which has "Index.JSP" which embeds the Applet.
If i execute Only the Applet, it displays the TIF. But if i execute the JSP, it fires the following error:
"URL Scheme is not "file" http://localhost:8084/WebApplication1/alpesh.tif""
Following is the code written NewApplet.Java:
package display;
import javax.swing.JApplet;
import java.awt.BorderLayout;
import java.awt.image.RenderedImage;
import java.io.IOException;
import javax.swing.JDesktopPane;
import javax.swing.JInternalFrame;
import javax.swing.JScrollPane;
import com.sun.media.jai.codec.ImageCodec;
import com.sun.media.jai.codec.ImageDecoder;
import com.sun.media.jai.codec.TIFFDecodeParam;
import com.sun.media.jai.widget.DisplayJAI;
import java.io.File;
import java.io.FileInputStream;
import java.net.URI;
import javax.swing.JOptionPane;
public class NewApplet extends JApplet {
@Override
public void init() {
URI FileName = URI.create(getCodeBase().toString().concat(getParameter("imageSource")));
try
{
File f = new File(FileName);
FileInputStream stream = new FileInputStream(f);
// Create a decoder using that stream.
TIFFDecodeParam tiff = new TIFFDecodeParam();
ImageDecoder dec = ImageCodec.createImageDecoder("tiff", stream, tiff);
// Get the number of pages.
int pages;
pages = dec.getNumPages();
// Set the application title.
setTitle(pages+" pages in "+filename);
// Create a JDesktop to hold the pages in internal frames.
JDesktopPane desktop = new JDesktopPane();
//getContentPane().add(desktop,BorderLayout.CENTER);
desktop.setSize(400,400);
add(desktop,BorderLayout.CENTER);
// Open all images in the TIFF into the desktop pane.
for(int i=0;i<pages;i++)>
{
// Get the image.
RenderedImage ri = dec.decodeAsRenderedImage(i);
// Create and set the user interface of an internal frame.
JInternalFrame jif = new JInternalFrame("Page "+i,true,true,true,true);
jif.getContentPane().add(new JScrollPane(new DisplayJAI(ri)));
jif.setSize(400,400);
jif.pack();
jif.setVisible(true);
// Add the internal frame to the JDesktop.
desktop.add(jif);
}
// Set the application closing behaviour, frame size, and show it.
//setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(400,400);
setVisible(true);
}
catch (Exception e)
{
JOptionPane.showMessageDialog(this, e.getMessage(), "alert", JOptionPane.ERROR_MESSAGE);
}
}
}
Following is the code written Index.JSP:
<applet code="display.NewApplet" archive="NewApplet.jar" width="350" height="200">
<param name="imageSource" value="alpesh.tif" />
</applet>
Any Guesses?
I've added the "dist/NewApplet.jar" in WebApplication1 through the option of "Properties->Build->Packaging" in NetBeans.
Please help!
Ritesh
|
|
|
|
|
i am using vector data structure in my code
1- i create the following vector of vector:
Vector<vector><integer>> dataVector= new Vector<vector><integer>>();</integer></vector></integer></vector>
and i need to do the following if some condition is true , create new vector and add to the dataVector
maybe somthing like this
if (condition==turu)
then creat new vector
dataVector.add(new vector)
can any one help me
|
|
|
|
|
sudany_zool wrote: Vector> dataVector= new Vector>();
this is badly formatted.
did you mean Vector<Vector<Integer>> ?
anyway, where are you stuck exactly ?
and to understand your problem better, what is your "vector of vector" supposed to represent ?
|
|
|
|
|
creating a cell class.
The first should be called Cell. It represents one cell (square) of the tic-tac-toe board. It should contain at least one property, the character which occupies the cell. You may use either a blank character (‘ ‘) or a null to indicate an empty Cell, but I think you will find that the blank works better. Cell must also contain the following methods:
Constructor - create the cell and initialize the letter in the cell.
void setCell( char letter) - set the value in the cell.
char getCell( ) - return the letter in the cell.
boolean isEmpty( ) - return true if the Cell holds a blank, false otherwise.
|
|
|
|
|
so, what's your question exactly ?
are you totally stuck with it ? or have you already started something ?
as you might know (you are not supposed to ignore the rules out there), we don't do homeworks...
|
|
|
|
|
I would start by creating a text file named after the class you are supposed to create, but with the appropriate extension for a source code file.
We will call this the source code file.
Inside that file, I would declare a class using the standard class declaration syntax, which you can find if you look at any Java HelloWorld program.
Inside that declaration, I would declare 4 methods (or 1 constructor and 3 methods, if you prefer) using standard constructor/method declaration syntax. Again, find a HelloWorld program. Better still, see the last 4 lines of your question, where you have everything but the braces {}.
You would also like to have at least one member variable (the property), which you can name Harvey. Harvey, I think you will find, works better than Fred. But you can call it Fred if you must. Never call it Farqhuat, because people will laugh at you.
The constructor should ponder the existence of itself, asking such things as "Why am I here?", "Who made me?", "Of what use am I?", and "Does peanut butter always have to have jelly to make a good sandwich?" You should not code any of that, but it must be implied. See Webster's Dictionary for an example of implying.
The setter method should ideally set something, and the getter method would, in a perfect world, get that thing. It's up to you to make the world perfect.
The test method, on the other hand, should not lie about the contents unless it is a Tuesday.
|
|
|
|
|
|
Hi to all, I need some help in getting the union of of 2 interacting polygons.
Currently I have managed to draw 2 polygons p1 and p2, and I got stuck on getting the unions between the 2 polygons. I have tried using the java.awt.geom, but later realized that the geom package can only be used for regular shapes.
This is part of my code:
Polygon p1 = new Polygon();
for (int i = 0; i < 5; i++)
p1.addPoint((int) (200 + 50 * Math.cos(i * 2 * Math.PI / 5)),
(int) (100 + 50 * Math.sin(i * 2 * Math.PI / 5)));
g.drawPolygon(p1);
Polygon p2 = new Polygon();
for (int i = 0; i < 5; i++)
p2.addPoint((int) (160 + 50 * Math.cos(i * 2 * Math.PI / 6)),
(int) (60 + 50 * Math.sin(i * 2 * Math.PI / 6)));
g.drawPolygon(p2);
Please help. Thanks.
|
|
|
|
|
|
1) we don't do homework here.
2) read the forums posting guidelines
3) "the int type has a limitation: it can’t store integer values larger
than 231"
Where the f*ck does this come from ?????
|
|
|
|
|
I would assume that by 231 he means 2^31, which is the limitation for a signed int.;
As for the question, what you are going to have to do is remember back to gradeschool, when we did longhand arithmetic.
1001
2009
----
3010
Write out psuedo code on how to do this, then implement it. isValidBigInt should be easy.
|
|
|
|
|
TannerB wrote: I would assume that by 231 he means 2^31
this is fundamentaly different, and moreover, WRONG.
the higher value an unsigned int can take is (2^32)-1, which is 4 294 967 295.
|
|
|
|
|
Thanks, must of had a brain fart when I read it.
|
|
|
|
|
As far as I remember, there is only signed int in Java, so its maximum value would be (2^31)-1 (2,147,483,647).
My LinkedIn Profile
|
|
|
|
|
I've got this here code I just started today for an assigment, it is all working (so I'm not asking you to do it for me :P). What this code does is it considers any @ to be a backspace and deletes the character before it. I was supposed to use indexOf() and substring() but I thought using regular expressions would be simpler, and a learning experience at the same time. I think my problem right now is that I have stared at it for too long. What I want is for the loop in main to be ran atleast once but it seems weird to have the while(checkForError(input)); ran and then have it ran again in the method fixErrors . Any thoughts on what I could do to fix this would be welcome. Other comments and critiques are always welcome.
Thanks,
Tanner
EDIT: Update at bottom.
import javax.swing.*;
import java.util.regex.Pattern;
import java.util.regex.Matcher;
public class bruce_tanner_A3Q3
{
public static void main(String [] args)
{
String input;
do
{
input = getString("Enter a string");
printOutput(fixErrors(input));
}while(checkForError(input));
}
public static boolean checkForError(String input)
{
Pattern pattern = Pattern.compile("@");
Matcher matcher = pattern.matcher(input);
return matcher.find();
}
public static String getString(String input)
{
String tempString = JOptionPane.showInputDialog(input);
return tempString;
}
public static void printOutput(String tempString)
{
System.out.println(tempString);
}
public static String fixErrors(String tempString)
{
if(checkForError(tempString))
{
Pattern pattern = Pattern.compile("[^@][@?+]");
Matcher matcher = pattern.matcher(tempString);
while(matcher.find())
{
tempString = matcher.replaceAll("");
matcher = pattern.matcher(tempString);
}
pattern = Pattern.compile("@");
matcher = pattern.matcher(tempString);
tempString = matcher.replaceAll("");
return tempString;
}
return "This string is error free";
}
}
I'm not sure whether this was a flash of brilliance or not but it works.
New main code:
public static void main(String [] args)
{
String input;
for(input = getString("Enter a string"); checkForError(input); input = getString("Enter a string"))
{
printOutput(fixErrors(input));
}
printOutput("This string is error free");
}
New fixErrors:
public static String fixErrors(String tempString)
{
Pattern pattern = Pattern.compile("[^@][@?+]");
Matcher matcher = pattern.matcher(tempString);
while(matcher.find())
{
tempString = matcher.replaceAll("");
matcher = pattern.matcher(tempString);
}
pattern = Pattern.compile("@");
matcher = pattern.matcher(tempString);
tempString = matcher.replaceAll("");
return tempString;
}
modified on Monday, November 3, 2008 2:57 PM
|
|
|
|
|
I have a Swing based application which consists of 5 classes.
Now I want to make the whole application as an exe file.
Can some one help me in this regard......
|
|
|
|
|
do you use an IDE ? if yes, which ?
|
|
|
|
|
you can download the jet engine exe file then u can attach the class files and then run which is very very useful jet is available at sun products
Ambedkar Golla
|
|
|
|
|
Use this tool:
JSmooth
The downlodad URL is:
http://www.ej-technologies.com/download/exe4j/files.php
If you don't know the package method send a mail to me. [soief@qq.com]
|
|
|
|
|
how to develop installation web application software using java(servlets,jsp),java script,mysql(database).
|
|
|
|
|
I have this problem,
I need to represent set in the following form
[L,R]
where L is the left hand-bound of the set , and R is the right hand-bound
each of L and R are a collection of sets
for example
L= [{1},{2},{2,3}]
R=[{1,2,3},{2,3,4}]
[L,R]= [{ {1},{2},{2,3} } , { {1,2,3},{2,3,4} }]
how can i do this in java
|
|
|
|
|