Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Displaying images  RSS feed

 
Gustave Gustave
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I need to load images into a Frame. Also, I must have to move them, change their size and, if it's possible, to rotate them. It's not an applet. May somebodye to help me? thks a lot
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll need to look into Java2D... it supports all these operations... I would put each image onto a separate JPanel or JLabel to control it. I'll work on a simple code example... could you give a little more background in what you are trying to do?

-Nate
 
Gustave Gustave
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nathan,
You can mind my application like a photo album. First, I insert blank pages and then I'm add images into the page. Really, this application must have support the insertion of images, texts, and video, but the last one is not very important for now. One more question: How can I to get the position of the pics inserted? Thansk again
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like you still need to look into Java2D... along with JMF ( the Java Media Framework... a must if you are going to work with video... ) and JAI ( the Java Advanced Imaging API ). I would use a JPanel with a null layout for the "page", since the user is going to be laying out the components on the page, you are going to need for location and bounds to be explicitly set. I would make the photos ImageIcons on JLabels, and do text on JTextAreas ( or JEditorPanes, depending on what you need... ). I haven't worked that much with video, but it also has some sort of component to put it on the page. All components have the methods getLocation() to get the Point of the upper left corner, getSize() to get the current Dimension size, and getBounds() which returns a combination of these as a Rectangle, so you can get infomation about where an object is and how large it is.

-Nate
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!