- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 2
- Posts with Upvotes
- 2
- Upvoting Members
- 2
- Downvotes Received
- 2
- Posts with Downvotes
- 2
- Downvoting Members
- 2
13 Posted Topics
You can find it in the following book- Filthy Rich Clients Developing Animated and Graphical Effects for Desktop Java™ Applications By- Chet Haase Romain Guy
you can check this code, [CODE] import java.util.Scanner; public class GetUserPasswd { public static String firstName, lastName; // Declare your firstName & lastName /** # * @param args # */ public static void main(String[] args) { // TODO Auto-generated method stub setNames(); // to set firstName & lastName --- Dont …
I think you should also consider the fact that the dog is twice fast. Besides the cat, you should also calculate distances of the trees from the dog. Select only the tree for which, (distance of dog - 2 * distance of cat) is maximum. The dog won't be able …
You can also use the BufferedReader class beside the Scanner class, check j2se tutorial for reading user input for better understanding... [CODE] import java.io.*; public class GetUserInput { public static void main( String [] args ) { String str = null; BufferedReader br = new BufferedReader( new InputStreamReader(System.in) ); System.out.println( …
Your code runs good... just take care of formatting... it will help you to debug $ ./a.out Please press 1 to insert or press 2 to print or press 0 to exit 1 Enter an integer to insert into the linkedlist: 19 Please press 1 to insert or press 2 …
You can load image using the java.awt.image.BufferedImage class, and you want to do some operation on the image, To save an image to an output file you need to import the javax.imageio.ImageIO class. File f = new File( <String> filename); // e.g - "a.jpg" ImageIO.write( <BufferedImage> imgObj, <String> format , …
You can also do this... invoke printHand(list) from your addCard method. [CODE] public void addCard(Card c){ ArrayList<String> list= new ArrayList<String>(); list.add(c.toString()); printHand( list ); } public void printHand(ArrayList list){ for(String i:list){ System.out.print(i+" "); } } [/CODE]
Compile your java source, and you will get a *.class file after successful compilation. e.g, A.class Then create a html file e.g, RunApplet.html and write the following code in it [CODE] <html> <head> </head> <body> <applet code = "A.class" width = "400" height = "400" > </applet> </body> </html> [/CODE] …
// You can try this code [code]#include<stdio.h> #include<math.h> #include<stdlib.h> double **memalloc(int M,int N); main() { int i,j; double **a; a=memalloc(2,2); printf("a\n"); for(i=0;i<2;i++) { printf("\n"); for(j=0;j<2;j++) { a[i][j] = i+j; printf("%f\t",a[i][j]); } } return 0; } //FUNCTION-memalloc double** memalloc(int M,int N) { int i; double **y; y = (double**) malloc(M* sizeof(double …
[code]import java.io.*; import javax.imageio.*; import java.awt.*; import java.awt.image.*; import java.applet.*; //<applet code=newt.class width=1200 height =1200></applet> public class A extends Applet //implements ActionListener { File input; BufferedImage img = null; public void init() { input = new File( "D:\\b.jpg"); try { img = ImageIO.read( input ); } catch (IOException e) {} …
[QUOTE] I want to do convolve operation on an image using java. But the program shows a runtime error like cannot do Convolve operation on the image. I am attaching the code I have done. Please help... [/QUOTE] [CODE] import java.awt.image.*; public class ImageOperations { private BufferedImage image, blurredImage = …
// Use an imageicon and you can add icon within constructor or use b.setIcon( icon ) ImageIcon icon = new ImageIcon( "a.jpg" ); JButton b = new JButton( "Click", icon );
The End.
sourabh17