Why doesn't javac find getPixels

I took out the other code to simplify, it's importing about every package getPixels might be I think:
import java.applet.*;
import java.awt.*;
import java.lang.*;
import java.util.*;
import java.awt.image.DataBuffer.*;
import java.awt.Image;
import java.awt.image.*;
import java.awt.image.SampleModel.*;
import java.awt.image.ComponentSampleModel;
import java.awt.image.PixelInterleavedSampleModel;
import java.awt.image.Raster.*;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
public class M2 extends Applet
     private Graphics g;
     private DataBufferInt dbuffer=new DataBufferInt(3,2700);//TYPE_INT=3
     private int[]pieces=new int[3000];
public void init(){setBackground(Color.cyan);}
public void start()
     g=getGraphics();
     getPixels(0,0,60,45,pieces,dbuffer);
public void paint(Graphics g)
     //g.setColor(Color.yellow);
     //g.fillRect(0,0,30,20);
                    }

Find a class that does have getPixels. It will almost definietly be an instance method. Look up the Java Tutorials (to the left) and start reading from page one, and eventually move through the Graphics section. At that point search the API for Image and classes related to it...

Similar Messages

  • Why doesn't Maven find jfxrt.jar, although it is included in the JDK?

    Hi,
    Why doesn't Maven find jfxrt.jar, although it is included in the JDK?
    My solution to build JavaFX apps with Maven is:
    <dependency>
                <groupId>com.oracle</groupId>
                <artifactId>javafx</artifactId>
                <version>2.2</version>
                <scope>system</scope>
                <systemPath>${java.home}/lib/jfxrt.jar</systemPath>
    </dependency>It works, but I wonder why the Maven build process can't find it automatically, as any other Java dependency, too.
    If I build without the dependency, it can't find javafx imports.
    Since Java 7 Update 6 it is included in the JDK.

    There is a long drawn-out thread on this (you don't need to read it):
    Error initializing OC4J server (JDev 10.1.3 EA1) "JDK 7u6 JavaFX integration - Is jfxrt.jar supposed to be on the classpath?"
    Short summary is that jfxrt.jar is in the jdk/jre as of 7u6, but not on the default classpath for the jdk/jre (as of 7u13).
    This will change in a future release (e.g. I believe the latest early access builds of jdk8 do have jfxrt.jar on the default runtime classpath).
    So for now, you will need to explicitly add jfxrt.jar to the classpath. There are various ways to do this, one is to use a system dependency and then use the maven ant run plugin to package your app as is done in this example: http://code.google.com/p/willow-browser/source/browse/pom.xml
    <dependency>
      <groupId>javafx</groupId>
      <artifactId>jfxrt</artifactId>
      <version>${javafx.min.version}</version>
      <scope>system</scope>
      <systemPath>${javafx.runtime.lib.jar}</systemPath>
    </dependency>
    <plugin>
      <artifactId>maven-antrun-plugin</artifactId>
      <version>1.6</version>
      <executions>
        <execution>
          <id>create-launcher-jar</id>
          <phase>package</phase>
          <goals>
            <goal>run</goal>
          </goals>
          <configuration>
            <target xmlns:fx="javafx:com.sun.javafx.tools.ant">
              <taskdef
                  uri="javafx:com.sun.javafx.tools.ant"
                  resource="com/sun/javafx/tools/ant/antlib.xml"
                  classpath="${javafx.tools.ant.jar}"/>
                <fx:application id="fxApp"
                    name="${project.name}"
                    mainClass="${exec.mainClass}"/>
                <fx:jar destfile="${project.build.directory}/${project.build.finalName}-launcher">
                  <fx:application refid="fxApp"/>
                  <fx:fileset dir="${project.build.directory}/classes"/>
                </fx:jar>
                <attachartifact
                    file="${project.build.directory}/${project.build.finalName}-launcher.jar"
                    classifier="launcher"/>
            </target>
          </configuration>
        </execution>
      </executions>
    </plugin>Another way would be to make use of the zenjava javafx maven plugin:
    http://www.zenjava.com/2012/11/24/from-zero-to-javafx-in-5-minutes/

  • Why doesn't my Finder search work?

    Wanted to perform a search of text content in some PDFs. There are, say, 30 x 5-20 page PDFs sitting in a couple of folders, on a server I'm connected to. In Finder, I hit Apple F and then asked it to search the root folder those folders were sitting in, for one word that I knew was in one of the PDFs, specifying 'kind' as PDF. The title bar of the Finder window says 'searching FolderName' but even if I leave it there all day, nothing appears. Why not? It's also hard to know if it's actually doing anything because there's no 'in progress' symbol.

    Spotlight isn't indexing the server, so it won't find anything there.
    https://itunes.apple.com/ie/app/easyfind/id411673888?mt=12
    or
    http://www.macupdate.com/app/mac/30079/find-any-file
    couple of alternatives.

  • Why doesn't  iTunes find my music or app files anymore?

    Whenever I boot up the computer and run iTunes I find that my iTunes account is completely empty- no music, no purchases, nothing. The first time I didn't think much of it, but now I've reloaded all of my music several times and iTunes keeps resetting on a daily basis!!! Also, everytime I reload the music I end up with multiple copies of everything.  I only have about 6,000 songs but when it is done reloading (a couple hours later) I have over 22,000.  I have tried deleating itunes and re-installing it.  I have tried -adding a folder, -adding files -changing my preferences -keep media file organized and the -copy files to itunes media folder but it doesn't save any of these features.   I have also tried changing my configsys or system configuration - turning off all services and startups except MicroSoft and Apple.  I have searched the Internet and have not found any solutions that work. I am very frustrated and discouraged after wasting so much time on this.  

    You need to give a little more inforamtion about your set up.
    Do you have a default iTunes setup with your music in c:...My Music\iTunes\iTunes Music?
    Or are you using another drive or a network?
    The first thing you need to check is if your Music files are still where they should be.
    You can also check in Edit>>Preferences>>Advanced>>General for the location of your iTunes Music folder, what does it say, as is it correct?

  • Why Doesn't "find" work in VBS?

    I'm trying to write a VBS module that will
    detect when the data in a channel crosses
    some threshold. As an example, I include
    a line to check when channel 56 becomes
    greater than 5.0
    Here is the VBS line that checks for this:
    FirstValue = find( Ch(56) > 5.0, 1 )
    When ever I execute this script, DIAdem displays
    an error dialog with this message:
    Error in (Row:52, Column:9):
    Error message from DIAdem OCMD-interface:
    Invalid return value of the DIAdem kernel !
    What does this mean? Why doesn't the "find" function
    work? What other means can I use to do this operation?

    Hi jbrandim,
    The first parameter in the find() function is a string, so when you use this function with VBS syntax, you need to enclose it in double quotes:
    FirstValue = find("Ch(56) > 5.0", 1)
    Additionally, you can also call this function as a Formula Calculator function, since it is in fact a DIAdem function and not a VBS function:
    Call FormulaCalc("L1:= find(Ch(56) > 5.0, 1)")
    FirstValue = L1
    The cryptic error message is an artifact of the translation process between VBScript and the DIAdem find function. DIAdem automatically maps the return value of the find function, which is an integer, to the variant variable "FirstValue", as well as the input parameters. The mapping process from Variant to string in the first find() parameter failed, and
    that led to the error message you received.

  • Why doesn't my iPhone 4 have an 'Internet tethering' options? Is it carrier related or iOs related? Please help me find the solution for this. thanx

    Why doesn't my iPhone 4 have an 'Internet tethering' options? Is it carrier related or iOs related? Please help me find the solution for this. thanx

    Personal Hot spot
    http://support.apple.com/kb/HT3574
    Understanding
    http://support.apple.com/kb/HT4517
    Trouble Shooting
    http://support.apple.com/kb/TS2756

  • HT201365 why doesn't a mac have the find my iPhone app?

    why doesn't a mac have the find my iPhone app?

    It does.
    System Preferences>iCloud or www.icloud.com>findmyphone (if you have an old Mac running 10.6.8 or lower)

  • Lost my iPhone and why doesn't find my iPhone work

    Lost my iPhone and why doesn't find my iPhone work

    A friendly reminder: In order to use Find My IPhone Successfully, you need to 1. Turn on Location Services, 2. Lock Location Services (Using Restrictions in Settings, General, Restrictions) so that if some one else finds your IPhone, they can NOT turn off Find My IPhone And/Or Location Services itself! 3. Add your Mobile Me and/Or ICloud Account to your IPhone. 4. Lock Accounts (Again in Restrictions) from being changed or Deleted so that your Mobile Me And/OR ICloud Account can NOT be Deleted! 5. Look Up the Location of your IPhone Before Suspending Service to the IPhone, NOT after Suspending Service (simple common since applies here as well).

  • Why doesn't reply arrow find my reply?

    When I click the curly arrow which should take me to the reply that I typed to an email, it tells me what it can't find the reply and that I may have deleted it.
    However, when I check in the Sent mail folder, there is my reply. Why can't Mail find it?
    I have rebuilt both the InBox and Sent Mail folder, but it still doesn't find it.

    Hi Ernie
    Thanks for your replies. I meant to say yesterday too Thanks for the Welcome - I've been here before too, but when I came yesterday I was required to re-register - some change in the forums I guess?
    Yes, I did run under Panther, and for some of my mailboxes under Jaguar too.
    I've looked in all the various folders in the ~/Library/Mail/ folder and frankly have been puzzled by what I find.
    Yes there are other files in some of them, that obviously aren't being used now as the modification dates are not recent, so I'd assumed that the various updates to Mail along the way have made some files redundant. Can these files that aren't either info.plist or the Messages folder be safely deleted?
    I also can't see a consistent way that the various folders are setup and named. There are folders outside the Mailboxes folder that seem to be being keptup and current, but they don't seem to match all the accounts, nor the folders in the Mailboxes folder.
    For example I have 3 AOL accounts handled by IMAP. In the Mail folder two of them are identified as "[email protected]" and "[email protected]" but there isn't a folder named for my primary AOL name RogerKIWI.
    In Mail.app all three IMAP boxes have the same grey world icon, and are similarly named [email protected], [email protected], [email protected] so why aren't the folders in Library/Mail similarly named? Yet apart from the oddities of not always being able to open Replies it does all seem to work.
    I've put a screen shot showing the two folders contents here
    http://LisaAndRoger.com/Mailboxes.png
    I'm wondering if "starting over" might be the way to go - if I make a duplicate of my Mail folder so everything is saved, what would I need to keep in order to not have to set up my Accounts, Rules and mailbox hierarchy in place, then import the messages into them in the hope that from now on this "show me the reply" button will always work.
    Is the information about the Replies kept with each message, or is it kept in a central data file somewhere? What does the "Envelope Index" file keep track of?
    Thanks
    Roger
    PowerMac G4 Dual 1.25 GHz   Mac OS X (10.4.4)  

  • HT1343 Why doesn't Command-X cut a file in finder?

    Why doesn't Command-X cut a file in finder?
    According to this article it must to! http://support.apple.com/kb/HT1343?viewlocale=en_US&locale=en_US
    What is  way to cut the a file WITH OUT using a mouse/trackpad - with keyboard only?

    http://lifehacker.com/5812127/how-to-copy-and-paste-in-the-mac-os-x-finder
    http://apple.stackexchange.com/questions/74507/cut-paste-files-or-folders-on-mac -os-x
    http://dailymactips.com/2012/09/18/how-to-cut-paste-files-and-folders-in-mac-os- x-mountain-lion/
    http://hints.macworld.com/article.php?story=201107211337186
    Command-C
    Command-Option-V

  • Why doesn't disk utility recognize time capsule when finder does recognize it as a shared device?

    Why doesn't disk utility recognize time capsule when finder does recognize it as a shared device?

    I don't have a TC, but I hate Network solutions, as there is no way to repair them!
    Not wishing to look up what a TC can do, is there any wayto connect it directly???

  • Why doesn't my lost iPhone show up on the 'find me' map?

    Why doesn't my lost iPhone show up on the 'find me' map?

    Many things can prevent this: the phone is out of battery power, the phone has been wiped out and is no longer connected to your mobile me account, and many more.
    The full list of possible issues according to Apple is here:
    http://support.apple.com/kb/TS2734
    Good luck!

  • Why doesn't the mac tell me which disk was not ejected properly? How can I find out which one it is referring to?

    If the mac knows that a disk was not ejected properly why doesn't it tell me which one? Would that be making life too easy for non computer nerds????

    Hello Rails50
    All External Hard Drives, Flash Drives, Camera Cards, iPods, iPads etc. need to be ejected before you disconnect them. Likewise you may also get that message from any of the above mentioned devices if it is going bad, has a bad cord or a flaky connection.
    To check your Console Log Messages, go to: Applications > Utilities > Console and select All Messages.
    On that note, it would also help greatly if we knew what external device(s) you are using with your iMac?
    Dennis

  • Question about how javac finds referenced files.

    Hi
    I am just beginning to learn Java and have got some questions related to packages.
    I have two classes:
    MyClass.java
    package pkg;
    public class MyClass {
         public void prn(int x){
         System.out.println("Integer: "+x);
    Test.java
    import pkg.*;
    public class Test{
         public static void main(String[] args){
              MyClass obj=new MyClass();
              obj.prn(2);
    Directory structure
    /root/ jprog/MyClass.java
    /root/ jprog/Test.java
    Executing the following sequence of commands gives me:
    # ls
    MyClass.java Test.java
    # javac -d . MyClass.java
    # ls
    MyClass.java Test.java pkg/
    # cd pkg
    # ls
    MyClass.class -----compiles.
    # cd ..
    # javac Test.java
    Test.java:5: cannot access MyClass
    bad class file: ./MyClass.java
    file does not contain class MyClass
    Please remove or make sure it appears in the correct subdirectory of the classpath.
    MyClass obj=new MyClass();
    ^
    1 error
    Now after reading another thread on this forum I came to know that the compiler finds the
    MyClass.java in the wrong package. Using verbose option with javac shows this.
    So I move it to some other directory and everything works.
    # mv MyClass.java /root
    # ls
    Test.java pkg/
    # javac Test.java
    # java Test
    Integer: 2
    Now the question begins:
    Suppose we go back to how the files were arranged before I moved the MyClass.java file and
    I change the Test.java file by adding
    package pkg2;
    statement to it.
    Now everything compiles
    # ls
    MyClass.java Test.java ---I have deleted pkg and .class files
    # cat Test.java
    package pkg2;
    import pkg.*;
    public class Test{
    public static void main(String[] args){
    MyClass obj=new MyClass();
    obj.prn(2);
    # cat MyClass.java
    package pkg;
    public class MyClass {
    public void prn(int x){
    System.out.println("Integer: "+x);
    # javac -d . MyClass.java
    # javac -d . Test.java
    # ls
    MyClass.java Test.java pkg/ pkg2/
    # java pkg2.Test
    Integer: 2
    Why isn't the MyClass.java file causing any problems now?
    Using the verbose option with javac shows that the compiler goes straight for the pkg/MyClass.class.
    My readings of Core Java Horstmann tell me that the compiler always looks in the current directory. javac documentation also doesn't help. I know that the documentation recommends that the source file locations should match the package statements.
    I'm just trying to learn how javac finds referenced files.
    Any help??
    Thanks a load in advance.

    I know that the
    documentation recommends that the source file
    locations should match the package statements.This is not merely a recommendation, it is a requirement.
    Both javac and java find classes by traversing the classpath. The classpath should contain directories (or jar files) that correspond to the top of a (part of the) package hierarchy.
    For example, if the Java code for your class is in a file C:\src\pkg\MyClass.java, and MyClass.java declares the class to be in package pkg, the classpath should contain C:\src. Classes are then found by transforming their package declaration into a directory structure.
    Please note that javac works on files, not classes. Therefore it is necessary to specify the full filenames of the files you want to compile, even if you have specified the classpath. By default, javac will put compiled class files in the same location as their sources, so the classpath for the java command should also contain C:\src.
    The exception to the rule is when all classes for the program are in the default package (i.e., they do NOT contain a package statement). In that case, it is possible for javac (and I believe java as well) to find all classes in the current directory, so it will "just work".
    You can specify the classpath using the -cp parameter to both javac and java.
    Hope this helps.

  • Maintaining Macs--Why doesn't Apple tell you more?

    This is not a problem that I need to solve but just something I've been wondering about. Why doesn't Apple tell people the routines they need to use to maintain their Macs?
    If you do a search on "maintenance" in Support the fourth item is Mac Maintenance Quick Assist:
    http://docs.info.apple.com/article.html?artnum=303602
    The things they tell you to do are:
    1) Keep Things Up to Date; 2) Put Your Files Away; 3) Name Your Files; 4) Prune Through Your Files; 5) Back Up Your Files; 6) Check for Viruses; 7) Clean the Outside
    Where is anything about running the maintenance scripts, checking permissions, checking your preferences, updating the databases, cleaning caches, or anything else that software programs like Onyx, Cocktail, etc make their purpose? Why don't they mention getting a program like Disc Warrior and running it periodically?
    The first item on their list is Keep Things Up to Date, meaning download system and application updates. Well after looking at these forums for a while I would have to say that is the worst thing you could do, as so many posts start, " Help! I updated my software and now things don't work...." Even if you look at this article about updating your software...
    http://docs.info.apple.com/article.html?artnum=106704
    ...nowhere does it mention repairing your permissions! Yet everywhere on this forum that is mentioned as one of the first things to do...unfortunately AFTER people are crazy with problems.
    I don't get it. Even in the manuals that come with the computers none of this stuff is mentioned (last time I looked) except in the troubleshooting section. Would you buy a car where the owner's manual had "change the oil regularly" listed in a section on what to do after you've blown your engine?
    Granted, a lot of people on this forum know all these things and do them regularly, but I have several friends with Macs who never do any regular maintenance because they've never been told to. One just called me last week because his iMac auto-updated and he had all sorts of problems.
    So why is this? Why isn't basic Mac maintenance explained to people better? Going back to the car analogy, people have been taught they have to give their cars tune-ups or face an eventual breakdown. Why not with Macs?
    I have been using Macs for years and enjoy looking into this geeky stuff. And I rarely have any serious problems. I would think it has a lot to do with the fact that I don't automatically update without checking MacFixit first and seeing what problems people are having and running a few simple maintenance routines periodically, plus backing up for good measure. Why isn't Apple more upfront with people about maintaining their Macs? Am I off-base here?
    ibook G3, imac G5   Mac OS X (10.4.9)  

    I'll provide you with several references you will find interesting reading:
    http://www.macfixit.com/article.php?story=20060413075624652
    http://www.macworld.com/2006/08/secrets/repairpermissions/index.php
    http://www.macworld.com/2006/03/secrets/tcopermissions/index.php
    http://www.atomicbird.com/node/view/29
    The document to which you referred is an old one that dates back a ways when permissions repairs were often still needed because many installers improperly changed permissions or caused permissions to change through other improper operations. In reality the only thing permissions repair affects are the permissions on OS X installed software for which there are receipts in the /Library/Receipts/ folder and third-party software that install a receipt that includes information on resetting permissions for that software. The vast majority of third-party applications provide no such information and repairing permissions has no impact on them.
    As for maintenance scripts they are now supposed to be run automatically regardless of whether the computer is turned on in the early AM, but this is an implementation with Tiger because Tiger introduced a new method of task launching. It's not 100 percent effective but it's better than it was. However, it's an easy problem to solve because there are some excellent utilities that solve the problem: Macaroni, Anacron, and Pseudo Anacron - VersionTracker or MacUpdate. I use Macaroni on all my Macs.
    Kappy's Personal Suggestions for OS X Maintenance
    For disk repairs use Disk Utility. For situations DU cannot handle the best third-party utilities are: Disk Warrior; DW only fixes problems with the disk directory, but most disk problems are caused by directory corruption; Disk Warrior 4.0 is now Intel Mac compatible. TechTool Pro provides additional repair options including file repair and recovery, system diagnostics, and disk defragmentation. TechTool Pro 4.5.2 is Intel Mac compatible; Drive Genius is similar to TechTool Pro in terms of the various repair services provided. The current version, 1.5.1, is Intel Mac compatible.
    OS X performs certain maintenance functions that are scheduled to occur on a daily, weekly, or monthly period. The maintenance scripts run in the early AM only if the computer is turned on 24/7 (no sleep.) If this isn't the case, then an excellent solution is to download and install a shareware utility such as Macaroni, JAW PseudoAnacron, or Anacron that will automate the maintenance activity regardless of whether the computer is turned off or asleep.
    OS X automatically defrags files less than 20 MBs in size, so unless you have a disk full of very large files there's little need for defragmenting the hard drive. As for virus protection there are few if any such animals affecting OS X. You can protect the computer easily using the freeware Open Source virus protection software ClamXAV. Personally I would avoid most commercial anti-virus software because of their potential for causing problems.
    I would also recommend downloading the shareware utility TinkerTool System that you can use for periodic maintenance such as removing old logfiles and archives, clearing caches, etc.
    For emergency repairs install the freeware utility Applejack. If you cannot start up in OS X, you may be able to start in single-user mode from which you can run Applejack to do a whole set of repair and maintenance routines from the commandline.
    When you install any new system software or updates be sure to repair the hard drive and permissions beforehand. I also recommend booting into safe mode before doing system software updates.
    Get an external Firewire drive at least equal in size to the internal hard drive and make (and maintain) a bootable clone/backup. You can make a bootable clone using the Restore option of Disk Utility. You can also make and maintain clones with good backup software. My personal recommendations are (order is not significant):
    1. Retrospect Desktop (Commercial - not yet universal binary)
    2. Synchronize! Pro X (Commercial)
    3. Synk (Backup, Standard, or Pro)
    4. Deja Vu (Shareware)
    5. PsynchX 2.1.1 and RsyncX 2.1 (Freeware)
    6. Carbon Copy Cloner (Freeware - 3.0 is a Universal Binary)
    7. SuperDuper! (Commercial)
    The following utilities can also be used for backup, but cannot create bootable clones:
    1. Backup (requires a .Mac account with Apple both to get the software and to use it.)
    2. Toast
    3. Impression
    4. arRSync
    Apple's Backup is a full backup tool capable of also backing up across multiple media such as CD/DVD. However, it cannot create bootable backups. It is primarily an "archiving" utility as are the other two.
    Impression and Toast are disk image based backups, only. Particularly useful if you need to backup to CD/DVD across multiple media.
    Visit The XLab FAQs and read the FAQs on maintenance, optimization, virus protection, and backup and restore.
    Additional suggestions will be found in Mac Maintenance Quick Assist.
    Referenced software can be found at www.versiontracker.com and www.macupdate.com.
    I know that Joe Average has no clue, but it's not Apple's responsibility to provide Joe Average with clues on how to use a computer. No more than it's not GM's responsibility to teach you how be an automotive mechanic or how to drive. Some things you have to take responsibility for yourself. It's just that Joe Average is too lazy to read the User Guide, buy a book, or in any other way learn about computers before buying one.
    As you can tell I am somewhat heavy handed about personal responsibility. Computers are essentially toys that aren't dangerous, but the person playing with them is. What really scares the crap out of me is that same Joe Average has a driver's license and may be old enough to drink liquor. When it comes to driving or drinking and driving Joe Average is no more competent.

Maybe you are looking for

  • Parsing xml using DOM parser in java

    hi there!!! i don have much idea about parsing xml.. i have an xml file which consists of details regarding indentation and spacing standards of C lang.. i need to read the file using DOM parser in java n store each of the attributes n elements in so

  • Control stmt CASE vs IF - Which is better

    Hi, I'm in the process of retrieving data from a table that has millions of rows. Now I need to count the numbers of rows where a particular field,TR_STATUS is either 'A','G' or 'K'. I have three different variables to hold the count on the rows with

  • How to maintain WORK for General Cost activity

    Hi, can anybody show me how to maintain WORK for a General Cost activity. In the detail screen I cannot find field WORK, so I also don't know how to confirm for a General Cost activity Thanks Long

  • Creating signed Java applet for Netscape 4x

    I have created a signed jar with SuperUser privileges under Netscape. public void init() { try { if( Class.forName("netscape.security.PrivilegeManager") != null ) { netscape.security.PrivilegeManager.enablePrivilege("SuperUser"); } catch( ClassNotFou

  • Problem with swf embedded in textField (CS3)

    Hi, You may see the issue on the attached image. Basically, there is a Flash movie embedded in the HTML TextFiled. The code is is as follows: <img src="http://www.youtube.com/swf/l.swf?video_id=2LTSFPkqZyg" width="470" height="350"></img> <p><br /><b