Total newb var question

Hello :) ,
so Im a total newb :(
I am trying to make this code into a function....
<code>
jd_label.setIcon(new javax.swing.JLabel(){
public javax.swing.Icon getIcon(){
try {
return new javax.swing.ImageIcon(
new java.net.URL("http://ns2.taproot.bz/java/prima_interface/thumbs/02.jpg")
catch (java.net.MalformedURLException e){
return null;
}.getIcon());
</code>
problem is, Im such a new i dont know how to use a var on this line...
jd_label.setIcon(new javax.swing.JLabel(){
I would like jd_label to be a $var but java just wants to update
a label named "var".... i.e.
JLabel jd = new Jlabel();
string fred = jd
fred.setIcon()
but this freaks out... in PERL it seems the vars are a little more
reconazable...
$fred.setIcon();
Could some one please help me :)
Thanks in advance,
jd

Thank you :)
Im still confused...but that will pass in time
As for the code in the first post... that was from a scrip i wrote
but the section i posted NetBeans wrote. here is the whole scrip...
All i really want to do is put pictures on labels...and i thought, why write
the same code for every button, ill just make a function out of the whole setIcon bit and call it for each label that needs a picture, passing the url of the picture off to the function... Below gets me one pic on one label, so
how can i reproduce this efffect on other lables using the same code over and over?
import javax.swing.*;
import java.awt.*;
public class HelloWorldSwing {
public static void main(String[] args) {
JFrame frame = new JFrame("HelloWorldSwing");
JLabel label = new JLabel("Hello World");
JLabel jd_label = new JLabel();
     JTextField tex = new JTextField("sup suka");
     JPanel pan = new JPanel();
     pan.setLayout(new GridLayout(1,3,10,10));
     pan.add(label);
     pan.add(jd_label);
     pan.add(tex);
// i wanna make this bit into a fuction to reuse
     jd_label.setIcon(new javax.swing.JLabel() {
public javax.swing.Icon getIcon() {
try {
return new javax.swing.ImageIcon(
new java.net.URL("http://ns2.taproot.bz/java/prima_interface/thumbs/02.jpg")
} catch (java.net.MalformedURLException e) {
return null;
}.getIcon());
     frame.getContentPane().add("Center", pan);
     frame.pack();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);

Similar Messages

  • Total newbie with questions

    Hi, I've just started trying to create forms with Designer 7.0. I have managed to import a Word document and have found it easy to tweak the appearance and add different types of fields, but I have a couple of questions that I just can't figure out.
    1. I have created text fields in certain areas, but when I preview the PDF, there is a "T" at the beginning of each field that I can't delete. How can I get rid of this marker?
    2. I have to add several signature fields to some of the forms, and want at least one signature to make the entire form read-only. The forms will be electronically signed, and it is essential that no changes can be made once the signature has been applied, and that the signature itself cannot be copied and pasted into another record. How do I do that in Designer 7.0?
    Thanks in advance. I'm sure these are pretty easy functions, but I just can't seem to figure them out on my own.

    2. When you digitally sign a document, there is a green check mark that appears in the signature field. When you change the document, or sign a second field, that green check mark turns into a green check mark with a yellow caution triangle, indicating that the document has been changed since it was signed (in this example a new signature was added, but it could just as easily have been content that was changed). I assume that with Javascript you could go through and make all the fields read-only, but I'm not sure what you'd be accomplishing, since the signature field shows whether or not anything has been changed.
    I don't know of a way to copy signatures into another record, so I think you're safe there.
    Mike
    Mike Potter
    Adobe Enterprise Developer Relations

  • Newbie wireless question (slightly off-topic)

    I didn't want to post this here as it's not entirely an Airport-specific question. I posted this to the iBook forums, but nobody there has answered so my apologies if this is not welcome here. (Any moderators can remove it if that's the case.)
    I've been using computers extensively for over a decade, but I'm a total newbie to wifi. I just set up a wireless network in my house and would appreciate some advice/feedback.
    My main concerns are whether or not my network is reasonably secure. I know there is no such thing as perfect security, but I don't know if what I've done is good enough or not.
    I don't have an Airport base station, but I do have a D-Link Airplus G and an Airport card in my iBook. I have WEP set up on the router and I have enabled MAC filtering, listing only my desktop and my iBook, excluding all others from the network.
    I'm fairly certain that nobody in my neighborhood is going to get into my machines this way or be able to sniff my network data stream, but am I right in assuming that nobody can "piggyback" on my Internet connection too? Presumably, if everyone but my own machines are MAC-filtered and kept out, then the Internet connection is also protected. Is that how it works?

    WEP and MAC filtering are better than nothing, but you can do better. These are my suggestions:
    1. Use WPA with a pre-shared key (PSK) and TKIP encryption on your Netgear router, along with an alphanumeric passphrase of at least eight characters not found in any dictionary. The equivalent setting on your Mac is "WPA Personal". Unlike WEP security (which an expert can crack in under half an hour), WPA security is currently unhackable by any practical means as long as you use a non-dictionary passphrase. One last point - WPA security requires all your wireless Macs to be running MacOS 10.3 or newer.
    2. MAC filtering is (these days) essentially useless as a wireless security method. Using "packet sniffing" of traffic on your wireless network to find out what MAC addresses are used by computers on your network, and a PC that allows its MAC address to be cloned so that it is identical to the MAC address of one your own wireless computers (which is possible with most PC wireless network adapters) even an amateur hacker can defeat MAC address filtering in minutes.
    By the way - I don't think your posted message here is off topic. In my opinion, the Airport discussion forums are the best place to post any questions related to usage of wireless networks. Questions of this nature are virtually never specific to any Mac model.

  • Login/password to SQL plus - 100% Totally newbie!

    Dear users,
    I'm a 100% Totally newbie - please bear over with me and forgive that I couldn't find the answer to my question in the arhive although I'm sure somebody else has asked exactly this question. And please don't say RTFM etc, because there are a huge amount of manuals etc for oracle and I'm 100% newbie and never worked with Oracle SQL before.
    Introduction: I've installed Oracle 11.2 Enterprise Edition and want to go through some step-by-step tutorials - e.g. this tutorial: http://download.oracle.com/docs/cd/B10501_01/server.920/a90842/ch1.htm#1005898
    The tutorial says:
    "The Human Resources (HR) Sample Schema is installed as part of the default Oracle9i installation. The HR user is locked by default.
    You need to unlock the HR tables and user before you can use the HR sample schema. To unlock the HR tables and user, log in as the SYSTEM user and enter the following command:"
    Question: I cannot figure out my password, perhaps I entered something during install but how do I get password for the "SYSTEM" user?

    Hi,
    Welcome to the forum!
    There's no way to find out what a password is.
    You can log in as some other user who has DBA privileges (such as SYS), and change SYSTEM's password.
    If you've forgotten the SYS password, too, then log into the server as the same user who installed Oracle, or as some user in the ora_dba group. You should be able to log in as SYS. When asked for a password, just press the enter key, like this:
    C:> SQLPLUS /NOLOG
    SQL> CONNECT SYS AS SYSDBA
    Enter password: <enter>
    Connected.
    SQL>  ALTER USER SYSTEM IDENTIFIED BY new_password;
    User altered
    SQL>  CONNECT  SYSTEM
    Enter password: new_password
    Connected
    SQL>

  • Total newb

    Hello :) ,
    so Im a total newb :(
    I am trying to make this code into a function....
    <code>
    jd_label.setIcon(new javax.swing.JLabel(){
    public javax.swing.Icon getIcon(){
    try {
    return new javax.swing.ImageIcon(
    new java.net.URL("http://ns2.taproot.bz/java/prima_interface/thumbs/02.jpg")
    catch (java.net.MalformedURLException e){
    return null;
    }.getIcon());
    </code>
    problem is, Im such a new i dont know how to use a var on this line...
    jd_label.setIcon(new javax.swing.JLabel(){
    I would like jd_label to be a $var but java just wants to update
    a label named "var".... i.e.
    JLabel jd = new Jlabel();
    string fred = jd
    fred.setIcon()
    but this freaks out... in PERL it seems the vars are a little more
    reconazable...
    $fred.setIcon();
    Could some one please help me :)
    Thanks in advance,
    jd

    You need to study up on what Java is, how it works, syntax, etc. It seems you don't have the first clue how to write a valid Java class. This is fine, and of course that's where you have to start, but I think your time will be better spent reading the tutorials (links to which can be found on your left) than getting piecemeal help here on the forums. When you've gotten a handle on what classes, objects, variables, and methods are, and gotten some idea about syntax, come back with more specific problems and people will be more than willing to help you. Also, post to the New to Java Technology forum rather than this one.

  • A newbie first question: fpga synchronous input

    Hi all
    this is my first time to send a question at this forum
    it is also the first time to use Labview, I am totally newbie
    My problem is:
    I have Xilinx Spartan 3A FPGA with a design runs at 10 MHz " derived from the 50 MHz of the On-board clock"
    I want to test my design by appling inputs to the FPGA and watching the output
    so how to apply predefined synchronous inputs that are synchronized to the my design clock
    thanks in advance

    Good Afternoon msaleh87,
    What supporting hardware are you using with your Xilinx Spartan 3A FPGA?  The only NI hardware that the Xilinx Spartan 3A FPGA is found in are the sb-RIOs and the cRIO-9072 and cRIO-9074.
    What Xilinx FPGA Chips Are Used by National Instruments RIO
    Devices?
         http://digital.ni.com/public.nsf/allkb/ED6FC9CF7B983CFD86256DCE0072E313?OpenDocument
    Please elaborate on what you are trying to accomplish with this project.  Also, please give some more details (such as source, speed, type, etc.) of your predefined synchronous inputs.
    Regards,
    Charlie Piazza
    Staff Product Support Engineer, RF
    National Instruments

  • How to get a question in the course placed anywhere in the course and does not appear in the quiz result or total number of questions. Pretest would work except it can't go anywhere in the course (at least for me it can't)

    How to get a question in the course placed anywhere in the course and does not appear in the quiz result or total number of questions. Pretest would work except it can't go anywhere in the course (at least for me it can't)

    Use a normal question, and do not add the score to the total score. That will give you a correct score at the end. But the total number of questions, that system variable will still take into account all questions. You'll need a user variable, and calculate its value by subtracting 1 from the system variable cpQuizInfoTotalQuestionsPerProject. Same for the progress indicator if you want to show it?
    Customized Progress Indicator - Captivate blog
    If you want to allow Review, you'll have to tweak as well. You didn't specify the version, and all those questions I now mentioned.
    And my approach, since you talk about only one question: create a custom question, because you'll have total control then.

  • I am using elements 10 and only getting audio not video.  Can anyone please explain why? I am a total newbie to video.

    I am using elements 10 and only getting audio not video.  Can anyone please explain why? I am a total newbie to video.

    greenfrogstone
    Just saw your thread, and it looked like a candidate for the Premiere Elements 10 NVIDIA GeForce Roll Back the Driver issue. If your computer uses a NVIDIA GeForce video card/graphics card, then the following applies to you. You do not want to update the driver. Rather you want to roll back the driver version, probably to about May 2013. For your convenience I have done a copy/paste of the forum announcement which gives all the details and fix of the matter.
    Premiere Elements 10 NVIDIA Video Card Driver Roll Back
    If you are a Premiere Elements 10 user whose Windows computer uses a NVIDIA GeForce video card and you are experiencing Premiere Elements 10 display and/or unexplained program behavior, then your first line of troubleshooting needs to be rolling back the video card driver version instead of assuring that it is up to date.
    Since October 2013 to the present, there have been a growing number of reports about display and unexplained workflow glitches specific to the Premiere Elements 10 user whose Windows computer has a NVIDIA GeForce video card. If this applies to you, then the “user to user” remedy is to roll back the NVIDIA GeForce video card driver as far as is necessary to get rid of the problems. The typical driver roll back has gone back as far as March – July 2013 in order to get a working Premiere Elements 10. Neither NVIDIA nor Adobe has taken any corrective action in this regard to date, and none is expected moving forward.
    Since October 2013, the following thread has tried to keep up with the Premiere Elements 10 NVIDIA reports
    http://forums.adobe.com/thread/1317675
    Older NVIDIA GeForce drivers can be found
    http://www.nvidia.com/Download/Find.aspx?lang=en-us
    A February 2014 overview of the situation as well as how to use the older NVIDIA GeForce drivers for the driver roll back can be found
    http://atr935.blogspot.com/2014/02/pe10-nvidia-video-card-roll-back.html
    This matter has been very specific to the Premiere Elements 10 NVIDIA GeForce card user. So, if your computer is using other than a NVIDIA GeForce card, it is likely that the message does not apply to you, and we can then explore other troubleshooting possibities.
    Looking forward to your follow up. Do not hesitate to ask for clarification on anything written here.
    Thanks.
    ATR

  • General place for newbie datamodeler questions?

    With the production release of SQL Developer Data Modeler I'd assume that this forum will draw a bunch of new users. Is there a better place to ask some pretty simple, newbie like questions that won't bother the more seasoned members?
    For instance, I am working in a Rails environment, which has some stringent naming conventions, one of which is that all of the primary key columns are numeric and called "id", with the foreign key linked columns called <table_name>_id.  When engineering a logical model to a relational model, the added foreign key columns are all "id#".  Is there a way I can define a naming rule to keep me from having to redo the relation column names?
    Also, we have a standard set of columns (mostly Rails related) which appear in every table. Can I define a generation rule which automatically includes these tables?
    Thanks

    Thank you. I will try changing that setting.
    IS there a setting which tells the relational model to automatically create pk and fk indexes? I haven't seen one, and manually setting them up is a tedious task. --sw                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Newbie script question... consecutive numbers with update.

    complete newbie type question... this is also my first post.  ( I am using CS3)
    does anyone have a script which can make it so I can add numbers into the text consecutively.
    for example, if this is my text "the big fat dog sat on the very wide mat, but was then displaced by a unfriendly cat."
    and I wanted to place a number 1, number 2, 3, etc at points in the text so it read, "the big fat dog1 sat on the very wide mat2, but was then displaced by a unfriendly cat3." but later wanted to add another number and have later numbers update themselves, so the text then said, "the big fat dog1 sat on the very wide mat2, but was then displaced3 by a unfriendly cat.4".
    by inserting the three, the previous three became four.
    Has anyone got something which might be useful in this regard.
    Many thanks
    Steve

    i wanted to avoid footnotes as they leave a bar at the bottom of each page.
    i wanted a script to do something similar to footnotes but not much further.
    does anyone have just a simple script that can do what I asked?
    Steve

  • Newbie XSan question - authenticating a computer from XSan Admin

    Hello - I have a very newbie XSan question!
    I have 2 computers that connect to an XSan. 1 I am having no problems with. The other I am unable to connect with.
    When I look in XSan Admin the 2nd computer (the one that is not working) is not authenticated.
    So I click on it and choose Authenticate. I enter what I know is an Admin username and password for the computer I am attempting to connect. The dot next to the computers IP turns green with 3 dots in it and then it turns gray again. It just does not connect.
    What is the problem?
    Is it licensing?
    Thanks
    Taj

    You need a different license ID for each machine, plus the admin machine. Do you have that?

  • Total newbie for jsp..plz help

    frendz...me a total newbie to jsp.havin some problem in it.i have already installed jdk,jwsdp2.0 wif its tomcat container.Already set the path for both ..such as JAVA_HOME=E:\Program Files\Java\jdk1.5.0_06
    TOMCAT_HOME=E:\tomcat50-jwsdp
    and could execute the sample jsp's perfectly.But having problem wif my jsp tutorials. such as when i wrote this counter codes in notepad..
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
    <html>
    <head>
    <tittle>Jsp Declaration</tittle>
    </head>
    <body>
    <h1>Declarations</h1>
    <%! int j=0;%>
    <h2>Counter</h2>
    <p>This page has been hit <span> <% ++j %> </span> times since it was first loaded.</p>
    </body>
    </html>
    and i paste it in webapps in tomcat folder.
    What should i do to view the jsp file?isaved as counter.jsp.if i right click and view it in IE/firefox it only shows the source code.is there any mistake in the codes?or i did i do anything wrong?how shall i compile these files?help me aout wif my basics please.thanks bro's..

    "I pasted it in webapps in tomcat folder".
    Webapplications need to go in their own subdirectory inside the webapps directory. Say you want a webapp 'test', then you would store your JSP as
    TOMCAT_DIR\webapps\test\counter.jsp
    Now you can open this JSP in your browser. Assuming Tomcat is running on the localhost and the default port 8080, the url would be:
    http://localhost:8080/test/counter.jsp
    If that doesn't work something is horribly misconfigured.

  • Total Newbie Question ... Sorry :-(

    I know it's a windows thing, and I am now converted to Mac but I gotta know this because it's doing my head in. It's a complete stupid green gilled newbie question.
    When installing new programs on a Mac can you create shortcuts to the programs on the Dock? I did what I THOUGHT it would be, i.e I made an Alias and stuck it in the dock, but on rebooting my Mac later on, in place of the shortcuts where 3 question marks which when clicked on did absolutely nothing???
    Help?
    A.L.I
    Windows XP Pro Desktop, Macbook Pro, 60GB iPod Video   Mac OS X (10.4.5)   OS X

    You aren't installing something from a dmg file are you? The dmg is a disk image – kind of a virtual CD. So when you double click the dmg and then get the little disk/hardrive/custom icon on your desktop that is the same as if you had mounted a CD. You then need to drag the application off of that "CD" into your application folder. Then it is truly installed.
    You can then "eject" the icon your your desktop. This is what happens when you shutdown and without remounting the image your dock shortcut can't find the original.
    Just a thought.

  • Help! Total newbie question...

    I want to make a flash form where the viewer/user can watch a video clip of their choice (from a drop-down control or something else if there's a better way).
    I've found myself totally unable to find our how to do this.  I mean, frankly, I don't even know what kind of file to start from the "New..." form at the beginning of Flash (CS 3.0, btw)!
    I know how to create a Flash Player and link it to a single video.  What I envision is that after the page comes up, with a single player component (initially empty), the user chooses a video from the drop-down list and that video starts playing in the player.
    I guess I have these questions-
    What kind of file should I be starting with?  {I kinda assume I'll be making an SWF to put on a web page.}
    Where on earth do I learn how to get the simplest things (e.g., button clicks, etc.) to work?
    Could any of y'all please offer suggestions where I could find a sample of something similar?  -OR-
    Could any of y'all give me an example of how to do (code?) this?!?!
    I apologize for such dumb questions, but while I'm quite experienced with Premiere, Encore, Photoshop, etc., I am definitely NOT used to Flash!
    Thanks in advance!
    Jim 8^)

    This is going to be a pretty big learning curve for someone with no Flash experience. But, sometimes the best way to learn is to just dive in and start the project.
    I'd recommend using the help and tutorials for a while. You'll need to learn how to create buttons, use ActionScript, and more. My best guess is that you'll need to house each video file on your server with a unique location (URL) then create a pull-down button (or some method of selecting the files) that calls each specific video when the user selects it. I'm assuming you'll need to use a browser fscommand to loadMovie, but someone else may set me straight on that. My experience is limited in this specific task, but I think it might give you someplace to start looking.

  • Mounting Time Capsule drive - total newbie question

    I'm a total Mac newbiew, so please bear with me.
    There are alot of threads in this forum that talk about 'manually mounting' a time capsule drive. What is this manual mounting, what's the point of doing it, and how do you do it?
    My Time Capsule shows up under the Shared menu in Finder and I can access it from there. Is access to the disk via this link slower than mounting it or something?
    Lastly, my TC is connected to my Mac Mini via an ethernet cable. How can I check that the Mac is talking to the TC disk via this connection rather than over the wireless network that the TC is providing?

    By "mounting" people are meaning seeing the Time Machine disk icon actually showing on the desktop. I can only think of 2 reasons for this, 1) time saving if people use the disk for other purposes as well as Time Machine and need to access it regularly, and 2) If it mounts, it proves you have connectivity.
    Doing it from the finder sidebar is effectively the same thing, only you are doing it instead of getting the system to do it. Your initial access to the drive may be noticeably slower for a couple of seconds until it mounts is all, nothing worth worrying about
    See here for more info if you are interested in mounting it automatically:
    http://discussions.apple.com/thread.jspa?threadID=1446928
    As for your last question, unless your wireless and wired connection talk to different networks, then turn off your wireless and used the wired connection.

Maybe you are looking for