Simple way display image in panel bar
I have a panel and i'd like to display an image in the upper
right corner of the panel bar.
Anyone know of a simple way to do this?
The simplest way is to put both the Panel and Image on a
Canvas, then use x,y of the image to position it where you want.
Tracy
Similar Messages
-
Hi, iam tryin to get an image displayed in my panel using getImage. but all i get is a NullPointerException error whenever i link to this particular page that requires the image.
I was told loadImage could be the possible solution, tried so, but still doesnt work.
Any suggestions? thanks
boolean flag = true;
removeAll(); // remove all components from container
panel1 = new Panel(new FlowLayout());
panel2 = new Panel(new FlowLayout());
panel3 = new Panel(new FlowLayout());
panel1.setBackground(Color.gray);
panel2.setBackground(Color.orange);
panel3.setBackground(Color.gray);
add(panel1, BorderLayout.NORTH);
add(panel2, BorderLayout.CENTER);
add(panel3, BorderLayout.SOUTH);
q1 = this.getImage(getDocumentBase(), "1.gif");
q1.loadImage(getDocumentBase(), this);
ques[1] = q1;
//previous = new Button("<");
next0 = new Button("Done");
ansF1 = new TextField(25);
next0.addActionListener(this);
panel3.add(next0);
panel3.add(ansF1);
ansF1.requestFocus();
validate();
repaint();Oops, sorry posted wrongly
private void Quiz1()
boolean flag = true;
removeAll(); // remove all components from container
panel1 = new Panel(new FlowLayout());
panel2 = new Panel(new FlowLayout());
panel3 = new Panel(new FlowLayout());
panel1.setBackground(Color.gray);
panel2.setBackground(Color.orange);
panel3.setBackground(Color.gray);
add(panel1, BorderLayout.NORTH);
add(panel2, BorderLayout.CENTER);
add(panel3, BorderLayout.SOUTH);
q1 = this.getImage(getDocumentBase(), "1.gif");
q1.loadImage(getDocumentBase(), this);
ques[1] = q1;
next0 = new Button("Done");
ansF1 = new TextField(25);
next0.addActionListener(this);
panel3.add(next0);
panel3.add(ansF1);
ansF1.requestFocus();
validate();
repaint();
} -
Hey all,
Just wondering if anyone knows any simple ways to create a popup over lay window like what fancybox/lightbox/shadow box does and get it to work with a Dreamwever fluid grid site?
I've got pikachoose+fancy box to run together perfectly in a plain html page, but when I bring that code into a Dreamweaver fluid grid site, the code doesn't work (well images don't cycle, and popover doesnt load when you click on the image link).
I'm guessing it's a jquery conflict of some kind.
Any help would be great, I can post the full code if someone is able to take a look. When I inspect the code in Google Chrome web inspector I get in the console:
Uncaught TypeError: Cannot read property 'msie' of undefined jquery.fancybox-1.3.4.pack.js:18
Uncaught TypeError: Object [object Object] has no method 'fancybox'
Code below
<!doctype html>
<html class="">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>-</title>
<link href="boilerplate.css" rel="stylesheet" type="text/css">
<link href="css/ce4.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="jquery.fancybox-1.3.4.css" media="screen" />
<link type="text/css" href="styles/bottom.css" rel="stylesheet" />
<script src="respond.min.js"></script>
<script type="text/javascript" src=" https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script>
<script type="text/javascript" src="lib/jquery.pikachoose.js"></script>
<script type="text/javascript" src="jquery.fancybox-1.3.4.pack.js"></script>
<script language="javascript">
$(document).ready(function (){
var a = function(self){
self.anchor.fancybox();
$("#pikame").PikaChoose({hoverPause:true, showCaption:false, text: {previous: "", next: "" }, buildFinished:a});
</script>
</head>
<body>
<div class="pikachoose">
<ul id="pikame" >
<!-- <li><a href="1.jpg"><img src="1.jpg"></a>-->
<li>
<a href="images/1large.jpg">
<img src="images/1small.jpg"/>
</a>
<span></span></li>
etc... etc...
Any help would be greatI don't know what a pikachoose is, but Fancybox2 works in Fluid Layouts. Copy & paste the following code into a new, blank document.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>HTML5, with Fancybox2 Viewer</title>
<!--LATEST JQUERY CORE LIBRARY-->
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<!--FANCYBOX plugins-->
<link href="http://cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.4/jquery.fancybox.css" rel="stylesheet" media="screen">
<script src="http://cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.4/jquery.fancybox.pack.js"></script>
<style>
/**this styles image container**/
#thumbs p {
float:left;
width: 180px;
height: 12.5em;
margin: 10px 0 0 20px;
padding: 10px;
border: 1px solid silver;
/**rounded borders**/
-moz-border-radius: 20px;
-webkit-border-radius:20px;
border-radius: 20px;
/**this styles caption text**/
font: italic 14px/1.5 Geneva, Arial, Helvetica, sans-serif;
color: #666;
text-align:center;
/**recommend using same size images**/
#thumbs img {
width: 160px; /**adjust width to thumbnail**/
height: 120px; /**adjust height to thumbnail**/
margin-bottom: 1.5em;
opacity: 0.75;
#thumbs img:hover {opacity: 1.0}
/**float clearing**/
#thumbs:after {
content:".";
clear:left;
font-size:0px;
line-height:0;
display:block;
visibility:hidden;
</style>
</head>
<body>
<h1><a href="http://fancyapps.com/fancybox/">Fancybox2</a> Viewer with images</h1>
<!--insert thumbnails with links to full size images below-->
<div id="thumbs">
<p><a class="fancybox" data-fancybox-group="gallery" href="http://placehold.it/400x320.jpg" title="optional captions"><img src="http://placehold.it/160x120.jpg" alt="Thumbnail 1" /></a> <br />
Caption 1
</p>
<p><a class="fancybox" data-fancybox-group="gallery" href="http://placehold.it/400x320.jpg" title="optional captions"><img src="http://placehold.it/160x120.jpg" alt="Thumbnail 2" /></a> <br />
Caption 2
</p>
<p><a class="fancybox" data-fancybox-group="gallery" href="http://placehold.it/400x320.jpg" title="optional captions"><img src="http://placehold.it/160x120.jpg" alt="Thumbnail 3" /></a> <br />
Caption 3
</p>
<p><a class="fancybox" data-fancybox-group="gallery" href="http://placehold.it/400x320.jpg" title="optional captions"><img src="http://placehold.it/160x120.jpg" alt="Thumbnail 4" /></a> <br />
Caption 4
</p>
<p><a class="fancybox" data-fancybox-group="gallery" href="http://placehold.it/400x320.jpg" title="optional captions"><img src="http://placehold.it/160x120" alt="Thumbnail 5" /></a> <br />
Caption 5
</p>
<!--end thumbs--></div>
<!--FancyBox function code-->
<script>
$(document).ready(function() {
$('.fancybox).fancybox();
</script>
</body>
</html>
Nancy O. -
Simple way to select and remove duplicate images.
As I work diligently to have Aperture manage all of my image files I have come top the realization that I have a number of duplicate image files scattered over a number of resources.
Is there a simple way to have Aperture identify the duplicates and more importantly to keep from importing duplicate images into the management library?
Thanks!I have not heard of an automated way to accomplish this. I beleive G has given you the standard method above. Aperture does not have a programed way to do this, and there is no way to prevent importing duplicates except by being careful not to do it in the first place.
However, if you know you imported some duplicates and know approximately when you did it, you could use a Smart Album to show you the images. Click on the blue Library icon and choose menu option File>New Smart>Album. In the Smart Album Smart Settings HUD, click on the checkbox that says, "Import Session is one or more of the following," then check on one or more of the import sessions listed. Be sure to also check the checkbox "Ignore stack groupings." Once you find the duplicate import, you can delete the images from your Aperture Library.
BTW, I use a referenced file system, so if I want to place images into an external folder that has already been imported into Aperture, I use Finder to apply a color label. The color label shows up in Aperture's import dialog and I can then select only the images with the color label applied. I then have to remember to remove the color label in Finder.
-Karen -
Won't display images - Its probably something simple!
Hey ,
Ive been trying for ages, looked throught the tutorials (i have even tried just using java pasted from the site for one of the simple programs) and looking through old forum questions but can't find out why my GUI wont display images. It compiles fine but then when i run the program ... no pics!
I suspect its something to do with the directory, i have tired:
- putting the images in the same directory as the java classes,
- putting in the entire image location paths (for this i get illegal characters error because it has '\' in the path but i get round this using '\\' ) but still no joy.
Like i said am just using the example programme from the site so i know its correct, Any ideas??
Thanx
LisaHere is a simple program to test:
JFrame frame = new JFrame();
JLabel label = new JLabel("image.jpg");
frame.getContenPane()..add( label );
frame.pack();
frame.setVisible(true);a) Place "image.jpg" is the same directory as the source and class files.
b) Don't use any package names for you class.
c) Compile using javac, not through and ide or anything.
d) Make sure your classpath includes ".", so it will search the current directory. -
Displaying image in the Title bar
hi ,
can any one help me to display image in the JFrame Title Bar Left Corner, Right Corner, orMiddle ..double post http://forum.java.sun.com/thread.jsp?forum=57&thread=554453
-
Is there a way to remove the menu bar from a secondary display while still using the very useful "Displays have separate spaces" mode?
The reason I ask is that most full-screen video playback in most applications, from iTunes to Flash/Silverlight plugins do not take up the full screen, instead leaving space for the menu bar (in the case of iTunes) or leaving the menu bar present on top of the video (for fullscreen Flash/Silverlight videos).
This is annoying for several reasons ranging from the obvious distraction factor to the fact that 1080p video is not played back at native resolution on a 1080p display.
If there is no way to disable this functionality while maintaining separate spaces, I would (humbly) suggest that a future update to Mavericks allow non-Lion-style* full-screen apps to take over the entire display.
*Lion-style full-screen apps are those that animate into a full-screen mode when the opposing-arrows full-screen button in the upper-right-hand corner of the window is pressed.No. Turning that off reverts to the old display setup. You have one desktop spanned across all displays. The menu bar appears on the primary display only.
-
Can anyone suggest me a simple way to add a background image to JFrame ?
I want to add a background image to JFrame in a simple way rather than overiding the paint method or paintComponent method. Just like adding an image to JButton or JLabel using two or three lines of code. Is it possible ? r there any methods for this purpose ? if so pls give the code.
JFrame as such does not provide an option to set a background image.
Extending JPanel, over-riding its paintComponent() and setting it as the contentPane of JFrame is one way of doing it. Though you have to do the overriding, it is not very complex though. -
What is the best way to display image ??
hi my questions is unusual, there are so many ways to display images.
I m developing image processing s/w can any one suggest me which would be the best way to display image on which i can perform image operations.
like in JPanel, icon, trhough paint() or anything else...
thank you..In advancehi man... i think so imaging is better with JAI(Java Advanced Imaging) .... is perfect for display in jcomponent like JPanel or JLabel, you have to replace the paintComponent().
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.geom.AffineTransform;
import javax.media.jai.PlanarImage;
import javax.swing.JComponent;
class ImagePanel extends JComponent {
protected PlanarImage image1;
protected AffineTransform atx= new AffineTransform();
protected int width, heigth;
public ImagePanel() {
public ImagePanel(PlanarImage i) {
image1= i;
width= i.getWidth();
heigth= i.getHeight();
public void paintComponent(Graphics gc) {
Graphics2D g= (Graphics2D)gc;
Rectangle rect= this.getBounds();
if ((width != rect.width) || (heigth != rect.height)) {
double magx= rect.width / (double)width;
double magy= rect.height / (double)heigth;
atx.setToScale(magx, magy);
if (image1 != null)
g.drawRenderedImage(image1, atx);
if you need more info, ask about JAI api and docs -
Is there a way to hide the task bar that always displays in Mac OS?
I'm referring to the area shown in the attached image.
The menu bar is needed to turn off the Mac and to access to all the tools of all apps, so it's necessary to keep it there. Also, it can only be hidden when you are running a full-screen app (near all apps on OS X Lion and Mountain Lion work in this mode)
-
Display image in Smart camera web interface
Hi!
I need some assistance with LV-RT.
What I have succeeded is to enalble the web server on NI 17XX camera and successfully displayed a VI with Image Display on it. I thikn I got the hang of it.
What I would like to know is there another way to display images on the camera web page. I really do not need the whole VI up there just an image and a string with serial number. One way I know would work is to write an image file to the system memory and then embed that image to the web page, but I am not sure that is the best solution as writing process takes time and it is not recommended to write too often to the program memory (am I right?).
So, is there some way to assign some object to say a memory bank and display it (without having to install the runtime maybe) on the page?
Thank you for your attention,
MartHey Mart,
Going back to your original question; are you looking to stream images to a web page from your smart camera or simple see what your camera is seeing when you go to a particular site? Take a look at the sample project below. It is sort of a work around, but it posts an image to a web service. Essentially it snaps an image, saves it, and then posts the saved image to a web service. You will have to change the file path for the image, then build and deploy the webservice from the project view. Also, it would be beneficial to take a look at the webservice build specifications. The webbing to view the snapped image from your local machine would then be viewable from your web browsers at the address : "http://localhost/Stream_Service/ShowImag"
Let us know if you have trouble getting this example working. Also, perhaps another visit to what your end goal is would be helpful. What was it that you had working?
Hope this helps
-Ben
Message Edited by BCho on 04-10-2009 02:27 PM
Hope this helps.
-Ben
WaterlooLabs
Attachments:
SnapWebService.zip 14 KB -
How to display image and data in module pool screen?
Hi,
I want to display image and relevant data besides the image in module pool screen, I am using docking container to display the image.
Actually I am able to display image or data any one but not both.
one more thing I want to display multiple images and their data.
Please suggest some one if you have any idea.
Regards,
Dileep.You can try below way, I have used in report.
DATA: gc_docking TYPE REF TO cl_gui_docking_container, "#EC NEEDED "Docking Container
gc_split TYPE REF TO cl_gui_easy_splitter_container, "#EC NEEDED "Splitter
gc_top_container TYPE REF TO cl_gui_container, "#EC NEEDED "Top Container
gc_bottom_container TYPE REF TO cl_gui_container, "#EC NEEDED "Bottom Container
gc_document TYPE REF TO cl_dd_document, "#EC NEEDED "Document
gc_events TYPE REF TO lcl_event_class, "#EC NEEDED " Local Event Class
gc_grid TYPE REF TO cl_gui_alv_grid, "#EC NEEDED " ALV Class
" Creating Docking
CREATE OBJECT gc_docking
EXPORTING
ratio = c_95.
IF sy-subrc EQ 0.
* Splitting the Docking container
CREATE OBJECT gc_split
EXPORTING
parent = gc_docking
sash_position = c_10 "Position of Splitter Bar (in Percent)
with_border = c_1. "With Border = 1 Without Border = 0
ENDIF.
* Placing the containers in the splitter
gc_top_container = gc_split->top_left_container .
gc_bottom_container = gc_split->bottom_right_container .
* Creating Grid
CREATE OBJECT gc_grid
EXPORTING
i_parent = gc_bottom_container.
ELSE.
* Background job handling
CREATE OBJECT gc_grid
EXPORTING
i_parent = gc_docking.
ENDIF.
* Creating the document
CREATE OBJECT gc_document
EXPORTING
style = 'ALV_GRID'.
Regards,
Sameer -
JDeveloper 11g Using jsp to display images
I am converting a 10.1.3.3 application to 11.1.1.3
It has 2 web modules. One is an ADF administrator module and the other is a public web that displays information including images stored as blobs.
This public module has a simple technology scope, only html, java, jsp and servlets. It is a hand me down from a few technologies ago and ran well on 10.1.3.3
To display images it uses a jsp acting as a servlet which is referenced inside other jsps. Since moving to 11g the images no longer display. If I use a java class servlet it works
however I have to use the full url, e.g. http://mydomain:myport/web/Sevlet?.... which means I have to update the details for each deployment.
I can use <h:graphicImage but this means I have to include JSF and use expression language to fill in the servlet parameters.
I don't know what has changed to cause it to fail. Weblogic?
The Libraries and Classpath include
JSP Runtime
Servlet Runtime
JSTL 1.2
The servlet jsp is as follows remembering it works in 10.1.3.3
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text/html;charset=windows-1252"%>
<%@ page import="javax.naming.Context" %>
<%@ page import="java.io.*" %>
<%@ page import="userinterface.util.ByteArray" %>
<%@ page import="userinterface.online.ImageUIHelper" %>
<%@ page import="userinterface.online.ImageUIHelperValue" %>
<%
String dataObjectId = "";
String regionId = "";
boolean getObjectImage=false;
boolean getRegionImage=false;
// determine which type of image to retrieve
if (request.getParameter("dataObjectId") != null)
dataObjectId = request.getParameter("dataObjectId").toString();
getObjectImage=true;
} else if (request.getParameter("regionId") != null)
regionId = request.getParameter("regionId").toString();
getRegionImage=true;
if (getObjectImage==true || getRegionImage == true)
try
ImageUIHelper imageHelper = new ImageUIHelper();
ImageUIHelperValue vo = null;
if (getObjectImage)
vo = imageHelper.doReadObjectImage(new Integer(dataObjectId));
} else if (getRegionImage)
vo = imageHelper.doReadRegionImage(new Integer(regionId));
if (vo != null && vo.getImage() != null)
// determine the mimetype
String mimeType="image/png";
if (vo.getFilename().toLowerCase().endsWith(".gif"))
mimeType = "image/gif";
else if (vo.getFilename().toLowerCase().endsWith(".jpg"))
mimeType = "image/jpg; charset=windows-1252";
else if (vo.getFilename().toLowerCase().endsWith(".png"))
mimeType = "image/png";
else if (vo.getFilename().toLowerCase().endsWith(".bmp"))
mimeType = "image/bmp";
response.setContentType(mimeType);
response.setHeader("pragma", "no-cache");
ServletOutputStream os = response.getOutputStream();
os.write(vo.getImage().getBytes());
os.flush();
os.close();
} catch (Exception ex)
A simple test harness follows. The actual pages substitute the java values using <%= uri %> as below
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text/html;charset=windows-1252"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%
String uri = "http://localhost:7101/publicweb/img/ImageServlet?imageType=dataObject&dataObjectId=822";
String uri2 = "ImageServlet.jsp?dataObjectId=822";
String uri3 = "ImageServlet.jsp?dataObjectId=694";
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/>
<title>testServlet</title>
</head>
<body>
<table cellspacing="2" cellpadding="3" border="1" width="100%">
<tr>
<td width="20%">Checking Servlet</td>
<td width="80%"><img src=<%= uri %>
id="imge"
width="400px" alt="Image" />
</td>
</tr>
</table>
</body>
</html>i responded to your duplicate message 4 days ago:
is it possible to insert and retrieve images from sql server using actionscript.
you'll need server-side script to query your database and you can use the flash urlloader class to call your script.
also is it possible to create a flash scrolling gallery based on images stored in a database and everytime an image is added it is displayed in the gallery.
load the data using the urlloader class and then load the images. periodically query the database for new images if there's no direct way for flash to know a new image was added. -
Hi.
I am using DWCS3 to insert the navigation bar into my
templates. Everything is woorking smoothly, except one little
problem.
My navigation bar contains rollever images are in different
colors (e.g., red, blue, green) Home | Contact | About Us.
When I clicked on About Us, I would like the rollerover
button stay pressed down (green), so I know that I am visiting the
page.
Does anyone know what I need to tweak to get it to work like
I mentioned above?
thanks.
SI am finding browsers like IE6 increasingly impossible to
work with, every error that dreamweaver seems to report for browser
compatability seems to be because of this. As far as I know there
is no simple way around this, I will be watching this thread to see
what others have to say though!
I have seen when looking at HTML some site's have a <IF
IE6> or something along them lines, can anyone shed anymore
light?
Thanks,
Dave -
Display text in navigation bar when user is logged in
Hi all,
I'm (still ) on Apex 4.2.6.
Currently, I have in my page templates, the following snippet:
<div class="logoBar">
<img src="#IMAGE_PREFIX#themes/theme_125/images/logo_.png" />
<h1><a href="#HOME_LINK#" id="uLogo">#LOGO#</a></h1>
<div class="userBlock">
<span>Username: &APP_USER.</span>
#NAVIGATION_BAR#
</div>
</div>
I have the requirement to display both the username (APP_USER) and the company the user works for (Application item AI_COMPANY), only when the user is logged in. When the user isn't logged in; instead of those items, I have to show a login link. Well, I know how to only show a link to the login page, when the user isn't authenticated, using the navigation bar. Currently, when a user isn't authenticated; the page shows: Username: nobody. That's because it is in my page template. How can I only show the username when the user is logged in? And show the company name only then?
My first thought was to add an item in the navigation bar. But those items shows up as links. Is there a way to add a navigation bar item, and let it display as text? Sure, I could write a dynamic action on page 0 to remove the link, but I'm searching for a nicer/better sollution.
I apreciate your help!Hi tomvdduin,
you can show company name which is already in your Application item(AI_COMPANY) by modifying the page template mentioned above.
<div class="logoBar">
<img src="#IMAGE_PREFIX#themes/theme_125/images/logo_.png" />
<h1><a href="#HOME_LINK#" id="uLogo">#LOGO#</a></h1>
<div class="userBlock">
<span>Username: &APP_USER.(&AI_COMPANY.)</span>
#NAVIGATION_BAR#
</div>
</div>
I have included company inside ( ), you can change how you want to show.
for example
<span>Username: &APP_USER.</span><span>Company: &APP_COMPANY.</span>
Hope this helps you,
Regards,
Jitendra
Maybe you are looking for
-
Not able to see the Surveys on Mobile Sevice
Hi, We are currently facing problem regarding display of survey on Mobile Client. When we use the following combination, surveys are displayed properly and the system allows to modify the Survey in Mobile Service and then upload the same to CRM Serve
-
I want to create a VHD of a disk that is on an old Windows 2000 system. Is there any software that does that? Thanks.
-
I recently bought a 2GB memory kit for a G4 15" 1.67GHz Aluminum Powerbook from Crucial. The kit came with two 1GB sticks of PC-5300 memory. My single 1GB stick of PC-4200 was working fine, but I just figured it would be fun to max out this old lapto
-
Multi value selection for characteristics under class type 200
Hello Experts, Please suggest I am trying to assign a class type 200 to the material master of a component say ABC. While selecting the values for chars under classification I need to select more than one value for a characteristics say XYZ(single va
-
Can I get direct access to scanlines or rectangles of pixels when creating a video filter?
Maybe I overlooked something, but all the examples in the AE 7 and AE CS3 SDKs that modify the video content, seem to do so through some per-pixel-callback function. For several applications I have in mind this would be rather slow. Can't I setup a f