Image Buttons Not Showing Up
Can someone help me out. My image buttons are not showing up until after I mouse over them. Any help or responses is appreciated.
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import java.util.Vector;
import java.lang.Math;
import javax.swing.*;
public class PokerApp extends JApplet
implements MouseListener, MouseMotionListener, ActionListener, ItemListener
// -------------- Global Variables ------------------------
int width, height;
int mx, my; // the mouse coordinates
Color bgc = Color.lightGray;
Color fgc = Color.black;
Checkbox players[] = new Checkbox[10];
CheckboxGroup cbg;
Image img;
public void init() {
width = getSize().width;
height = getSize().height;
setBackground(bgc);
setForeground(fgc);
String s1;
boolean sel;
JButton jb;
Container contentPane = getContentPane();
contentPane.setLayout(null);
ImageIcon iic[] = new ImageIcon[13];
cbg = new CheckboxGroup();
for (int i=0; i<9; ++i) {
s1 = Integer.toString(i+2);
sel = (i == 7);
players[i] = new Checkbox(s1, cbg, sel);
players.setBackground(bgc);
players[i].setForeground(fgc);
players[i].setName(s1);
// setBounds (x=hor, y=ver, wid, hgt)
players[i].setBounds(80 + i*30, 5, 30, 20);
contentPane.add(players[i]);
players[i].addItemListener(this);
for (int i=0; i<13; ++i) {
img = getImage(getDocumentBase(), "images/v" + (i+1) + ".jpg");
iic[i] = new ImageIcon(img);
jb = new JButton(iic[i]);
jb.addActionListener(this);
jb.setBounds(i*30, 30, 30, 30);
contentPane.add(jb);
img = getImage(getDocumentBase(), "images/v2.jpg");
ImageIcon tmp = new ImageIcon(img);
jb = new JButton(tmp);
jb.addActionListener(this);
jb.setBounds(200, 200, 30, 30);
jb.setVisible(true);
contentPane.add(jb);
jb.validate();
addMouseListener( this );
addMouseMotionListener( this );
public void start() {
// start or resume exectuion
public void stop() {
// suspends execution
public void destroy() {
// perform shutdown activites
public void paint( Graphics g) {
width = getSize().width;
height = getSize().height;
Font font1 = new Font("Ariel", Font.PLAIN, 11);
g.setFont(font1);
g.setColor( Color.red );
g.drawRect(0, 0, (width - 1), 30);
g.drawString( "Beginning", 5, 12);
g.drawString( "# of Players", 5, 24);
public void mouseEntered( MouseEvent me ) { }
public void mouseExited( MouseEvent me ) { }
public void mousePressed( MouseEvent me ) { }
public void mouseReleased( MouseEvent me ) { }
public void mouseClicked( MouseEvent me ) { }
public void mouseDragged( MouseEvent e ) { }
public void mouseMoved( MouseEvent e ) { }
public void actionPerformed (ActionEvent ae) { }
public void itemStateChanged(ItemEvent ie) { }
The part you are missing is a call to super.paint in your paint method
public void paint( Graphics g) {
super.paint(g);
...This tells the component (the JApplet) to do its default rendering before it does the custom rendering in the paint method. So the component will render your buttons before it does the rest of the paint code.
I also added an image loading method to your applet:
// <applet code="PA" width="400" height="400"></applet>
import java.awt.*;
import java.awt.event.*;
import java.net.*;
import java.util.Vector;
import java.lang.Math;
import javax.swing.*;
public class PA extends JApplet implements MouseListener, MouseMotionListener,
ActionListener, ItemListener
// -------------- Global Variables ------------------------
int width, height;
int mx, my; // the mouse coordinates
Color bgc = Color.lightGray;
Color fgc = Color.black;
Checkbox players[] = new Checkbox[10];
CheckboxGroup cbg;
// Image img;
Font font1;
public void init() {
// only need to create a font one time, not with every paint call
font1 = new Font("Ariel", Font.PLAIN, 11);
width = getSize().width;
height = getSize().height;
setBackground(bgc);
setForeground(fgc);
String s1;
boolean sel;
JButton jb;
Container contentPane = getContentPane();
contentPane.setLayout(null);
// ImageIcon iic[] = new ImageIcon[13];
cbg = new CheckboxGroup();
for (int i=0; i<9; ++i) {
s1 = Integer.toString(i+2);
sel = (i == 7);
players[i] = new Checkbox(s1, cbg, sel);
players.setBackground(bgc);
players[i].setForeground(fgc);
players[i].setName(s1);
// setBounds (x=hor, y=ver, wid, hgt)
players[i].setBounds(80 + i*30, 5, 30, 20);
contentPane.add(players[i]);
players[i].addItemListener(this);
Image[] images = loadImages();
for(int j = 0; j < images.length; j++)
ImageIcon icon = new ImageIcon(images[j]);
JButton b = new JButton(icon);
b.addActionListener(this);
b.setBounds(j*30, 30, 30, 30);
contentPane.add(b);
Image image = getImage(getDocumentBase(), "images/v2.jpg");
ImageIcon tmp = new ImageIcon(image);
jb = new JButton(tmp);
jb.addActionListener(this);
jb.setBounds(200, 200, 30, 30);
jb.setVisible(true);
contentPane.add(jb);
// jb.validate();
addMouseListener( this );
addMouseMotionListener( this );
private Image[] loadImages()
MediaTracker tracker = new MediaTracker(this);
Image[] images = new Image[13];
for (int j = 0; j < images.length; j++) {
images[j] = getImage(getDocumentBase(), "images/v" + (j + 1) + ".jpg");
tracker.addImage(images[j], 0);
try
tracker.waitForAll();
catch(InterruptedException ie)
System.err.println("tracker interrupt: " + ie.getMessage());
return images;
public void start() {
// start or resume exectuion
public void stop() {
// suspends execution
public void destroy() {
// perform shutdown activites
public void paint( Graphics g) {
super.paint(g);
width = getSize().width;
height = getSize().height;
g.setFont(font1);
g.setColor( Color.red );
g.drawRect(0, 0, (width - 1), 30);
g.drawString( "Beginning", 5, 12);
g.drawString( "# of Players", 5, 24);
public void mouseEntered( MouseEvent me ) { }
public void mouseExited( MouseEvent me ) { }
public void mousePressed( MouseEvent me ) { }
public void mouseReleased( MouseEvent me ) { }
public void mouseClicked( MouseEvent me ) { }
public void mouseDragged( MouseEvent e ) { }
public void mouseMoved( MouseEvent e ) { }
public void actionPerformed (ActionEvent ae) { }
public void itemStateChanged(ItemEvent ie) { }
Similar Messages
-
How do I get a "transfer images" button to show up in the solution center?
How do I get a "transfer images" button to show up in the solution center for my officejet 6500 709a on XP?
Scan buttons are displayed and work, as does print.What installing the twain plug-in, you mean? Go to your applications folder. Find the Adobe Photoshop Elements 11 folder. Look in there for a folder called support files, then for a folder called optional plugins. In the Optional Plugins folder, there should be a folder called ImportModules. Just drag that from the Optional Plugins folder to the regular Plugins folder.
This will be infinitely easier to do if you put your applications folder window into list view, not the default icon view. To do that, click this button at the top of the window: -
Images do not show; help not successful
Images do not load and the Help! suggestions do not solve the problem. I access the Netflix.com website and its .jpg images do not show. Right clicking on image location and selecting "Page Info" reveals that site is allowed to show image and "Media" button actually SHOWS the image in the preview section!
Did you check if any of the images have a check-mark in the box to block images in Tools > Page Info > Media?
Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Appearance/Themes).
* Don't make any changes on the Safe mode start window.
* https://support.mozilla.com/kb/Safe+Mode
* [[Troubleshooting extensions and themes]] -
Revision: 13455
Revision: 13455
Author: [email protected]
Date: 2010-01-12 10:59:01 -0800 (Tue, 12 Jan 2010)
Log Message:
WebPlayer: Fixing full screen button not showing.
Modified Paths:
osmf/trunk/libs/ChromeLibrary/src/org/osmf/chrome/controlbar/widgets/FullScreenEnterButto n.as
osmf/trunk/libs/ChromeLibrary/src/org/osmf/chrome/controlbar/widgets/FullScreenLeaveButto n.asI am not sure what's happening with IE9 (no live site) but I had real problems viewing your code in Live View - until I removed the HTML comment marked below. Basically your site was viewable in Design View but as soon a I hit Live view, it disappeared - much like IE9. See if removing the comment solves your issue.
<style type="text/css">
<!-- /*Remove this */
body {
margin: 0;
padding: 0;
color: #000;
background:url(Images/websitebackgroundhomee.jpg) repeat scroll 0 0;
font-family: David;
font-size: 15px;
height:100%; -
Image is not showing up on Dialog.
Hi Guys
I am getting problem with Dialog. In my Dialog I have created the image field which accepts image from dam by Drag and drop. Whil Iam dropping the image it is showing up inside the Dialog properly and is showing up on the screen also But when I try to edit the image the current image got vanished inside the dialog. I don't understand why it is happening?
while uploading
The above image is not showing up while editing. Could you please help me where I am doing wrong?
here is my dialog.xml
<normalmode
jcr:primaryType="cq:Widget"
collapsed="{Boolean}false"
collapsible="{Boolean}false"
hidden="{Boolean}false"
title="Picture Properties"
xtype="dialogfieldset">
<items jcr:primaryType="cq:WidgetCollection">
<pictureurl
jcr:primaryType="cq:Widget"
allowUpload="{Boolean}true"
autoUploadDelay="1"
ddGroups="[media]"
fieldLabel="Picture Link"
fileNameParameter="./fileName"
fileReferenceParameter="./fileReference"
height="{Long}200"
name="./file"
requestSuffix="/image.img.png"
rootpath="/etc/designs/aib/business/images"
sizeLimit="100"
uploadUrl="/tmp/upload_test/*"
xtype="html5smartimage"/>
<picturealttext
jcr:primaryType="cq:Widget"
fieldLabel="Picture Alt Text"
name="./picturealttext"
xtype="textfield"/>
<picturetitletext
jcr:primaryType="cq:Widget"
fieldLabel="Picture Title Text"
name="./picturetitletext"
xtype="textfield"/>
</items>
</normalmode>
Cheers
KirthiHi Jitendra,
It worked.Perfect. Thank you very much. I want to implement the same in my Custom widget which contains smartimage. But it is not showing up. Here is my Custom widget code for the smartfile but iam not getting Drag and drop jus it is showing up blank. Any idea how can I incorporate the smartfile in my Custom widget.
// Picture URL
this.add(new CQ.Ext.form.Label( {
cls : "customwidget-label",
text : ""
this.bannerImageURL = new CQ.form.SmartFile( {
cls : "customwidget-1",
fieldLabel : "Picture Link: ",
editable:false,
allowBlank : false,
anchor: '75%',
maxLength : 100,
cropParameter :"./image/imageCrop",
ddGroups : "media",
fileNameParameter : "./image/fileName",
fileReferenceParameter : "./image/fileReference",
mapParameter :"./image/imageMap",
rotateParameter : "./image/imageRotate",
name : "./image/file",
requestSuffix : "/image.img.png",
sizeLimit : "100",
autoUploadDelay : "1",
listeners : {
change : {
scope : this,
fn : this.updateHidden
dialogclose : {
scope : this,
fn : this.updateHidden
this.add(this.bannerImageURL);
Once again thanks for helping me to resolve the issue. The above is another requirement. Any ideas?
Cheers
Kirthi -
Image is not showed in Apps Output
Hi,
In Apps output image is not showed, but in report builder output images are showed.
I imported image from my local system. Is there any path in Apps server to keep images?
Thanks in advance.
Regards,
KalyanHi,
Are you working ona Report?. If so please check the concurrent program definition, it should be PDF or Postscript.
Thanks,
Robert -
I can get some .gif images to show up in my Dreamweaver HTML
page and can see them when I upload the document.
Other images are not showing up.
The images that show up and do not show up are in the same
"images" folder. All of them have been uploaded.
The images that show up were created by a software program
that made them be .gif images.
The images that do not show up were made in Adobe
Illustrator. I then imported them into Adobe Photoshop and saved
them as .gif, .jpg. png. and even used the "save for web" feature.
I also imported the image into Fireworks and saved it as .gif and
.jpg.
None of the copies of the image that I created are showing up
in a webpage.
I have used the image icon to place the image. I also went to
Insert | Image and put the image in that way. Plus I tried the drag
and drop method to get the image onto the page. In many cases I can
see the image on the page in Dreamweaver, but not when I upload the
page. Not even the alt tags with the red X show up online. Each
image does have an alt tag.
I have no clue what to do because other .jpg and .gif files
are showing up as images. Oh, and when I used a .gif version as the
background, it worked as a background.
If you know why an image I made will not appear after being
linked to a webpage and uploaded, please tell what you know. I am
stumped on this one.
Thank you for any assistance you can give me.
Baffled,
Ntropiquote:
Originally posted by:
bregent
Always include a url when you have questions about your web
pages.
Sorry, newbie to these forums here.
here's a link to one of them:
http://www.onlineschoolsurveys.com/banner_trial_2.html
With this page I tried using a table and put the images in
spots in the table. The empty spots are where there should be
images. The two images that are there were made by other people.
This link is actually quite obnoxious.
http://www.onlineschoolsurveys.com/oss_banner.html.
With this one, again the only image that shows up is one that I
made originally as a bmp export out of Snap Surveys, turned into a
gif in Photoshop (I think). In the table toward the bottom with the
pink squares there should actually be two pink squares, one should
have an image in it. Being a practice page that I did not expect
others to look at I left the obnoxious background. If this is too
annoying, I can remove the background and repost.
Did you define a site in the site manager?
I'm sorry but I do not know what this means. I regularly have
a site at www.onlineschoolsurveys.com. The first link goes to a
page that is actually a part of the website- I tried using a
template I know works thinking that maybe the non-templated page
was flawed. So if you are asking if these were loaded to an active
website: yes, I regularly have pages at that website, but no, these
pages are not intended to be a part of my regular website. I was
just using that space to practice.
Do the linked images exist within the defined site?
Yes, the images were uploaded. They should exist in an image
folder. Although it may be really stupid for me to make a link to
an unprotected list of files, here is the list of images in my
images folder:
http://www.onlineschoolsurveys.com/images/
Since I am new to using a message board for help, please advise me
if I should not post such directories in the future.
Thanks for your quick response.
Mel -
Both Photoshop and Bridge open as usual. But when I open an image, the image does not show in the image area. The image filename does show in a tab and the layers show in the layer panel. What is going on and how do I fix this.
I resolved the problem. It was somehow related to my using Microsoft
theme pictures. I set Windows to use the basic theme and the problem
went away. Thank you for the suggestions.
Jac -
Some email images do not show while using the icloud web app. I can see the images on my IOS devices and in gmail but I only see a small gray box in the icloud web mail app. Load HTML images is checked in preferences. Is there a solution to this issue?
I've seen the opposite issue. My wife recieved an email with jpg attachments. She couldn't see or print them on her iPhone 4S but they showed up fine in iCloud or in the mail app. I had her forward the email to herself and then they showed up. I assume there is an issue with how Apple is processing the attachments and resending causes them to get reformatted in a way that makes them easier to handle.
So yeah. Seems like some bugs. Hope Apple fixes them soon. -
Photo/Edit-In CS6. psd image does not show in LR after save/close.
Whenever I edit (a copy) of an image in Photoshop CS6 from Lightroom 4.3 (Photo/Edit-In), after I save and close the image in CS6 the new psd image does not show in Lightroom. In order to see the image in Lightroom, I need to close Lightroom and then reopen Lightroom. It is almost like Lightroom needs to "refresh". Does anyone have a solution that does not require me to close Lightroom? I have tried to use View/Sort by extension, filename, edit time, etc. with no effect.
This should not be so. I'm assuming that you do a <save> in CS6 - as opposed to <save as>. Only with <save> the image file will automatically be imported in Lr while <save as> creates a new file that Lr "knows" nothing about until you import it (for instance via "Synchronize folder").
If the behavior you describe follows a <save> in CS6 it is not normal.
This could be due to a corrupt Preference File. This file can go "funny" and is then responsible for all kinds of strange behavior of Lr. The remedy is replacing the Preference File.
BTW: Re-installing Lr does not replace the Pref. File since it is designed to "survive" upgrades.
See here for where to find the Preference file for your OS: http://helpx.adobe.com/lightroom/kb/preference-file-locations-lightroo m-4.html
See here for how to go about Replacing the Preference File: http://lightroomers.com/replacing-the-lightroom-preference-file/745/ -
"record enable" buttons not showing up in Garage Band 10.0.3 (I have selected "show record enable"- a space in the track header opens up, but the button is not present. Same with "input monitor".
Look at all the posts in the forum from users with similar problems, it happened with the last Logic update.
-
Why aren't my FW (PNG) image are not showing up
Hey guys.
This is really bugging the hell out of me. I feel like I
can't move on until i can figure out why my PNG images are not
showing up in preview (F12). They did yesterday before I deleted
some pages and renamed old pages I no longer needed.
All my images that was done in FW are in my root folder in
the file panel. i didn't move any of those. When I double click on
the image to bring up the "select image source" in the URL it
starts off with two periods then a slash and then the name of where
it's located as well as the name of the image. The "relative to":
is site root. i didn't change any of these setting before I deleted
and renamed pages in my file panel.
Oh, and my Ap Divs show up in light gray boxes.
Please help!
CS3 MacI'm confused by the subject line! Is this like 'all of your
base are belong
to us?' 8)
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"Dooza" <[email protected]> wrote in message
news:gki5he$3pu$[email protected]..
> Why_ATL wrote:
>> Hey Alan
>> is the filename exactly what it should be? YES
>> Are these .png files for web use, or are they PNG
fireworks original
>> files
>> which are very large in file size because they
contain all the info on
>> layers and such? They are .png files for the web. I
can't figure out why
>> my Div is showing up in preview instead of my images
There just Div's
>> with the little blue question mark.
>>
>> This is getting harder and harder. I'm trying to
laugh so i don't get a
>> head ache over this. This is weird.
>
> Without a link we can only make wild stabs in the dark.
>
> Dooza -
I am trying to create an responsive HTML5 output, but images are not showing up.
When I preview my output, the images are note showing up. It is simply the blank outline of the image with the little image icon in the top left corner.
As it is compiling I see the message "Warning: Image maps are not converted to relative size". Is there something in the setting that I need to change, or is that even the problem?Can you check your output folder: are the images copied to your output? If they are missing, are the images listed in the Project Manager pod in RoboHelp?
The warning is unrelated. Since image maps work with pixel coordinates, you can't simply make them responsive. You are probably using an image map in your project. This is causing the warning. It is not a problem since the image map will still work. But if the image map is very large, it may give a bad experience on smaller screens. You may have to decide whether to change or remove the image map if you want to support mobile. -
Why isn't the edit button not showing in my ESX24 sampler?
why isn't the edit button not showing in my ESX24 sampler?
Is that during installation when you see the two icons.. the one on the left looking like a Garageband guitar icon, the one on the right like the Logic Pro platimum record icon?
Yes.. that one.. with the choice to click on which option you want/are coming from...
p.s. I'll probably aquire a Mac Mini this fall then upgrade.... I mean repurchase!
I think I managed to grab one of the last of the 2011 refurb'ed MMS's.... at that super low price Apple were selling them for... before they bumped it up and now, they seem to have none left at all at any price
However, just in case, I have found this site really useful at keeping track of Apple's refurb stock... and pricing
http://www.refurb.me/us/ -
TS2972 why is the import button not showing at the button right hand corner of iTunes?
why is the import button not showing at the bottom right hand corner of my ITunes page. I am trying to transfer files from my home share library onto a new computers library.
See if it isn't hidden under the View menu. iTunes- Turning on iTunes menus in Windows 8 and 7.
Maybe you are looking for
-
Error while running a report in OBIEE answers
Hi, I imported the ASO cube Account hierarchy is in the physical layer but not in BMM. So I change the dimension type to "other" from "measure dimension", the account dimension showed in the logical layer. But when I tried to run the reprot with one
-
Hi, Here we are using XI 3.0 Service pack:09 Release:30_VAL_REL When i tried to do Integration builder configuration some fields hae been missing For Eg : In the Businees Service- communication channel- i am not able to see the fields of Run Operatin
-
Down payment processed by F110 is blocked
We would like to make a down payment on a purchase order. I entered the payment request with transaction F-47 and the special G/L sign. Then i run the automatic payment program F110 and the item gets paid. The payment program generates a posting with
-
How to display the report output from a customized Oracle Form button
Hi Gurus I developed a customized oracle form and one customized report. I want to run report from oracle customized form, for this i use one button to submit concurrent request for request. its successfully submitted and i can view output by using V
-
Interfacing PLC siemens S7_300 and LabVIEW DSC using siemens OPC server
Does anyone already interface Siemens PLC S7_315-2-DP with LabVIEW DSC using Siemens OPC server? Is that a good solution? Are there any hidden problems?