Full screen mode, packages and the like

I am trying to keep my code neat byt putting various related functions into clases with their associated methods. All is working sort of okay until I want to carry out a drawimage to the graphics device g . g is in one class and the drawimage method is in another. How do I pass the graphics device to the image class and assocaited method?? Help
I am using netbeans and each class is in the same package. Any help on this is appreciated.
* Main.java
* Created on 10 August 2005, 09:19
* To change this template, choose Tools | Options and locate the template under
* the Source Creation and Management node. Right-click the template and choose
* Open. You can then make changes to the template in the Source Editor.
package dna;
import java.awt.*;
import javax.swing.*;
* @author damian creedon
public class PerfectDNA extends JFrame {
/** Creates a new instance of Main */
public PerfectDNA() {
* @param args the command line arguments
public static void main(String[] args) {
DisplayMode displayMode;
displayMode = new DisplayMode(1024, 768, 32, DisplayMode.REFRESH_RATE_UNKNOWN);
PerfectDNA eden = new PerfectDNA();
eden.run(displayMode);
private static final long DEMO_TIME = 10000;
public void run(DisplayMode displayMode){
setBackground(Color.blue);
setForeground(Color.white);
setFont(new Font("Dialog", 0, 24));
ScreenManager screen = new ScreenManager();
try {
screen.setFullScreen(displayMode, this);
try {
Thread.sleep(DEMO_TIME);
catch (InterruptedException ex) { }
finally {
screen.restoreScreen();
ImageManager images = new ImageManager();
images.loadImages();
images.drawImages();
public void init(){
public void paint(Graphics g) {
public void repaint(Graphics g){
* ScreenManager.java
* Created on 10 August 2005, 10:52
* To change this template, choose Tools | Options and locate the template under
* the Source Creation and Management node. Right-click the template and choose
* Open. You can then make changes to the template in the Source Editor.
package dna;
import java.awt.*;
import javax.swing.*;
* @author damian creedon
public class ScreenManager {
public GraphicsDevice device;
/** Creates a new instance of ScreenManager */
public ScreenManager() {
GraphicsEnvironment environment = GraphicsEnvironment.getLocalGraphicsEnvironment();
device = environment.getDefaultScreenDevice();
public void setFullScreen(DisplayMode displayMode,JFrame window){
window.setUndecorated(true);
window.setResizable(false);
device.setFullScreenWindow(window);
if (displayMode != null &&
device.isDisplayChangeSupported())
try {
device.setDisplayMode(displayMode);
catch (IllegalArgumentException ex) {
// ignore - illegal mode for this device
public Window getFullScreenWindow() {
return device.getFullScreenWindow();
public void restoreScreen() {
Window window = device.getFullScreenWindow();
if (window != null) {
window.dispose();
device.setFullScreenWindow(null);
* ImageManager.java
* Created on 10 August 2005, 13:49
* To change this template, choose Tools | Options and locate the template under
* the Source Creation and Management node. Right-click the template and choose
* Open. You can then make changes to the template in the Source Editor.
package dna;
import java.awt.*;
import javax.swing.*;
* @author damian creedon
public class ImageManager {
private Image bgImage;
private Image opaqueImage;
private boolean imagesLoaded;
/** Creates a new instance of ImageManager */
public ImageManager() {
public void loadImages() {
bgImage = loadImage("images/background.jpg");
opaqueImage = loadImage("images/opaque.png");
imagesLoaded = true;
private Image loadImage(String fileName) {
return new ImageIcon(fileName).getImage();
public void drawImages() {
g.drawImage(bgImage, 0, 0);
}

Hiya,
I tried this
public void paint(Graphics g) {
drawImages(g);
and get this error
Compiling 2 source files to C:\My Projects\java\My Projects\dna\build\classes
C:\My Projects\java\My Projects\dna\src\dna\PerfectDNA.java:66: drawImages(java.awt.Graphics) in dna.ImageManager cannot be applied to ()
images.drawImages();
C:\My Projects\java\My Projects\dna\src\dna\PerfectDNA.java:77: cannot find symbol
symbol : method drawImages(java.awt.Graphics)
location: class dna.PerfectDNA
drawImages(g);
2 errors
BUILD FAILED (total time: 2 seconds)
The method called is
public void drawImages(Graphics g) {
g.drawImage(bgImage, 0, 0,null);
Further help would be appreciated.

Similar Messages

  • I pressed something, and it made the browser go into a "full screen" mode, how do I change it back? And also, something happened and made my FireFox text on all internet pages smaller, is there any way I could change this setting?

    I had pressed a button on my keyboard which made my text and pictures and the whole page smaller in size, can I change that? And how could I change my browser out of "Full Screen" mode?

    You can press F10 to toggle (View) Full Screen mode.
    Reset the page zoom on pages that cause problems: <b>View > Zoom > Reset</b> (Ctrl+0 (zero); Cmd+0 on Mac)
    * http://kb.mozillazine.org/Zoom_text_of_web_pages

  • When safari is in full screen mode and I move the mouse to the top of the screen to bring up the menu bar and the bookmark bar, it does nothing.  Is anyone else having this issue?

    When safari is in full screen mode and I move the mouse to the top of the screen to bring up the menu bar and the bookmark bar, it does nothing.  Is anyone else having this issue?
    Thanks

    I just tested that since I hardly ever use full screen mode, this was the first time since I upgraded to Mountain Lion, and it worked fine for me.
    Try shutting Safari down and see if that changes anything.
    If that doesn't change anything, try shutting down and then rebooting.
    Allan

  • Full screen mode and the tab key: how to ignore invisible UI elements

    Hi there,
    When Mozilla is in windowed mode, the tab key moves between the page content, which is great. However, when it reaches the end of the page, it then goes to the tab bar, the address bar, the search bar, something I can't figure out, and only then back to the page content.
    When Mozilla is in full screen mode, it does the same thing, even though none of the UI elements (such as the menu bar et al) are actually visible.
    So my question is this: is there a way to disable tab from going to the UI elements when FF is in full screen mode? If not, is there a way to disable this entirely?

    You have to change the cursor focus.
    What I usually do for PDF pages/tabs, is click in the URL/location bar, then F11.<br />
    For Flash, if you click on the page outside of the video area/box, F11 should work.

  • In Lion, Safari pages hang in full screen mode.  If you exit full screen mode, the next page you intended to view appears.

    In Lion, Safari pages hang in full screen mode.  If you exit full screen mode, the next page you intended to view appears.
    This happens nearly every time I use Safari.  I will be clicking on links, when it appears to hang.  By exiting full screen mode, upon minimizing the next page I was intending to view appears.  This does not happen on all websites, but many that I visit.

    Here's a stupid question, but I'm sure I'm not the only one - how exactly DO you minimize the safari fullscreen mode??  I keep reading about orange or yellow tabs which don't exist, at least on my 27 iMac. Control m doesn't work either. I wish Apple would have a basic 3 or 4 page instruction manual on this. Unless there are major bugs still.  By the way, this is only one of many problems I'm having with Safari.  Occasionally the tool bar just dissappears. And, don't get me started about how the dock in Lion simply stopped accepting some icons, including Firefox. None of these problems happened when I first installed Lion. Each upgrade seems to have more bugs, not less.

  • Firefox page stop refreshing(drawing) when the flash plugin exit full screen mode.

    While watching youtube video from youtube.com in full screen mode (this is flash player full screen mode, not browser full screen mode), if you exit the full screen mode, some times the original page when the full screen was started from would stop drawing, not responding to the mouse click in the page area. The page will go back to normal if you click and drag the firefox browser title bar or just resize the browser window.
    I initially found this issue with our company's browser plugin product when testing on Firefox 4. Then I went on trying the same scenario with youtube flash player, it is the same behavior.
    It is not difficult to reproduce, if exiting full screen works fine, move the browser window a little bit and try it again. I can reproduce this once every 5 - 10 times. It is very annoying.
    The same test case works on Safari, Google Chrome without any problem. Please fix this!

    Try to disable the hardware acceleration in the Flash Player.
    See:
    * https://support.mozilla.com/kb/Cannot+view+full+screen+Flash+videos
    * http://www.youtube.com/swf_test.html (right-click the player: Settings)
    Flash "Display settings" window:
    * http://www.macromedia.com/support/documentation/en/flashplayer/help/help01.html

  • Full Screen Mode(s) & Show/Hide Toolbars and Palettes???

    I use PS7 but am going to train some folks on PS Elements 8. I cannot find PSE8's equivalent of the F key "Full Screen Modes" command or the Tab key "Show/Hide Toolbars and Palettes". PLEASE tell me there IS some way to do these two things in PSE8!!!!!
    - Brian

    Uh, yes, don't I feel dumb. Maybe since I always seem to use the Tab key in conjunction with the F key command for Full Screen Modes I didn't realize the Tab key didn't work in PSE8 just fine. At least that's my newbie excuse, and I'm sticking with it. Thanks! Next time I promise I'll TRY something before I ask about it. (I'm kinda stressing this training I need to do soon.)
    Now HOW to use the keyboard shortcuts for Full Screen mode??? Anyone???

  • Full screen mode AND zoom possible?

    Hi there,
    it seems to me that the full screen mode is only displaying whole pages, which is on a small screen difficult to deal with. Would be nice if the full screen mode would accept the zoom factor (e.g. 200%) which I used for normal view, when going into full screen view.
    Thanks for any hints if I missed something.

    You could use the system zoom feature. Go to system preferences then universal access and make sure the "Zoom:" is clicked to on. Then while in full page mode you can zoom the screen by pressing command option = to zoom in and command option - to zoom out.
    The resolution isn't as good but it is very readable.

  • How I can allow always and for all sites full-screen mode?

    How I can allow always and for all sites full-screen mode?
    And I want choose anywhere option "never show notification about full-screen mode" (screenshot attached)
    RUS
    Как я могу всегда разрешить и для всех сайтов полноэкранный режим?
    И я хочу выбрать где-нибудь опцию "никогда не показывать уведомление о полноэкранном режиме" (скриншот приложен)

    There is a preference setting on the <b>about:config</b> page that is meant for developers and testers to make this possible, but it is not meant for normal users.
    *full-screen-api.approval-required = false
    You can open the <b>about:config</b> page via the location/address bar.
    You can accept the warning and click "I'll be careful" to continue.
    *http://kb.mozillazine.org/about:config

  • Why is one of my dual screen grayed out when in full screen mode on the other?

    I just added a second monitor for an extended desktop. When I go into full screen mode on one the other greys out. Is there a way to fix this or am i stuck? thanks!!!

    No that is just the way it is. Apple still can't figure out how to do full screen apps. When you put any app into full screen mode it make a second desktop to run that app on. When that happen the second monitor, in a dual monitor setup, has nothing to do as everything is on the main monitor in different desktops.
    You'll have to just expand the app to the max window size instead of going into full screen. Then you can drag/place different apps on each monitor.

  • Lightroom 5 0 Bug in Full Screen Mode and Grid View

    In full screen mode while using the grid view in the second window the photo you have selected may or may not be the photo you see in the main window.
    demo video
    http://youtu.be/EnmIU1rZlts

    I can't reproduce this on 5.2RC on Mac - can you still reproduce it on Windows?
    (BTW, the best place for bug reports is Official Feature Request/Bug Report Forum as they're likely to get lost in the chatter here)

  • IPhoto 11: How to view "all photos" while in full screen mode

    In iPhoto, when it's not in full screen mode, if you click photos in the sidebar (under Library), you get a nice view of ALL your photos, and you have the option to sort them by event. When you go from this view straight to full screen mode, it stays this way, which in my case is particularly useful since I like to move photos around from event to event. However, staying in full screen mode, as soon as I click an any other of the menus at the bottom (events, faces, places, albums, projects), I cannot find anyway to get back to the "all photos" view, other than to take it OUT of full screen mode, click on "Photos" in the side bar, and then go back to full screen mode. Either I am missing something that is glaringly obvious, or this is a rather annoying oversight by Apple. It seems like it would be natural to have "Photos" be one of the options along with Events, Faces, Places, Albums and Projects in full screen mode. Right now the only work around I've been able to come up with (aside from going back and forth with fullscreen mode), and to hit "command F" while in full screen mode, and then type "i", which will give me what I am want only because all my photos start with "i". Not a very elegant work around, I know, but perhaps I am missing something very obvious.
    Thanks for any advice!
    James

    In case my description isn't clear, here is a screenshot of exactly the view in full screen mode I am talking about  that I can't seem to return to once I leave it, other than to go back to non full screen mode or use the search trick.

  • Full screen mode

    I would like to run firefox 31.0 in full screen mode. Getting into full screen is no problem. How do you get out of it without using the keyboard shortcut? I understand you can put the icon on the toolbar OR the add-on bar, but i would prefer it in both locations. Is this possible? I really prefer to have it at the bottom of the page on the add on bar, but then it won't show when you want to exit.
    I don't suppose it would be possible to customize the right click menu.... that would be the ultimate in customizing.

    If you are in full screen mode then hover the mouse to the top of the screen to make the Navigation Toolbar and Tab bar appear.
    Click the Maximize button (top right corner of the Navigation Toolbar) to leave full screen mode or right-click empty space on a toolbar and choose "Exit Full Screen Mode" or press the F11 key.

  • How do i get firefox to not be in full screen mode without a mouse or keyboard?

    for some reason Firefox switched to full screen mode and i can't get out of it. I'm using Firefox on a tablet PC running windows 8.1 so using F11 or a mouse is not an option. at least i assume it's full screen mode. i can't see my bookmarks bar, my address bar, or even the windows task menu at the bottom of the screen, where my virtual keyboard is located at. i can get to the settings menu (i have Firefox set to start on a new page) but i can't find bookmark bar, address bar, or full screen settings there. I tried using IE11 to uninstall Firefox and reinstall it but it kept the setting. A "turn off full screen mode" button in the settings would be super helpful or a "force show address bar" button.

    By the way, if Firefox is ''stuck'' in full screen mode, I think you could clear that by removing the settings file which stores window dimensions. Here's how:
    Open your current Firefox settings (AKA Firefox profile) folder using either
    * "3-bar" menu button > "?" button > Troubleshooting Information
    * (menu bar) Help > Troubleshooting Information
    * type or paste about:support in the address bar and press Enter
    In the first table on the page, click the "Show Folder" button. This should launch a new window listing various files and folders in Windows Explorer.
    ''If none of those is available: Use the Run command (or maybe the charms bar search box), type or paste the following and tap Run/Search or Enter on the virtual keyboard:''
    %APPDATA%\Mozilla\Firefox\Profiles
    ''Then double-tap into your most recently updated semi-randomly-named profile folder.''
    Leaving that window open, switch back to Firefox and Exit, either:
    * "3-bar" menu button > "power" button
    * (menu bar) File > Exit
    ''If neither of those is available, try using one of the standard Windows ways of exiting a program.''
    Pause while Firefox finishes its cleanup, then rename '''xulstore.json''' to something like xulstore.old. If you see a file named localstore.rdf, rename that one to localstore.old.
    Start Firefox back up again. Do windows display normally again?

  • Full screen mode in Mountain Lion

    Hello everybody!
    I am experiencing certain problems with full screen mode in mountain lion 10.8.2 freshly installed (not upgraded over Lion or ML 10.8.x) on Macbook Pro 13 mid 2010 model. Whenever i open an application which supports full screen mode, it opens on my desktop so I have to enter into full screen mode. When I quit the application and reopen it, it again opens on my desktop then I have to again enter into full screen mode. What I want is that all apps open in full screen mode if they support like, calendar, mail, safari, notes, reeder, itunes, app store and so on.
    What could be the problem that is preventing my apps to start automatically in full screen mode?
    I would appreciate any kind of help from anyone of you.
    Thanks.

    Go to System Preferences > General and untick Close windows when quitting an application

Maybe you are looking for

  • My BB 8900 keyboard problem

    Good Morning, Im having a problem with keyboard, some letters ar not properly operating like the backspace and the key pad for letter K and the power on key. I dont remember any circumstances that i drop it or mis handled my BB, just 1 night it start

  • Dynamic End Jump Script

    I'm new to scripting in DVD studio Pro. Lately I have been attempting to create dynamic buttons to return to the same menu, and the next available button. The below link is the tutorial that I have been following. The script worked perfectly when I o

  • How to mp3files, from iTunes, to iDisk public folder etc.

    Greetings: I need to upload unedited sound files to my .mac iDisk public folder for download from the sound editors. How do I do this from iTunes. When I drag & drop, it goes through the motions of copying the files from iTunes, to the iDisk folder,

  • How set location for tooltip text ??

    hi , i want to set tooltip location myself to a button . for this i override methods are 1. public String getToolTipText(MouseEvent e)2 public Point getToolTipLocation(MouseEvent e)here is code... where i have to change to set location for tooltip *

  • How many i devices can be on one appleid?

    I'd like to have my iPad and iPhone on the same AppleID.  When I try to add the second device it says "that Apple ID is already in use".  Any ideas?  Thank you!