Simple question with a button action
Im having some slight problems setting up my script so that when you click on the button a method is performed called encrypt().
I have...
public class Easy_Encrypt {
public static void main(String[] args) {
..Class stuff
JButton convert = new JButton("convert text");
encrypt() { ..stuff inside }
How do I make it so when you press convert it does the function encrypt() Ive searched through java's documentaries but every script does'nt work.....
try this:
convert.addActoinListener(new
ActionListener()
public void actionPerformed(ActionEvent event)
encrypt()
Similar Messages
-
....Need to brush up my tablet design in DPS (did it a few years back), can anyone recommend on the Adobe site tutorials that I can download, with artworks /buttons / actions and put it together?
See this forum post here from Bob. Best place to learn DPS is on Adobe TV http://tv.adobe.com/product/digital-publishing-suite/
If you are specifically looking to learn how to create interactive overlays, go here http://helpx.adobe.com/digital-publishing-suite/help/overview-interactive-overlays.html Watch the videos on "Folio Overlays panel, Part I & Part II" -
Need Help with Advanced Button Actions
I am a brand new Captivate 5 user and I have created a image button that I want to have a double action. When the user clicks on the image button, I want it to SHOW a new button AND SHOW another image. I used the Advanced Actions but it does not work when I preview project. Help!
Hello and welcome to the forum,
Did you assign the advanced action to the image button as Success action? And the new button + the image have to be on the same slide, but with the status Invisible. You can not show hidden objects that are sitting on another slide then the slide with the advanced action.
If you want to have more information about advanced actions, I do blog a lot about them. Here is the link to my blog:
http://lilybiri.posterous.com
Lilybiri -
Simple question around text box action listeners....
Hi, I'm hoping there is a simple solution to this question.
What I have is a text box, by default it will be empty. what I'm looking for is Some kind of action listener to be kicked off when ever a user writes in the textbox......
here is a little bit of code i'd "like" to do....
textBoxBean.addPropertyChangeListener(new PropertyChangeListener() {
public void propertyChanged(PropertyChangeEvent event)
if (businessTypeBean.getText() != null){
// do somthing
else{
// do something else
}); The only problem is the the silly thing never gets called.....
a silly question but, unfortunatly all this is change a tooltip and enable disable a button based on weather or not there is something in the textbox....... Sigh......
Any ideas would be great.
Cheers,But you do waste your time with the above.......... With the hope that you will actually learn how to ask a meaningfull question the next time.
You still have people totally confused about what you are asking. Some people think you have an AWT based question. Others think its a Swing related question.
Your question is about an ActionListener, but you code shows a PropertyChangeListener. It seems like you are asking about a Swing component, but there is a Swing forum for Swing related questions.
We are not mind readers. Ask a well thought out question and you will generally get a well though out response. -
Help Please! Timeline Question with Invisible Buttons
I am new to FLASH and have created a rotating banner for our website with 5 roatating images with 5 invisble buttons linking to 5 landing pages. And it works the first loop through. However when it gets to action 5 for my last image, that link continues for all the buttons is subsequent loops. What do I need to add to my code to get the actions to loop like the timeline is looping?
Code used for the links. This is the link that continues after the first run of the banner:
var url5:URLRequest = new URLRequest("http://www.facebook.com/MoDOT.KansasCity");, onStageClick5);
stage.addEventListener(MouseEvent.CLICK
function onStageClick5(event:MouseEvent):void
navigateToURL(url5,"_blank");i can't tell what's causing your problem but that code doesn't look right. use:
var url5:URLRequest = new URLRequest("http://www.facebook.com/MoDOT.KansasCity");
stage.addEventListener(MouseEvent.CLICK
function onStageClick5(event:MouseEvent):void
navigateToURL(url5,"_blank"); -
Start a simple slideshow with a button
Hi together,
I work with CS6 and create a slideshow with 8 pictures. Above a button, now I will touch the button to start the slideshow. Now it doesn`t function. I see only one slide to the next slide by touch the button. By taking the automatically version, the slideshow starts everytime by opening the document. I don`t understand. It is so simple, and I see not my mistake.
Best Regards
BorisA button can go to a specific state or to the next or previous state, but it cannot play the slideshow. One workaround is to set the slideshow to Tap to Play/Pause and add a dummy button image in the first state. Tapping the button is really just tapping the slideshow.
-
Hi guys. I am trying to build my first website and I
follow the instructions of a videotutorial of flash 8. But in the
second step (Making it work the buttons) when I had tried to add
action to my selected button, appear a message like this....Cannot
add actions to this selection (translated from spanish) Why?...Is a
conflict between versions 8 and CS3? Please help to fix and learn
Know How?I'm a newbie to Flash, and I ran into this same issue with
not being able to add actionscript to a button in 3.0. So I clicked
Settings and changed the version to 2.0 in order to do it, and it
worked fine. My only concern is - if you create a file in v3.0,
then switch it to v2.0 midstream, will this cause any issues later
with the file? Have you run into this? Thanks much! -
Simple Question (Probably) About Buttons
I am delving into Web programming for the first time. I am
used to event driven programming. How and where do I code for a
button's OnClick event? I want the button to perform an action
OTHER THAN simply a submit.
Just to keep my example simple, let's say I want to open up a
small window which says "Thank You" once the button was clicked.
Where do I put this code.
Thanks in advance for helping a really discouraged and
frustrated newby.You cannot add such things to Flash objects. That
functionality would have
to be implemented in the object's Actionscript.
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com
- Template Triage!
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
==================
"MrJCG1" <[email protected]> wrote in
message
news:ek752i$f5i$[email protected]..
> Thanks. I don't know why I never thought of functions. I
was trying to
> attach
> several lines of code to the onClick event and it wasn't
working. But...
>
> If I create a function called test, what is the correct
syntax to call it?
> Here's what I have. Is this correct???
>
> <object
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
> codebase="
http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#ve
> rsion=5,0,0,0" name="btnAddToCart" width="105"
height="33"
> id="btnAddToCart"
> onclick="Test()">
>
> -
hi,
I am new to swing. I hava a basic question.
Is it possible to give a ToolTipText to a JLabel .
i have given l1.setToolTipText where l1 is the lable name and added to the frame f 1. f1.add(l1).
But i am getting an error.
Can anyone help me?
Thanks in advancehi dek,
thanks for the quick reply..
i have made Label l83 = new Label("CAME Tools");
l83.setBounds(880, 630, 150, 20);
f1.add(l83);
l83.setToolTipText("press button for calculation");
and error i got is
Z:\JCREATOR LE\MYPROJECTS\MAINWINDOW\MainWindow.java:365: cannot resolve symbol
symbol : method setToolTipText (java.lang.String)
location: class java.awt.Label
l83.setToolTipText("To calculate Measured Software process you have to select Metrics covered by CAME Tool(Select YES from CAME Tools Choice)");
^
1 error -
Best way to send a jtextfield with a button action
i have searched the internet and forums and cannot find this answer... does anyone have a best way to send the data in a jtextfield when a button is clicked? thank you.
Window.java
public class Window extends JFrame
public Window()
JPanel panel = new JPanel(new FlowLayout());
JLabel hostLabel = new JLabel("hostname or IP address: ");
JTextField hostname = new JTextField(20);
JButton checkButton = new JButton("Check");
checkButton.addActionListener(new CheckEvent());
panel.add(hostLabel);
panel.add(hostname);
panel.add(checkButton);
}CheckEvent.java
public class CheckEvent extends AbstractAction
public CheckEvent()
super();
@Override
public void actionPerformed(ActionEvent event)
System.out.println(event);
boolean serverReachable = false;
try
InetAddress server = InetAddress.getByName(hostname);
System.out.println("\t\tName: " + server.getHostName());
System.out.println("\t\tAddr: " + server.getHostAddress());
System.out.println("\t\tReach: " + server.isReachable(300));
serverReachable = server.isReachable(30);
catch (UnknownHostException e)
System.err.println("Unable to lookup" + hostname);
catch (IOException e)
System.err.println("Unable to reach "+ hostname);
return serverReachable;
}My problem lies in the hostname jtextfield that i want to send the string to the CheckEvent.java.
Thank you. -
Im a couple days new in java, Ive been searching for an answer for hours and havent found a solution.
This is the mistake it shows (when trying to use any element of the array):
array required, but java.util.ArrayList <java.lang.String> found
The array is:
public static ArrayList<String> numList = new ArrayList<String>();
Im filling it this way: (so that it contains each word of a file in separate)
BufferedReader br = new BufferedReader(new FileReader("Archivo.txt"));
try
while(true)
String aLine = br.readLine();
if(aLine == null) throw new EOFException("Le?do todo el archivo.");
if(!aLine.equals(""))
StringTokenizer st = new StringTokenizer(aLine);
while(st.hasMoreTokens())
numList.add(st.nextToken());
}catch(EOFException e)
The problem comes when I try to use the elements of the array (in specific when trying to convert each element of the array to int, so that i can do math operations with them).
for example:
for (a=0; w>a; a++)
int x = Integer.parseInt(numList[a])
Can anyone help me with this? (where is the mistake and how to convert from string array elements to int)
Thank you // Muchas GraciasThe trouble is that you're confusing ArrayLists with arrays. They're not the same thing.
Currently you're making an ArrayList. If you want an array of String, do this:
String[] myArray = new String[50];
int i = 0;
while(st.hasMoreTokens()) {
myArray[i] = st.nextToken();
i++;
}Or perhaps better yet:
String[] numListArray = numList.toArray(new String[0]);But you really don't need an array for what you're doing. Use an Iterator.
Iterator<String> strings = numList.iterator();
while(strings.hasNext()) {
int x = Integer.parseInt(strings.next());
}You get the idea. Read the Collections tutorial about iterators. Read the language spec about arrays. Also look at the java.util.Arrays class. -
Noobie simple question with || operator
while(!keyb.nextLine().equalsIgnoreCase("y" || "n"))
keyb is my Scanner variable -- i know its kinda stupid but it's late and I feel dumb atm
its not letting me put the || "n" part in...maybe something is wrong with the syntax?
Edited by: sheky on Sep 12, 2008 6:31 PMThis line of code has two basic concept errors.
The || operator, is applied to booleans
logicalValue || logicalValue"y" and "n" are Strings not booleans and the || operation is not allowed.
The second error is that, the result of a || operation is a boolean and the equalsIgnoreCase method expect a Object as parameter, to call its toString() method and compare it to the associated String.
What you probably want is:
String answer;
do {
answer = keyb.nextLine();
} while( ! (answer.equalsIgnoreCase("y") || answare.equalsIgnoreCase("n") ); -
Simple question with deleting from computer
I imported a couple of my cds to itunes in order to move them to my ipod, but now that they are there I do not want them on my computer eating my memory. Can I delete the songs from my computer without deleting them from my ipod?
Thank youIf you want to delete songs from iTunes and keep them on the iPod you need to change the update option of your iPod to "manually manage music and videos". Your iPod will not sync with iTunes in this mode so it can have different content, you can get details here:
Managing content manually on iPod
iPod 101: Fill 'er Up
One major word of caution. If you delete songs or videos from your computer and have no back up other than the iPod you will risk losing them permanently if your iPod fails or you find you have to restore it to solve a problem. You should consider investing in an additional internal or external hard drive to store/back up your music. Alternatively at the very least back up anything you can't replace such as iTunes downloads to CD or DVD: How to back up your media in iTunes -
A fairly simple question with a quick answer :)
Hi there,
So i have just purchased a mac pro to edit on.
I currently run Final Cut Studio on a macbook pro. I purchased final cut studio in Feb 06.
I need to uninstall FCS from my macbook pro. What's the easiest way to do this?
However, the main question...
Can i then install all of the same version of Final Cut Studio using the installation discs i used to install it on my MBP on my new Mac Pro. (Bare in mind i will uninstall FCS on my macbook pro)
Also, if if this is possible - Can i upgrade to Final Cut Studio 2 on the new Mac Pro once the previous version of FCS is installed?
Many thanks,
Jamie McIt is possible.
Make sure you don't happen to have the lappy hooked up to the network at the time you install on the Pro.
Also -- there was something I thought that changed in the EULA that said you could "could" have it on a desktop AND a laptop... but don't quote me. If it isn't in the EULA then you can't have it on both...
But yes... you can install on the desktop for sure and then take it off the lappy.
Good luck,
CaptM -
Just a simple question with restoring.
Alright, so I am about to sell my iPod Touch, and I just finished restoring, I didn't set it up at all, so that the customer who purchases it can follow through with the "Hello" screen and set up everything themselves... But since I want to leave it in this state, I can't really figure this out myself without setting it up. So, when the new person goes through the setup screen, it won't somehow keep the old Apple ID or iCloud accounts to select right? Before I restored it, I logged out of my Apple ID and iCloud, turned off iMessage, and FaceTime, just in case. So, I am pretty sure the accounts won't be there, right? I just need some verification although I am pretty much sure it should be 100% clean of my old content.
Hi
If you have logged out and restored from scratch everything accounts wise should have been wiped along with the rest of the content. I recently sold my iphone 4 and thought the same thing after restoring but the new buyer set it up next to me and i never saw any of my account info come back up!
Hope this helps
Maybe you are looking for
-
How can I delete a music file directly from iPhone? Or not possible?
Can I delete a music file directly from iPhone?
-
Hyper-V. Resource aggregation. Resource pool.
Hello, everyone, I have a question to Technet community. Hopefully, someone will be able to help. We're in the process of building a new Hyper-V environment, and the interesting question has arisen once again. Is there any way to compartmentalize all
-
Hi, I customized FM-CO integration. But when I run Periodic reposting I have in ONE item in FM document two equal value in both budgets -Commitment budget and Payable budget. My requirements is to do that CO posting influence only Commitment budget (
-
Wht are the function modules for download upload excel files in bdc.
hi all, this question seems to be silly but i had open office excel files i am getting problems to upload or down loading. can you tell which function modules can upload or down load open office excel files. another dought this is not need full but
-
Reg : Regular Standard BTC Jobs Schedule in PRD Server
Dear Friends, What kind of regular Background jobs in Basis shedule the PRD and DEV servers. If we scheduled that jobs in PRD server, what is the activities doing in backround jobs in basis level? If we delete the Old BTC jobs we are getting ABAP dum