Setting a button location?
How do I make a button at a specific location. No matter what I put in for the numbers in the setLocation method, the button always appears in the same place.
public class GameDisplay extends Applet implements MouseListener, ActionListener
GamePlay game;
public static Image[] images;
String [] fonts;
Button reset;
Font font;
int font_size;
public void init()
images = loadImages();
game = new GamePlay();
reset = new Button("Reset");
addMouseListener(this);
reset.addActionListener(this);
add(reset);
reset.setLocation(500,100);
font_size = 50;
font = new Font("Sanserif", Font.BOLD, font_size);
}
If you are using a layout manager, you don't call setBounds or setLocation on your components.
And why use the old AWT? Go for Swing.
Similar Messages
-
I wasn't able to use FaceTime or iMessages and found out it was because the "set auomatically" button was off under date & time in the settings area. Why does tha button turn off?
I wouldn't suggest going to get it yourself. You could find yourself in a situation you cannot get out of and could get hurt. Second, as stated before, it is more for misplaced or lost devices, not stolen devices. Many police agencies do not feel they have probable cause, just from your statement on a map location to justify attempts to recover the device. There have been many posts from others who have had devices stolen where the police will not confront someone based on that map location. I understand you are impacted by the theft, but this is what we have insurance for. To protect your content, from now on I suggest you put a passcode on the device. I hope you have changed all of the passwords for accounts you had on the device, since all of your content and data was accessible to the thief.
-
Help setting up Window.location.href to open a file, and 1 other issue
Hey there,
I am a student currently working on a school project where I must make a website. I am trying to set up: window.location.href="C:\Users\*PCNAME*\Desktop\*SITE*"; in that fashion to open up a local file on my HDD, so when I click a specific area, it opens that page from my local files. This setting works with opening web pages like "http://www.google.com" just fine, but when I attempt to instead open up a file location I am given an error.
Also, my other question is how to have more than 1: <script type="text/javascript"> function LinkTo(){, so that I can have 2 seperate buttons on my web page linking to 2 seperate sites.
Here is a link to the PasteBin with my code: http://pastebin.com/Eawy2hcL
Basically, I am wondering how to set up window.location.href to open up a page located in my files rather than from the internet like Google or Facebook; and, I am wondering how to have multiple LinkTo scripts set up so different buttons link to different pages and how to link those buttons to each script. I am new to Dreamweaver, so forgive me if anything is blindingly obvious!Okay, I'll try to explain better. Btw, thanks for the bottom part. Figured out I am not supposed to put the full location of the file, only the page (index.html), not C:\Users\*NAME*\etc...
Anyways, I am wanting multiple scripts.
Basically, I want the left cell to, when clicked, go to NewCars.html, and the right cell to link to UsedCars.html. It is a table that I have configured to be clicked anywhere in the cell rather than just having to click the words to go to a link. The code is:
<table width="100%" border="1">
<tr>
<td style="cursor:pointer;cursor:hand;" onClick="LinkTo()" width="50%" bgcolor="#C5B8B8"><h2 style="text-align: center">Shop New</h2></td>
<td style="cursor:pointer;cursor:hand;" onClick="LinkTo()" width="50%" bgcolor="#C5B8B8"><h2 style="text-align: center">Shop Used</h2></td>
</tr>=-
</table>
I have the LinkTo script set up, but I don't know how to add another LinkTo script that goes to a different page so that way the first LinkTo script for the"Shop New" cell takes you to the NewCars page, while the "Shop Used" cell takes you to the ShopUsed page. -
UWL - Change standard buttons location
Hello Experts,
Is it possible to copy/change the location of the UWL buttons?
I need to set the buttons below the table (see attached screenshot).
Regards,
OmriHi Prasad
In the past I have come across discussions scenarios that deal with moving the position of user decision buttons. I have outlined some SAP Help Threads below for your reference and review:
Button Move UWL
http://scn.sap.com/thread/1842225
UWL I-View Move Decision Buttons
http://scn.sap.com/thread/743301
A point to highlight here is be sure to perform a backup of the XML files. This will allow you to revert back changes if needed.
Kindly update me as per your findings.
Kind Regards
Troy -
Managing several components with the same set of button
Hi everybody,
I would like to have in my application a set of videos gathered in one row. Under the videos there are control buttons located. This part is quite simple.
I would also like the buttons to control the selected video. And this is where the problems begin. Initially, the buttons will manage the first video in a row. However, after selecting another video, the should manage the selected one. I have some dificculties with implementing a function that would override the CLICK attribute of the buttons after selecting a desired video. I am not sure if this is the best approach but don't have other ideas. What is a possible way to do it?
This is a part of the code:
<?xml version="1.0"?>
<!-- Simple example to demonstrate the ViewStack layout container. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
private function activateControls(event:MouseEvent):void
if (event.currentTarget.id == "video2")
play_button.click = "video2.play()"; // This does not work
]]>
</mx:Script>
<mx:Canvas width="629" height="236" id="panel_t">
<mx:VideoDisplay click="activateControls(event);" x="10" y="40" width="198" height="133" source="video/video.flv" id="video1"/>
<mx:VideoDisplay click="activateControls(event);" x="216" y="40" width="198" height="133" source="video/video.flv" id="video2"/>
<mx:VideoDisplay click="activateControls(event);" x="422" y="40" width="198" height="133" source="video/video.flv" id="video3"/>
</mx:Canvas>
<mx:Canvas width="629" height="40" id="panel_b">
<mx:Button label="PLAY" height="40" id="play_button" click="video1.play()"/>
<mx:Button label="PAUSE" height="40" id="pause_button" click="video1.pause()" x="65" y="0" />
<mx:Button label="STOP" height="40" id="stop_button" click="video1.stop()" x="138" y="0" />
</mx:Canvas>
</mx:Application>
Thanks,
flexynewbieYou're going about it the wrong way.
A button component doesn't have a "click" property, it dispatches a "click" event.
So what you need to do is assign an event handler to the button click event, just like you did for the VideoDisplay instances.
What you can do is store a reference to the selected VideoDisplay (which is why I mention in your previous thread you don't need the id at all) and use that when a button is clicked.
private var selectedVideo:VideoDisplay = video1;
private function activateControls(event:MouseEvent):void {
selectedVideo = event.currentTarget as VideoDisplay;
private function playClickHandler(event:MouseEvent):void {
selectedVideo.play();
private function pauseClickHandler(event:MouseEvent):void {
selectedVideo.pause();
etc..
<mx:Button id="play_button" height="40" label="PLAY" click="playClickHandler(event);>
<mx:Button id="pause_button" height="40" label="PAUSE" click="pauseClickHandler(event);" />
<mx:Button id="stop_button" height="40" label="STOP" click="stopClickHandler(event);" />
Alternativly, you could use the selectedVideo in mxml, but that's usually not a good idea.
<mx:Button id="play_button" height="40" label="PLAY" click="selectedVideo.play();>
For instance, in this case, you probably want to stop all other videos before playing the selected one, or some other stuff may need to be done. That can easily be done in the button click event handler.
As a sidenote, you should look into using a different container than Canvas, for easier auto-layout.
A VBox might be better suited for displaying the VideoDisplay instances. No need for all the x, y positioning. Same goes for the Buttons, use an HBox container there.
Control the gaps and padding with verticalGap, horizontalGap, paddingLeft, paddingRight, paddingTop, paddingBottom of the containers, all of which can be set through CSS. -
How to set default file location in Illustrator?
I'm using Creative Suite CS5 in Windows Pro 64, and would like to set a default location for files in Illustrator and Photoshop when I execute the File > Open or File > Save commands.
Yes, the program defaults to the location of the last file opened, but sometimes that file is gone, or I'm creating a new one from scratch, and the program looks for files in a distant place in my file structure.
** Is it possible to set a default file location for opening and saving in Illustrator CS5 (and in Photoshop CS5)?
Thanks.Not that I know of. It simply reverts to the global "My Documents"/ "Documents" folder as provided by your operating system. these can of course be changed using variables and editing the Windows Registry/ Group Policies, but that affects all programs...
Mylenium -
Setting a default location of the 'Save As' dialog box
I know this is an unusual question, but I do a lot of file-naming at work with Adobe Standard and it would help me if I could set a default location of the 'Save As' dialog box -- say, by dragging it to the corner of the screen so that the next time Adobe opens, the 'Save As' box will open in that location (rather than in the center by default).
By this, I don't mean setting a location for one session, which it does automatically, but rather setting an initial location for when Acrobat starts up.
Any help would be appreciated.
Regards,
ScottCool. BTW because you are recent switcher from the Windows world you may find these URL's useful.
Mac 101
Switch 101
Find Out How Video tutorials
List of Useful URLs for switchers -
Last week I set up a location based reminder in notifications to test it out. Worked great. However, I can't get rid of it. It does not show up on any of the pages, either reminders or completed. I can search and find it, shows it should be in reminders page, but it is not there for me to remove. Any ideas?
Sometimes a problem with Firefox may be a result of malware installed on your computer, that you may not be aware of.
You can try these free programs to scan for malware, which work with your existing antivirus software:
* [http://www.microsoft.com/security/scanner/default.aspx Microsoft Safety Scanner]
* [http://www.malwarebytes.org/products/malwarebytes_free/ MalwareBytes' Anti-Malware]
* [http://support.kaspersky.com/faq/?qid=208283363 TDSSKiller - AntiRootkit Utility]
* [http://www.surfright.nl/en/hitmanpro/ Hitman Pro]
* [http://www.eset.com/us/online-scanner/ ESET Online Scanner]
[http://windows.microsoft.com/MSE Microsoft Security Essentials] is a good permanent antivirus for Windows 7/Vista/XP if you don't already have one.
Further information can be found in the [[Troubleshoot Firefox issues caused by malware]] article.
Did this fix your problems? Please report back to us! -
Setting the graphic location to a local file (RESOLVED)
Hi,
I placed an image on my report and set the graphic location to an Excel file with a list of web addresses. The report successfully outputs the image from each of those web addresses.
I've tried putting a local file address in my Excel file (for example, "File: and it doesn't appear to work (Crystal outputs the default image instead). Does Crystal Reports not allow for this?
Thank you.Nevermind, got it to work. Just needed to format the file path a bit differently in Excel.
-
Setting a button to send an email in captivate 3
I set a button to send an email upon click at the end of my presentation. This is so if people have a question or comment they can send an email. I can get it to work but it also opens a blank internet page along with opening Outlook. All presentation users will use outlook so I would like get the link to open straight to email without also opening a blank page. Does anyone know how to fix this???
Yes, various ways. See: https://acrobatusers.com/tutorials/dynamically-setting-submit-e-mail-address
-
Hello,
I want to be able to open a file dialog, set the initial location to an ftp:// address, and allow the user to select individual files or a directory.
I can use the File Dialog express VI, and wire in a start path, but the problem is that the filepath constant does not allow you to input ftp://[IPAddress]. If you type it in it will automatically adjust the path to read . If you right click, and hit browse and go to an ftp site, the dialog will not let you select a file or folder. And no you cannot type the address into a string and then convert that to a path. If you do it will look just like the image above.
I can use .NET functions as seen below, but it is not trivial to allow the user to select files or a folder. The same is true if I write it in C++ (although I haven't tried this yet, just googled selecting files or folders in a file dialog).
EDIT: I just realized that with .NET if I select a single file, the FileName it returns points to a temporary internet folder on my computer for example: C:\Users\xxxxx\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.IE5\P01ODP0F\ni-rt[1].ini
The FileDIalog Express VI has these very options.
So what is the easiest way to have an initial ftp address path for a file dialog, and allow the user to select files or a folder?Have never had to do that before - that's a bit of a drag.
Some thoughts.
1) Can you map a drive to that FTP address and go from there?
2) You could try rolling your own dialog via FTP - that's something I've definitely done before!
In the following snippet, I start an FTP session on the NI FTP site, log in as anonymous, list the base directory files/folders and then close my session. I then unbundle the directory listings array and plug the name and item type into the item names of a multicolumn listbox.
CLD -
Cannot set Flash button properties from sprite behaviour
I'm puzzled...
I'd like to set Flash button properties from behaviors on the
sprite
itself (unselect all buttons with a sendAllSprites, for
example) but
only this sample script works :
on mouseEnter me
sprite(spriteNum).selected = true
end
those ones won't:
on mouseEnter me
me.selected = true
end
on mouseEnter me
selected = true
end
It must but obvious but I can't get it to work...
Thanks.
PJThe selected property is a property of the sprite. You need
to
reference the sprite specifically when you access it.
When you are using
me.selected=true
the 'me' is referring to the current instance of the
behaviour that is
running. It is not referring to the sprite itself. Therefore,
you need
to use
sprite(me.spriteNum).selected=true
so that you correctly reference the sprite.
You can use the syntax
me.property=true
only if the property in question is a property in that
*script*. -
How do you set a button to unselectable?
How do you set a button so it us unselectable?
... or even remove ot form the panel (less confusing for the client)
if(e.getSource()==button1){
// do things and
myPanel.remove(button1);
myPanel.add(newInterestingButton);
}OR: use a boolean
if(e.getSource()==button1){
if(allowUseButton1){
// do things and set the condition false
allowUseButton1 = false;
} // and tell them
if(!allowUseButton1){
myTextArea.setText("Please use the newInterestingButton"); -
Where can I download new sets of buttons?
I'm looking for a round button that would light up like the buttons of an elevator (I've got the sound effect ready) but I can't find a circle in the set of buttons that came with DVD SP 2 (it's either a cross, a rectangle, a triangle, etc... but not circle.)
Do you know any good website where I can download that kind of goodies?
Otherwise I guess I'll have to create my own with Photoshop.
Thanks.Thanks Chris.
I've read the section you mentioned in the manual, but it doesn't really walk you through the steps in creating a shape in Photoshop that would function as a button in DVD SP.
But I found this link: http://www.kenstone.net/fcphomepage/shapes_droptemplates.html which is not only VERY explanatory but also offers each layer to download. The designer used a rectangular in this case, but it's basically the same layers whatever shape you choose.
Hope this will be useful to other DVD SP debutants! -
HT5654 Where is the Help button located within Itunes on a windows computer?
Where is the Help button located within Itunes on a windows computer?
It's in the top right corner of the app, like where you would see it in other apps.
You should able able to find the info your looking for here too.
Maybe you are looking for
-
Organizing music with iTunes Problem
Hi, I had downtime today at work, and I decided to organize my iTunes library. However, some tracks are showing up on the same album, but not grouped together. I have selected every option possible in the Get Info menu. I have done all I can think of
-
Scanning for a newly plugged in MIDI device
Hi all, I'm currently using javax.sound.midi in my project and I have to implement a feature where the program detects if the user plugs in a new midi device during runtime. This is a bit of a problem as mentioned here: http://stackoverflow.com/quest
-
Received an exel document; how do I open it with Numbers format?
received an Excel document; how do I open it in Numbers format?
-
Plese help me ! can't open files with double clicking icons...
at the first, sorry about my English. (i'm japanese and english is my second language so..) anway.... i can't open the files on desk top by double click. if i go to Finder then i can open files... and some files i can open by double click. i download
-
Converting AAC to WAV Files in iTunes
I'm converting a bunch of files from AAC to WAV in iTunes. It's working fine, but the file sizes of the new files are HUGE (like 40MB per song huge). Any thoughts on what I'm doing wrong?? Thanks, Dan