JAVA image zoom in/out

JAVA image zoom in/out

how to write function in java for image zoom in and zoom out using jFreeChart?
View Answers

September 23, 2010 at 5:41 PM

Hi Friend,

Try the following code:

import java.awt.* ;
import org.jfree.ui.*;
import org.jfree.data.*;
import org.jfree.chart.*;
import org.jfree.data.xy.*;
import org.jfree.chart.plot.*;
public class Chart extends ApplicationFrame {
private ChartPanel chartPanel;
public Chart(String title) {
super(title);
XYSeries series = new XYSeries("Marks");
series.add(1, 80);
series.add(2, 75);
series.add(3, 70);
series.add(4, 90);
XYDataset xyDataset = new XYSeriesCollection(series);
JFreeChart chart = ChartFactory.createXYLineChart
("XYLine Chart using JFreeChart", "ID", "Marks",
xyDataset, PlotOrientation.VERTICAL, true, true, false);

chartPanel = new ChartPanel(chart);
chartPanel.setHorizontalAxisTrace(true);
chartPanel.setVerticalAxisTrace(true);
chartPanel.setPreferredSize(new java.awt.Dimension(400, 270));
setContentPane(chartPanel);
}

public static void main(String [] args) {
Chart demo = new Chart("Mouse Zoom Demo");
demo.pack();
RefineryUtilities.centerFrameOnScreen(demo);
demo.setVisible(true);

}
}

Hope that it will be helpful for you.
Thanks

October 1, 2011 at 6:14 PM

hi...........

but i am getting error in import file.?//////

can u tell me the reason???????









Related Tutorials/Questions & Answers:
JAVA image zoom in/out - Framework
JAVA image zoom in/out  how to write function in java for image zoom in and zoom out using jFreeChart?  Hi Friend, Try the following... static void main(String [] args) { Chart demo = new Chart("Mouse Zoom
Java Swing code for zoom in and out
Java Swing code for zoom in and out  hi.......... I require a code in java swing for image zoom in and zoom out can u tell me how it can be done or what is the code plz help
Advertisements
JavaScript Zoom in and Zoom out
illustrates you how to zoom in and zoom out of an image using JavaScript. Here we... and width of the image and make it to show the effect Zoom In and Zoom Out... the image zoom in and zoom out. As long as you put the cursor on the link Zoom
UIWebView Zoom in and out
UIWebView Zoom in and out  Hi, Can anyone give me the example of tap and zoom in and out the pdf loaded on uiwebview?? Thanks
Zoom Out Excel
zoom out excel       In this program we are going to make a java program through which we can zoom out(+) an excel sheet. This means you can make an excel sheet larger
Image Zoom Behavior in Flex 4
Flex Zoom Image Effects:- In Graphical interface we can make components larger... an image component with the help of zoom behavior in flex. In this tutorial we can set...; for zoom effects for image zoom. Flex Image Zooming Behavior Example:-ADS
Zoom Image with the help of play and reverse mehod in flex
Flex Zoom with the help of Action Script:- In this tutorial you can see how to apply zoom through mouse events if  mouseup on the  image component  are zoomin and mouseout image zoom out. you can see how to use doZoom
MX Zoom Effect in Flex4
MX Zoom Effect in Flex4: The component will zoom in or out on a center point using Zoom effect. The tag of Zoom effect is <mx:Zoom>. The syntax is following: <mx:Zoom id="ID" originX="Calculated"
Zoom Image section using jQuery plug-in
Zoom Image section using jQuery plug-in In this section, you will learn how to zoom an image section by hovering mouse on it using jQuery. The plug-in ,we... this box on image's any area , it will zoom that area. zoomImage.html <
Image swap on MouseOver ann Mouse out
Image swap on MouseOver ann Mouse out  I tried ur code for multiple images but didnt get the right answer...i dont want the hardcodded code...a code...(); arr[1] = new Image(); arr[1].src = "1.jpg"; arr[2] = new Image(); arr[2].src
java code - Java Beginners
java code  can u please post java code for zoom in and zoom out an bufferedImage class image
uiwebview zoom
uiwebview zoom  Hi, I want to zoom UIWebview programmatically... to set zoom level. for (UIScrollView *scroll in [webView subviews]) { //Set the zoom level. [scroll setZoomScale:2.5f animated:YES
with out class - Java Beginners
with out class  can we write a program with out a class in core java?if yes,give example
mkmapview zoom to current location
mkmapview zoom to current location  How can i zoom map to the current location
ModuleNotFoundError: No module named 'zoom'
ModuleNotFoundError: No module named 'zoom'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'zoom' How to remove the ModuleNotFoundError: No module named 'zoom' error
image compression - Java Beginners
image compression  image compression in java coding
UIWebView zoom not working
UIWebView zoom not working  Hi, I don't know why UIWebView zoom not working? Tell the solution. Thanks   Hi, Open the .xib file and set scalesPageToFit to YES. Thanks
Java Image Browsing Applet
Java Image Browsing Applet  Hi. I want to create an applet which is embedded in html page which display image by browsing the files in the computers hard disk... Please help me out
how to highlight the field in image,when i have entered into that corresponding field's textbox-any one help out
how to highlight the field in image,when i have entered into that corresponding field's textbox-any one help out  how to highlight the field in image... consist of a jpeg image on the top and below that image fields(text boxes) exist
java image compression - Java Beginners
java image compression  image compression in java
java rotate image
java rotate image   How to rotate image to 90 and 180. can you please post an example to rotate image
image - Java Beginners
image  how to identify the watermarked image? or how to convert the watermarked image into original image? can you send that corresponding java code
image retrieve - Java Beginners
Image Retrieve  How to retrieve the image from mysql field using java
Image Processing Java
://www.universalwebservices.net/web-programming-resources/java/adjust-jpeg-image-compression...Image Processing Java  Using This Code I Compressed A JPEG Image And the Original Size of the image is 257kb and The Compressed Image Size Is 27kb
UIImageView UIScrollView Zoom
UIImageView UIScrollView Zoom   I am trying to implement a Zoomin / Zoomout feature in UIImageView and wanted to have the scroll capability init.   UIImageView *tempImage = [[UIImageView alloc]initWithImage:[UIImage
ModuleNotFoundError: No module named 'zoom_shortener'
ModuleNotFoundError: No module named 'zoom_shortener'  Hi, My... named 'zoom_shortener' How to remove the ModuleNotFoundError: No module named 'zoom_shortener' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'zoom-tormysql'
ModuleNotFoundError: No module named 'zoom-tormysql'  Hi, My... 'zoom-tormysql' How to remove the ModuleNotFoundError: No module named 'zoom-tormysql' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'edx-zoom'
ModuleNotFoundError: No module named 'edx-zoom'  Hi, My Python...-zoom' How to remove the ModuleNotFoundError: No module named 'edx-zoom... to install padas library. You can install edx-zoom python with following
image save to folder in java
image save to folder in java  Hi, I am working with java. In my application i want to give facility to user to add and change image. I use open dialog box to select image, it will work properly i.e on button click open dialog
image upload in java
image upload in java  Hi, I am working with java. In my application i want to give facility to user to add and change image. I use open dialog box to select image, it will work properly i.e on button click open dialog is open
Image using Java coding
Image using Java coding  Hai, Display image in pdf file using Java coding through Xsl file.. Please help me.. xsl file generate the pdf file
image effects - Java Beginners
image effects  hey can u help me in loadin an image file... that will show you image crop effect: import java.sql.*; import java.awt.... java.awt.image.FilteredImageSource; public class Upload extends JPanel { BufferedImage image; Image img
image displaying in java
image displaying in java  how to display an image by using load image button in applet viewer
A Java Program That Prints Out Result Via Printer
A Java Program That Prints Out Result Via Printer  A Java Program That Prints Out Result Through Printer Depending upon paper size , and print the calculated result on printer and save result as text file
image sending - Java Beginners
image sending  how to send an image from one computer(client) to other computer
read an image in java
read an image in java  qns: how we can read an image tell me about its code
elasticsearch java heap space out of memory
elasticsearch java heap space out of memory  Hi, How to set heap size in elasticsearch to overcome java heap space out of memory? Thanks  ... or Use following command while running elasticsearch: ES_JAVA_OPTS="-Xms10g
how to run java application with out stoping
how to run java application with out stoping  I have one java application to download some pdf file but its going to stop downloading after some time it not giving any errors any thing can any one help me to solve this problem
Write a java program that prints out the following menu???
Write a java program that prints out the following menu???  Write a java program that prints out the following menu. Auser can interact with the menu using numbers (1,2,3,4,5,6). The menu will be printed again if the user enters
How to handle Transaction IN and OUT in Inventory using java
How to handle Transaction IN and OUT in Inventory using java  Hi... when the items are OUT, again same scan two times as we have two barcodes... and just make TransactionStatus, Dt.of.Transaction,InventoryQty to OUT, watever
List with out duplicates - Java Interview Questions
List with out duplicates   Hi all, Naturally in java a list will allow duplicates, but if i want the list which shouldn't allow duplicates then what should be the logic? Thanks in advance abhee  Hi friend
how to convert string to image in java
how to convert string to image in java  how to convert string to image in java? I know we need to convert image to a byte array at some point in my application but do not know how to convert a image into byte string. Please
java image slider or code 4 java-image slideshow
java image slider or code 4 java-image slideshow   plz help me out with java code for running an application in which images wil slide automatically... image slider using java
ModuleNotFoundError: No module named 'django-cache-zoom'
ModuleNotFoundError: No module named 'django-cache-zoom'  Hi, My... named 'django-cache-zoom' How to remove the ModuleNotFoundError: No module named 'django-cache-zoom' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'UW-RestClients-Zoom'
ModuleNotFoundError: No module named 'UW-RestClients-Zoom'  Hi, My... named 'UW-RestClients-Zoom' How to remove the ModuleNotFoundError: No module named 'UW-RestClients-Zoom' error? Thanks   Hi
ModuleNotFoundError: No module named 'UW-RestClients-Zoom'
ModuleNotFoundError: No module named 'UW-RestClients-Zoom'  Hi, My... named 'UW-RestClients-Zoom' How to remove the ModuleNotFoundError: No module named 'UW-RestClients-Zoom' error? Thanks   Hi
ModuleNotFoundError: No module named 'django-cache-zoom'
ModuleNotFoundError: No module named 'django-cache-zoom'  Hi, My... named 'django-cache-zoom' How to remove the ModuleNotFoundError: No module named 'django-cache-zoom' error? Thanks   Hi, In your
image insert - Java Beginners
image insert  i browsed the image by clicking d browse button.if i press submit button means d image automatically stored in db.then i have 2 retrieve d image separately...................... Untitled Document
image
image  how to add the image in servlet code
Display Image in Java
Display Image in Java       This example takes an image from the system and displays... C:\image>java ShowImage Enter image name rajeshxml2.gif

Ads