Tutorial/HowTo for Java JFrame image map

I am a first semester Java student and am required to program a very simple game. I want to paint a Super Mario theme using 30x30 pixel blocks. I have been going through tutorials for a few days on displaying gif/jpg/png within a jframe and all use different methods. Does anyone know of a tutorial that focuses on building a jframe that is filled by a 2d array, each array element being a png?
I am new to JFrames having spent most my time with console/text only programming.

Welcome to the Sun forums.
atozer wrote:
I am a first semester Java student and am required to program a very simple game. A 'very simple' game would be console based. Perhaps 'hangman' would fit the bill.
.. I want to paint a Super Mario theme using 30x30 pixel blocks. Huhh.. What does 'theme' mean to you? Searching for 'Super Mario theme' all I could see was hits for the theme music. I take it this would be better described in a screen-shot. Do you have a link to one?
..I have been going through tutorials for a few days on displaying gif/jpg/png within a jframe and all use different methods. Does anyone know of a tutorial that focuses on building a jframe that is filled by a 2d array, each array element being a png?1) It is generally not a good idea to consider a root component such as a JFrame, JApplet, JWindow or JDialog to be the 'main area' of the GUI. Instead it is more common/useful to put the main GUI into a JPanel, which can then be put into any of the root level components as needed.
2) I suspect your tutorial requirements are too specific for any single tutorial. Instead look to tutorials on 2D rendering, and separately to tutorials dealing with images. The 'creating a GUI' part is worthy of its own tutorial as well.
I am new to JFrames having spent most my time with console/text only programming.And we come back to. A simple game is a console based game.
If somebody was set on learning to create GUIs, I would recommend they steer clear of GUI based games until they have completed a number of GUI based projects that do not involve custom painting (let alone the intricacies of doing custom painting in a responsive game that renders at nn FPS), which I suspect is what is needed to recreate a Super Mario game.
KISS!

Similar Messages

  • Finding a Gif Encoder for Java Advanced Imaging (JAI)

    I'm trying to find the GIF encoder for Java Advanced Imaging. I keep reading all over the place that there is one, but for the life of me I can't figure out where it is supposed to be. Could anyone please enlighten me?
    Thanks

    After I installed this, it still doesn't report gif as a possible encoding type:
    String[] codecs = ImageCodec.getEncoderNames(img, null);
                for (int j = 0; j < codecs.length; j++) {
                    String codec = codecs[j];
                    System.out.println (codec);
                }only reports the following types available:
    pnm
    jpeg
    tiff
    png
    bmp

  • Global change for hotspots on image map

    The image underneath my hotspots needed to be changed in
    Photoshop. It's on all of the pages, and when the image was
    replaced in Dreamweaver, I noticed that all of the hotspots that I
    created manually in Dreamweaver were lost. How can I create
    hotspots on just one of the pages and have it apply to all of the
    pages? (I'm not using templates, by the way.)
    I created slices on the image in Image ready, then exported
    images and html, but I'm not sure how to incorporate and organize
    everything in Dreamweaver.

    jgleica wrote:
    > I have an image map in my HTML file that contains three
    circular hotspots. When
    > they're viewed in a browser, each one has a black border
    around it after it's
    > clicked on. I've seen other help threads on the border
    problem talk about
    > putting 'border:none" in the IMG tag, but there's no IMG
    tag..it's an image map
    > and border is already set to "0". The code is below:
    > <map name="satelliteLinks">
    > <area shape="circle" coords="94,64,41"
    > href="
    http://gi.leica-geosystems.com/LGISub5x307x0.aspx"
    target="_self" />
    > <area shape="circle" coords="297,51,48"
    > href="
    http://www.erdas.com/erdasCompanyNews.aspx"
    target="_self" />
    > <area shape="circle" coords="517,59,43" href="
    http://www.erdas.com"
    > target="_self" />
    > </map>
    >
    > Any suggestions would be very helpful as my deadline to
    have this complete is
    > today!!
    >
    Thats the way the web works, its an accessibility feature, as
    its how
    you can tab around the page and see where the links are. Look
    at any
    website, click the link, and see what happens.
    Steve

  • The Tutorial files for Java webservices tutorial

    hi ,
    The links given on the Java Web services tutorial, to download the source code for the samples dealt in the book seems to be outdated, Does any one have new link.
    Here is the old link
    http://java.sun.com/webservices/download/webservicespack.html.
    thanks for your help..
    chiranjeevi.

    never mind,
    Looks like the book has wrong link,
    it has
    http://java.sun.com/webservices/download/webservicespack.html
    where it should be
    http://java.sun.com/webservices/downloads/webservicespack.html
    thank you,
    Chiranjeevi.

  • Download for Java Advanced Imaging Image I/O Tools 1.0 not working

    Hey there,
    Anyone able to get the JAI I/O package from Sun, whenever I go to download it from
    http://java.sun.com/products/java-media/jai/downloads/download-iio.html
    I get a "FATAL Exception".
    If anyone has a copy of the I/O package and can share it please let me know. I have downloaded the regular JAI API but I do not believe this adds TIFF support.

    I read somewhere (perhaps in the imageio-interest maillist) that
    the native libraries only apply to JPEG and that they aren't strictly
    necessary unless you want the accompanying performance boost. So I've
    been using just the JAR files and NOT the native dll:
    clibwrapper_jiio.jar
    jai_imageio.jar
    mlibwrapper_jai.jar
    But NOT: clib_jiio.dll
    This has worked fine for my application and my applet. I have been using the BMP and TIFF readers with no problem. However, when I bundle these
    JAR files into my Java Web Start application, those readers aren't found. I see the JAR files get loaded and validated (I had to sign each of these JAR files -- could that be a problem?) but my JavaWS application can't read TIFF or BMP. Any ideas?
    Could someone confirm that the JAR files ARE usable without the native
    libraries? Also, in that case, does one need ALL the JAR files?

  • Any JDeveloper tutorial suggestions for Java/OOP newbie

    I know SQL and basics of OOP. Have Oracle 10g and JDev installed. Got up to Chapter 4 of the on-line JJavaEE tutorial ( http://download-west.oracle.com/otndocs/products/jdev/10131/JavaEE_tutorial.pdf ), but then got lost after that. Too complex of an example app and not enough explainations of WHY the steps were to be taken in the tutorial. Anyone know of a SIMPLE tutorial that would be good to use with JDeveloper?
    Paul Peterson

    There is a bunch of tutorials linked from the JDeveloper home page on OTN: http://oracle.com/technology/jdev
    I would suggest to start with the following 3:
    Get to know the IDE:
    http://www.oracle.com/technology/obe/obe1013jdev/10131/introide/introjdevide.htm
    Get to know ADF:
    http://www.oracle.com/technology/obe/obe1013jdev/10131/masterdetail_adf_bc/master-detail_pagewith_adf_bc.htm
    Get deeper into ADF:
    http://www.oracle.com/technology/obe/ADFBC_tutorial_1013/10131/index.htm
    But you should also check all the rest there.

  • Image mapping and Master Detail Regions in CS3

    Excellent advice to leave a url. I think I am having a similar problem with conceptualizing datasets for utilization with image mapping. I obviously cannot use the Get Schema via the Attach New Data set icon because I have rendered my own Master region. I am working with CS3. I will launch the site and ask for help from the url.
    Here is:
    http://www.atmfoods.net16.net/
    I need help with this. With the phasing out of tabulated layouts for div based layouts I run into quite a few snags attempting to work around deprecation of tags issues. What am I trying to do here:
    1. Get my spry menu to drop down in the child table and not the parent table aligned top left.
    2. Use image mapping of the thumbnail images in integration with datasets and spry Master/Detail regions, even if hand coded to achieve, for a larger image and data on each thumbnail on an accordion spry widget. I am thinking grid systems for the future of my works and hope to achieve some relative command of grid systems. Without gridlock.

    Hi,
    The dataset name in the NestedDataSet constructor does not go
    in quotes.
    Try var dsCreds = new Spry.Data.NestedXMLDataSet(dsAgents,
    "credentials/cred");
    and see if that helps.
    Don

  • Don't like the Navigation Bar? Try an Image Map.

    I understand the simplicity of the Navigation Bar, but being unable to even move the hyperlinks, let alone change the font without resorting to hacking XML, struck me as too simple. I decided not to use it, instead opting for a hyperlink image map, which is really easy to make using iWeb. I put up directions here:
    http://web.mac.com/jadespace/iWeb/1/Fetish/BEC79E6E-E82F-4AE3-9964-6BA510D46F1E. html

    The image bit is quite a good idea. I had created menus on my page, for the same reason as I wanted my own fonts. It all works perfectly until I decided to add some flags to differentiate the same pages in different languages and I placed my flags in the top area of the page.
    I spent hours trying to understand why they wouldn't work, changing opacity, location, size, until I moved them enough to realise that the top area is restricted to link generated by iweb and if you attempt to place your link to high, it will work in the iweb program but will not publish...
    about 2.5 cm from the top are banned from publishing links
    bernard

  • Mistake creating an Image Map

    Hello, I have a problem with my Image Map. Here are my steps:
    1.Create areas for the Image Map
    2.Create the Image Map with areas
    3.upload the image
    4.create the OTH file
    5.Enable rendering information option
    6.Create KM navigation iView and its layout set mode as default
    All references for directories and for my pic are OK but it doesn´t show any Image Map. I need help please!
    Thank you

    Hi,
       You can follow this example:
    In KM, image maps are used for a graphical depiction of folder contents. These objects are displayed using graphics instead of in their normal text form.
    Step 1 – Determine the image you want to use for navigating. This can be any JPG or GIF file. In this example I will reference the file world.gif.
    Step 2 – Configuring an image map. Take your image file world.gif and place it in the system. For our example place the file in the path: …../knowledgemanagement/etc/public/graphics. The subdirectory “graphics” was created within the public folder.
    Step 3 – In the documents folder, create the following folders:
    •  World
         Within the “World” folder, create the subfolders:
         North America
         South America
         Europe
         Asia
    Note: you can create as many folders as you like. This structure will serve as the navigation structure for world.gif image map.
    Step 4 – Determine the navigation coordinates for the image world.gif. Any tool can be used, for this example the tool GeoHTML was used. It is a freeware tool that can be downloaded from http://www.fegi.ru/geohtml.
    •  The following coordinates were determined for the folders:
         North America: 253, 255, 303, 285
         South America: 424, 171, 474,201
         Europe: 368, 43, 418, 73
         Asia: 276, 37, 326, 67
    Step 5 – Create new link-sensitive Areas for the image map. Menu path: Configuration -> Content Management -> User Interface -> Image Maps -> Areas
    Please note, an area would need to be defined for each area on the image map that would be link-sensitive areas.
    Step 6 – Defining an Image Map. In this step the name of the image map will be defined as well as specifying the path of the image, the tooltip, and lastly assigning the areas.
    Step 7 – Configure an Object Type Handling (OTH) file for the image map. OTH files are located in the /oth subdirectory within the /etc repository. Copy an existing OTH file in this subdirectory and copy it to “world.oth”. In This OTH file, define the navigation path, collection renderer, layout controller, action and image map. The OTH file should look as follows:
      <?xml version="1.0"?>
      <ObjectTypeHandler Name="Image Map world"
    Class="com.sapportals.wcm.service.objecttypehandler.GenericObjectTypeHandler">
    <SelectionCriteria>
      <Paths>
        <Path>/documents/World</Path>
      </Paths>
    </SelectionCriteria>
    <Properties>
      <Property Key="rndCollectionRenderer"              Value="ImageMapRenderer"/>
      <Property Key="LayoutController"                   Value="DefaultLayoutController"/>
      <Property Key="rndShowActions"                      Value="false"/>
      <Property Key="rndMap"                      Value="MapOfWorld"/>
    </Properties>
    <Actions/>
    </ObjectTypeHandler>
    Step 8 – Display the image map. For the navigation iView that is being used, ensure that the iView property “Layout Set Mode” is set to default.
    Step 9 – Reload the object type handler in order for the system to read the new oth file world.oth. This can be done by within the Rendering Information link in any navigation iView for a user that is specified in the Debugging Settings (this is done in the user interface configuration).
    Another option to reloading the object type handler would be restarting the J2EE engine.
    Step 10 – In the navigation iView for this mage map, navigate to the image map. In this example, the menu path would be documents/World
    Patricio.
    ps: If you want I can send you complete example.

  • What's the latest stable version of Java Advanced Imaging Image I/O Tools?

    Hi,
    Could anybody tell me what's the latest stable version for Java Advanced Imaging Image I/O Tools and from where I can download the same?
    Thanks

    Just 'mark out of date' the package. Or email him directly. The forums are generally the WORST way to try and contact any specific developer.
    Oh, and before that, please do a quick google....
    http://projects.gnome.org/gedit/
    Closing.

  • JDeveloper - problems with Tutorial for Java EE Developers

    Hi,
    I am trying to start learning Oracle J2EE technologies, and I am using the Oracle "Tutorial for Java EE Developers (10.1.3.1.0)" listed in the Oracle Application Server 10g (10.1.3) page: http://www.oracle.com/technology/tech/java/oc4j/1013/how_to/index.html.
    I am having problems in chapter 2, at the creating EJB 3.0 Persistence Entities stage, when using the Create Entities from Tables Wizard. Basically, when I select all the tables from the SRDEMO schema and attempt to create the Java classes, only the first table objects are created - ExpertiseAreas.java and ExpertiseAreasPK.java. I do not get any error messages, so I am not sure why the other table objects are not created.
    If I then use the Wizard to select tables individually, the objects are created. However, they appear to be missing some details - specifically the @OneToMany annotation.
    Has anyone encountered this same issue, or are there any known issues with this tutorial.
    I am using version 10.1.3.4 of JDeveloper, on a 10g (10.2) XE database. I installed the version of JDeveloper without JDK included. I have a Sun Java EE 5 SDK Udate 5 (JDK 6u7) install of JDK.
    Thanks,
    Fraser

    Please refer
    http://www.oracle.com/technology/obe/obe1013jdev/10131/10131_ejb_30/ejb_30.htm
    http://www.oracle.com/technology/tech/java/oc4j/ejb3/howtos/howtoejb30mappingannotations/doc/how-to-ejb30-mapping-annotations.html#onetomany

  • Tips on how to write efficient  java code for java mapping

    hi
    I do not have much knowledge in Java
    Can anybody tell me some tips on how to write efficient and optimised java code to be used in java mapping
    Thanks,
    Loveena

    hi D'za,
    JAVA in xi
    A very important place where you will use JAVA in XI is while doing your Mapping. There will be cases when JAVA MAPPING is the best solution to go for. There are 2 types of Parsers available for JAVA Mapping. DOM Parser and SAX parser. Just got through the following links to understand more on Java Mapping and the APIs available.http://java.sun.com/j2se/1.4.2/docs/api/javax/xml/parsers/package-summary.html http://java.sun.com/j2se/1.4.2/docs/api/org/w3c/dom/Document.html http://java.sun.com/j2se/1.4.2/docs/api/org/w3c/dom/package-frame.html /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-i
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-ii /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-iii
    JAVA mapping -
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-i /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-ii /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-iii /people/ravikumar.allampallam/blog/2005/06/24/convert-any-flat-file-to-any-idoc-java-mapping /people/amol.joshi2/blog/2006/03/10/think-objects-when-creating-java-mappings /people/sameer.shadab/blog/2005/09/29/testing-abap-mapping
    sample code for java mapping
    Re: Example code DOM PARSER API -
    http://java.sun.com/j2se/1.4.2/docs/api/org/w3c/dom/package-frame.html DOM --- /people/thorsten.nordholmsbirk/blog/2006/08/10/using-jaxp-to-both-parse-and-emit-xml-in-xi-java-mapping-programs tutorial sax and dom
    For a tutorial on the methods of SAX and DOM http://java.sun.com/webservices/docs/1.1/tutorial/doc/
    SAX AND dom PARSER ( BY thorsten) -
    example /people/thorsten.nordholmsbirk/blog/2006/08/10/using-jaxp-to-both-parse-and-emit-xml-in-xi-java-mapping-programs java mapping example ( testing and debugging) /people/stefan.grube/blog/2006/10/23/testing-and-debugging-java-mapping-in-developer-studio
    regards
    biplab
    Use a Good Subject Line, One Question Per Posting - Award Points

  • Can I leverage JDom or Dom4J for java mapping in PI 7.0?

    Hi,
    since we know that PI 7.0 is based on jdk1.4 which officially allows DOM and SAX,but could I using the open source API like JDom or Dom4J via importing the related jar file to PI IR for java mapping?Anyone tried that?

    Hi ,
             I tried importing jar files into PI7.0 I was able to do so.
    First add the external jar file for JDOM into build path in eclipse (or NWDS). I did this in eclipse.
    Again I tried to import the same jar file into project within eclipse. Then the jar file will be broken into class files.
    Now compile the JDOM code you wrote and do project ->build all. This will generate the class file for your source code in addition to the class files formed earlier. Now exit from eclipe. Move to source folder of the eclipse. there you will find the .java file and the set of class files which were imported into the project earlier. Copy these files to separete folder say "myclass". Now again move to "bin" folder of your eclipse settings and obtain the .class file for the source code you have written. Copy this class file to the  "myclass" folder. Now using WINZIP zip all files into one ZIP file within "myclass" folder. Finally import this ZIP into PI 7.0 server. Run the mapping code using test tab. If you are getting any linkage error then you need to obtain correct external jar for JDOM parser else the mapping should run fine.
    Regards
    Anupam

  • Swing Tutorial for Java version 1.4.2

    Hi all, where the subject can be found?
    Current tutorial for Swing that is present on site http://java.sun.com/docs/books/tutorial/uiswing/
    is for Java 6 only.
    I am particularly interested in filtering JTable.
    Thanks in advance.

    Here is a link to the 1.5 tutorial which I believe is the same as the 1.4.2 tutorial:
    https://www.cs.auckland.ac.nz/references/java/java1.5/tutorial/uiswing/TOC.html

  • AREA TOOLS FOR IMAGE MAPPING TOOLS ARE MISSING (CC 2014.1.1)

    Hi guys,
    I am missing AREA TOOLS FOR IMAGE MAPS from version 2014.1.1. where can I switch them on please???
    I hove got this panel switched on, but tools are gone.
    Thank you
    Jan

    Switch to Design View (click the small triangle next to the Live View button), those options aren't available in the Live View Editor yet.

Maybe you are looking for

  • CLOB and ADO

    I have a table with a CLOB field that I need to retrieve using ADO 2.5 and OLEDB Provider for Oracle, 'MSDAORA.1'. Everytime, I try to open up the table and get the following error, 'Data Type Is Not Supported'. Thanks.

  • How to print (on paper) expected header and footer while printing Jtable

    Hello, I am printing jtable on paper using dot mtix printer.In header i want to print some name date and number like below Sun Date:12/8/20010 No.12334 | col1 | col2 | | col1 | col2 | footer When i am trying to print header its Font size is very big

  • Scenario to pick the mail with its attachments into XI

    Hi to All, I am creating a scenario in which i have to pick the mail from mail server (gmail) into XI ...and then want to process the attachment of the mail( which is in XML format)...&  put the information of the attachment into the RFC. So i need a

  • Adding links( page links) dynamically under tabs in masterpage SharePoint 2010

    Hi I've site which contain master page where I have Tab1, tab2, tab3. I want to add a link (link to pages) dynamically under aspmenu  tab1,tab2 or tab3 based on requirement without editing the master page. Is there any approach for ex.. if I am addin

  • PostgreSql JDBC from Red Hat Linux works on Windows not on Linux

    I started using ODI from a Windows XP box in development and Beta, and was successfully connecting to and loading data from several different database platforms including a PostgreSql database. I copied the PostgreSql JDBC driver to the ODI drivers f