Java Image Displayer
May 24, 2013
I am having trouble with my code it is a java image dis-player and i cannot get it to work.
package GUI;
import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.Graphics2D;
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JFileChooser;
[Code] .....
View Replies
ADVERTISEMENT
Mar 17, 2014
I want to add this image to database how can i do.
View Replies
View Related
Jan 26, 2012
I'm relatively new to java and to image processing ... What I've done so far is make a simple application which opens the webcam and can take and save a picture. Ive then loaded the image pixel data into a 2d array. How then do I do what is known as 'fast fourier transform' on it from here?
View Replies
View Related
May 23, 2014
I have been trying to rotate an image on a certain degree, and still remain on the same position. I have tried g.rotate, but it just rotate around a center, and it does not keep the same position as before.
View Replies
View Related
Apr 7, 2014
Sir, I'am new to Swing Programming. I have to create an application where an image is displayed on one Label. The same image has to be split in parts and stored in database pert wise. Later the user has to retrieve the entire image by viewing a small part of the image. I have already displayed the full image on the Label, now i don't know how to split the image and store it part wise in the database.
View Replies
View Related
Jul 10, 2014
I have a GUI with several buttons and I'm using NetBeans GUI Builder to do. At the click of one of these I would like for it to open another frame containing a picture. So I associate a listener (actionPerformed) the button and when clicked it opens actually post the new frame.
In the new frame I waxed a JLabel and then I associate the image of the label. I saw that to do that NetBeans generates this code:
label.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/tree.png")));
My problem is that the picture is overwritten several times during the execution of the program is not changed yet in the frame. That is, in the new frame is always displayed an old version of the image.
I have an image that is created every time I click on the button (it always has the same name and same path). Basically I have a generic tree on which I perform the operations (add, remove, etc..). When I click on the button I call a method that generates the image of the tree (using Graphviz). So I have one image that changes over the time...
How can I do so that the image is always up to date?
The Code:
package View;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
public class AlberoIpotesi extends javax.swing.JFrame {
[Code] ....
View Replies
View Related
Apr 9, 2015
I want to load image in java using Html. it works in neatbeans. But if i create a jar file it not load
URL url = getClass().getClassLoader().getResource("http://www.javaprogrammingforums.com/images/sms.png");
String tab= "<html><table style='width:100%; table-layout:fixed'><tr><td style='width: 30px' rowspan=2 >
<img src='"+ url+ "' width=36 height=36/></td><td font color='#ffffff' style='width: 110px'><font size='4'>
"+namePerson+"</font></td><td font color='#ffffff'>"+myDate+"</td></tr> <tr>
<td font color='#ffffff' style='width: 110px'>"+str1+"</td></tr></table></html>";
jLabel1.setIcon(new ImageIcon(url));// it works
tmodel.addRow(new Object[] {tab}); // not works why
not work in jar file..
View Replies
View Related
Dec 2, 2014
how to display a jpg image on a through a Jlabel. I am sure it is a simple error but I am still new to GUI's. line 31 to 35 you can see the ImageIcon and file wrapped in the JLabel. I verified its in the correct location and file name, but usually fails (i thought) when it is not correct.
Java Code:
import java.awt.BorderLayout;
import java.awt.Color;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
[code]....
View Replies
View Related
Apr 30, 2012
I have an applet coded to recieve an image and upon mouse press i wish it to be cropped. For some reason its not implementing, I just think my brain is no longer doing what i think it should be or something, along those lines.
Code below
import java.applet.Applet;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.image.CropImageFilter;
import java.awt.image.FilteredImageSource;
import java.awt.image.ImageFilter;
import java.awt.image.ImageProducer;
public class CropImg extends Applet implements MouseListener
[Code] .....
View Replies
View Related
Aug 23, 2014
I have been on java applets and it's been fun but I'm stucked with painting a ladybug image on applet using "getImage ( getCodeBase(), "Images/ ladybug.gif") to load the image. It runs but the appletviewer is blank. My applets are not embedded in the web. I just type the codes in eclipse and click the 'run' button.I think the problem is that java is not finding the image in the directory I specified. Please where am I supposed to save the ladybug image so that java can find it on my system whenever I supply the path.
View Replies
View Related
Sep 18, 2014
I have to mirror an image in BlueJay (java)
I have the following code, but it is missing a little bit. My instructor gave me a hint. He said that i have to use the setValue() and getValue() methods, but i'm still confused..
This code only return a black image with the same compositions as the image I want to mirror.
public Image mirror()
{
Image mirrorImage;
mirrorImage = new Image(foto.getWidth(), foto.getHeight(), "spejling");
for(int i = 0; i < foto.getWidth(); i++)
[Code] ....
View Replies
View Related
Sep 30, 2014
I already done my program with images on it but when i convert it to exe , the images is not appearing.
Usually my images are located at documents netbeansprojectprojectimage.jpg
When i run the code on netbeans the images are appearing but when i convert it to exe or jar file run on a computer without netbeans.. images is not appearing ...
import java.awt.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.ImageIcon;
class Phonebook extends JFrame {
private static final int WIDTH = 430;
private static final int HEIGHT = 200;
public Phonebook()
[Code] ....
View Replies
View Related
Feb 12, 2015
can we use java programming for image processing. if yes then how do we do it?
View Replies
View Related
Mar 7, 2014
I want to set a background image in Java but nothing is working...
Java Code:
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JButton;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.FlowLayout;
class Background extends JPanel{
[Code] ....
Everything works fine except the picture, it's not showing. The b.png file is in the folder where the java file is. What should I do?
View Replies
View Related
Jan 5, 2015
I stored an image into MySQL database using swings and hibernate but I am struggling to retrieve that image from MySQL database and display same image in the jTable cell and same as on jLabel whatever I retrieve from the database using swings and hibernate .
View Replies
View Related
Jul 29, 2014
Working on an assignment for a class: Create a DESKTOP application that allows you to open an image file and enables you to zoom in on or out from an image. I believe all I need is too create an open button to open the actual image file, instead of the html link, this code is an example that the teacher provided.My current code:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.net.URL;
import java.io.*;
import javax.imageio.*;
[code]....
how to add an open file button so I can search for the file and then open it into my program.
View Replies
View Related
Mar 21, 2015
I wanna make a simple Java SE application which is only one jar file, but unfortunately there is an image which I want my app access it, what I have in mind is carrying that file with the app, but I don't know how to do it and how to access it in run-time.
View Replies
View Related
Dec 24, 2014
I had string url for image in mysql database and I want show image in mu jsp file bu I can't.
<c:forEach var="urun" items="${listUrun.rows}">
<tr>
<td><c:out value="${urun.kitapresim}" /></td>
<img src="<c:url value="${urun.kitapresim}" /> " width="270" height="190"/>
URL...
View Replies
View Related
Oct 7, 2014
I am trying to create a virus simulation program. The program is supposed to just be a map of the world where the user can click any country in the world to specify where they want their virus to start, specify how transmittable the virus is, and be able to see how the virus spreads through the world by seeing a change in color throughout the world,
I want the world map to initially start out with a very light yellow, and as areas of the world slowly start to get more and more infected by the virus, I want those areas on the map to start changing to a very dark red (going from a light yellow, through shades of orange and red, to dark red).
So, the main idea of this is to have a program that displays an image where certain parts of the image will slowly change color during the runtime of the program. I obviously know how to change colors of certain parts of a window or even an image, but this is very very detailed and advanced but how to even start this.
View Replies
View Related
Mar 19, 2015
Okay, gotta be able to move the image when a key is pressed. When I test it, the image moves, but leaves the old image behind.
package Game;
import java.awt.Component;
import javax.swing.JOptionPane;
public class Game
{
private Grid grid; //holds the grid used to store and display images
private int userRow; //keep track of which row the user-controlled image appears in
private int msElapsed; //keep track of the total amount of milliseconds that have elapsed since the start of the game
[Code] ....
Here is what I was given on instructions:
Complete the handleKeyPress method. Write the following line of code in the handleKeyPress method to check for a key press:
int key = grid.checkLastKeyPressed();
If the user pressed the up arrow (key == 38), move the user's image up one row (unless the user is already in the top row). Likewise, if the user pressed the down arrow (key == 40), move the user's image down one row (unless the user is already in the bottom row). Either way, make sure to update userRow.
Movement of the image can be accomplished by changing the value of userRow. Study how the initial image is displayed in the game constructor, then
Set the current image location to null
Update userRow to the new location and,
Set the image in the new value of userRow.
You should be able to move the user image up and down, and you should be prevented from moving the image off the screen.
View Replies
View Related
Jul 11, 2014
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
class image implements ActionListener
{
JFrame frmobj= new JFrame("image");
JPanel panel= new JPanel();
JButton b1= new JButton("image");
[Code] ....
View Replies
View Related
May 19, 2013
I am doing a project "online election system" client-server base application.
I have a party registration class in my program. and I have a party registration form in which I want to upload a image(Poll Symbol) for newly register party. but I don't know how to do this.?
View Replies
View Related
Sep 26, 2014
I am looking to do it on data carving which is a technique used in digital forensics to extract known file information from unstructered raw data.
So, Lets say I make a bit for bit image of a usb drive that has some deleted images on it, jpeg maybe.
I can still recover this file by locating its header and footer information as its raw data is still on the drive after it has been deleted.
I would like to build a java application to automate this task. My problem is I dont know how to read any of the known digital forensics image (bit for bit copy of the driv) formats such as aff, e01 or raw dd.
Is it possible for me to read bytes from a raw data file in java, maybe search that file for the bytes I need and pull them out of there, perhaps to an array or something ??
I was thinking, if I could get all the raw data into a binary file in java it might be easier to work from there. What I really need is to get access to those bytes. If I could even write them all out to a text file, Id have something to work with.
View Replies
View Related
Feb 23, 2014
I successfully added a background image on the Panel but I can't create my JButton image on top of my background image.
ImageIcon piano = new ImageIcon("src/img/piano_backgrd.png");
JLabel backlabel = new JLabel(piano);
panel.add(backlabel, new Integer(Integer.MIN_VALUE));
backlabel.setBounds(0, 0, piano.getIconWidth(), piano.getIconHeight());
JButton volup = new JButton(new ImageIcon("src/img/volup.png"));
volup.setLocation(10, 0);
panel.add(volup);
View Replies
View Related
Sep 13, 2014
//compiler error I'm receiving
J:CS3Student Folder Review Lab #2APlusImage.java:41: error: cannot find symbol
xcor.add(read.nexInt());
[Code].....
View Replies
View Related
Nov 21, 2014
I'm trying to make a method that takes an image and turns it into a tile image. So if the original image looks like this:
[URL] ....
then the output image should look like this:
[URL] ....
Here's a method that's supposed to do that but for some reason the output image looks the same as the original:
public static int[][] tile(int[][] arr){
int[][] tile = new int[arr.length][arr[0].length];
for (int i = 0; i < arr.length; i++) {
tile[i]=arr[i];
}
return tile;
}
I recently changed the method and the error message I'm getting is "bad operand types for binary operator '+'. Here's the method:
public static int[][] tile(int[][] arr){
int[][] tile = new int[arr.length][arr[0].length];
for (int i = 0; i < arr.length; i++) {
for(int j=0; j<arr[i].length;j++){
tile[j]=(tile[j])+(arr[i]);
}
}
return tile;
}
View Replies
View Related