Help closing frames and disabling frames

hey, i'm making this type of quiz game and i've got the primary game frame with it's game panel. When the player matches two images on this main panel, another frame with a panel is drawn on top of the main game and asks the user a question, if the user gets the right answer i want it to return back to the game and close the quiz frame. I can't use system.exit(0) when the user gets the correct answer because the whole application shuts down. how do i just close this one? Also, i make a new quiz frame object for each match on the game board, the constructor of the quiz frame takes an int as a parameter which represents the game state and thus which question to ask the user.
So that's just a bit of background information, the two questions i have are:
1. How do i close the quiz frame when the user enters the correct answer without closing the entire game application? As it is my Panel within my quiz frame doing the check to see if the users input is correct, i'd like to be able to close the quiz frame down from this panel. so i'm looking for
something like:
this is just some pseudo code to explain what i want to do
if(answerCorrect) {
this.parentFrame.close(); 
}2. How do disable the primary game while the quiz frame is up and displaying a question to the player? I don't want the player to be able to continue playing the game without first entering the correct answer. and only when they answer correct do I wish the main game to become re-enabled.
If the answers are not simple then i'd be happy to read any links/information which would help.
Thanks a heap i really appreciate it :)

Encephalopathic wrote:
but a better and more flexible way to implement this is to allow outside objects pass this array into the QuizPanel object, either by its constructor or by a setter method allowing you to use the same QuizPanel class for different data.Ages ago I downloaded an example from these forums which does just that, and it also randomizes the order or the answers. See below -
import java.awt.BorderLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import javax.swing.BorderFactory;
import javax.swing.ButtonGroup;
import javax.swing.ButtonModel;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.SwingConstants;
public class QuizGUI
  private JPanel mainPanel = new JPanel();
  private Question[] questions =
    new Question("How many months in a year?", "12", new String[]
      "1", "Several", "100", "Heck if I know?"
    new Question("Who was buried in Grant's Tomb?", "Grant", new String[]
      "Washington", "Jefferson", "Lincoln", "Mickey Mouse"
    new Question("What's the air-speed velocity of a fully ladden swallow",
        "African or European?", new String[]
          "100 mi/hr", "25 mi/hr", "50 mi/hr", "-10 mi/hr"
    new Question("What color was Washington's white horse?", "White",
        new String[]
          "Blue", "Brown", "Chartreuse", "Mauve"
  private QuestionGUI[] questionGuis = new QuestionGUI[questions.length];
  public QuizGUI()
    JPanel questionPanel = new JPanel(new GridLayout(0, 1, 0, 10));
    for (int i = 0; i < questionGuis.length; i++)
      questionGuis[i] = new QuestionGUI(questions);
JComponent comp = questionGuis[i].getComponent();
comp.setBorder(BorderFactory.createEtchedBorder());
questionPanel.add(comp);
JButton checkAnswersBtn = new JButton("CheckAnswers");
checkAnswersBtn.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent e)
int score = 0;
for (QuestionGUI quest : questionGuis)
if (quest.isSelectionCorrect())
score++;
else
System.out.println("For the question: \"" + quest.getQuestion().getQuestion() + "\",");
System.out.println("\"" + quest.getSelectedString() + "\" is the wrong answer");
System.out.println("The correct answer is: \"" + quest.getQuestion().getCorrectAnswer() + "\"");
System.out.println("Score: " + score);
JPanel btnPanel = new JPanel();
btnPanel.add(checkAnswersBtn);
int ebGap = 10;
mainPanel.setBorder(BorderFactory.createEmptyBorder(ebGap, ebGap, ebGap, ebGap));
mainPanel.setLayout(new BorderLayout());
mainPanel.add(questionPanel, BorderLayout.CENTER);
mainPanel.add(btnPanel, BorderLayout.SOUTH);
public JComponent getComponent()
return mainPanel;
private static void createAndShowUI()
JFrame frame = new JFrame("Quiz");
frame.getContentPane().add(new QuizGUI().getComponent());
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
public static void main(String[] args)
java.awt.EventQueue.invokeLater(new Runnable()
public void run()
createAndShowUI();
class QuestionGUI
private JPanel mainPanel = new JPanel();
private Question question;
private ButtonGroup buttonGrp = new ButtonGroup();
public QuestionGUI(Question question)
this.question = question;
JPanel radioPanel = new JPanel(new GridLayout(1, 0, 10, 0));
for (String str : question.getAnswers())
JRadioButton rButton = new JRadioButton(str);
rButton.setActionCommand(str);
radioPanel.add(rButton);
buttonGrp.add(rButton);
mainPanel.setLayout(new BorderLayout(10, 10));
mainPanel.add(new JLabel(question.getQuestion(), SwingConstants.LEFT),
BorderLayout.NORTH);
mainPanel.add(radioPanel, BorderLayout.CENTER);
public Question getQuestion()
return question;
public String getSelectedString()
ButtonModel model = buttonGrp.getSelection();
if (model != null)
return model.getActionCommand();
else
return null;
public boolean isSelectionCorrect()
ButtonModel model = buttonGrp.getSelection();
if (model != null)
return question.isCorrect(model.getActionCommand());
return false;
public JComponent getComponent()
return mainPanel;
class Question
private String question;
private String answer;
private List<String> answers = new ArrayList<String>();
public Question(String q, String answer, String[] badAnswers)
question = q;
this.answer = answer;
for (String string : badAnswers)
answers.add(string);
answers.add(answer);
Collections.shuffle(answers);
public String getQuestion()
return question;
public String[] getAnswers()
return answers.toArray(new String[0]);
public String getCorrectAnswer()
return answer;
public boolean isCorrect(String selection)
return answer.equals(selection);

Similar Messages

  • I want to know the exactly when the Kinect gives depth frame and color frame in a period of one frame

    Hi, I'm currently using Kinect for Windows v2 to get a blurry sequence of color frames as well as corresponding depth frames. 
    It seems to me that the depth frame is acquired after the exposure time of the color frame. I am using the sample in the CoordinateMappingBasic to acquire the depth frame and the color frame at the same time. 
    But as i've found out by the aligned depth map with color frame, i think Kinect gives depth frame at the end of the exposure time of color frame. I've tried to obtain timestamps by calling a function iColorFrame->get_relative_time, and for the same number
    the timestamps show that depth frame is acquired prior to color frame, which opposes what i said above.. 
    Is there some way that i can know the exact time the Kinect gives depth frame and color frame in a period of one frame.
    Thank you in advance.

    Depth is generated based on IR information so when you acquire the frame, that is when it was created. Using the Multisource Frame Reader(MSFR) this does a lot under the covers to align the color and depth frame. If you want to do your own synchronizing,
    you can use a polling thread to acquire depth on one and color on the other and do your own mechanism that is similar to MSFR. You will never get Color and Depth to align exactly on a particular timestamp. Since color is its own camera, the only thing
    you can be assured of is when the color frame is acquired, the runtime will give you the closest depth frame that will align to it.
    Carmine Sirignano - MSFT

  • A Q about i-frame and p-frame

    http://www.interactivetvweb.org/tutorial/mhp/javamedia.shtml
    in this tutorial, at the end, it talks about i-frame and p-frame.
    i have an xlet that will need to switch iframe backgrounds very often. this p-frame idea will save the memory.
    so anyone has tried it?
    can provide at least a pseudocode?

    I have known how to display i-frame read from a one-frame-only m2v file, which is the epg.m2v in the code below.
    but after this, i can't even switch to other channels, seems like machine is hanging, have to reboot.
    i am asking what causes this and how to display a p-frame on top of the iframe.
    my code is as below:
    ////////////////////////start***********************/////////////
    scene.setVisible(true);
    g = scene.getGraphics();
    MediaLocator myLocator;
    DripFeedDataSource dripSource=null;
    Player player=null;
    MediaLocator driplocator = new MediaLocator("dripfeed://");
    try
    dripSource = (DripFeedDataSource) Manager.createDataSource(driplocator);
    player = Manager.createPlayer(dripSource);
    catch(Exception e){System.out.println(e.toString());}
    if (player != null){
    player.realize();
    player.prefetch();
    player.start();
    try {
    int size,size1;
    InputStream in = new FileInputStream("epg.m2v");
    InputStream in1 = new FileInputStream("small.m2v");// trying p-frame
    size = in.available();
    size1 = in1.available();// size of p-frame
    byte[] frame = new byte[size];
    byte[] frame1 = new byte[size1];// array of p-frame
    in.read(frame);
    in1.read(frame1);//read p-frame
    in.close();
    in1.close();//close reading
    if (dripSource != null)
    dripSource.feed(frame);
    Thread.sleep(3000);//as spec says don't feed again within 500ms
    dripSource.feed(frame1);//feeding p-frame?
    Thread.sleep(10000);
    player.stop();//can this stop it? coz i can't switch channels any more
    catch (Exception ex) {
    ex.printStackTrace();
    ////////////******************ends******************/////////
    thanks

  • Hotkey for "next frame" and "previous frame",or for next and previous layers

    Hi,
    I'm an animator and I love drawing with Photoshop's brush tools, but to animate I need to "flip" - which is just rapidly switching from one drawing to another, as you would with sheets of actual paper: hunting and clicking on arrows isn't feasible.
    Hotkeys, or assignable hotkeys, for next and previous frames in animation - or, simpler, hotkeys for next and previous layers - would solve this problem completely.  This simple improvement could make Photoshop a viable animation program, competitive with Plastic Animation Paper and Flipbook.
    Is there at least a way I can download an add-on that would do this?
    Thanks,
    Joe

    Do you mean something like: 
    http://help.adobe.com/en_US/photoshop/cs/using/WSF7DD9B60-7866-4f01-915E-DE39F672E418a.htm l
    http://help.adobe.com/en_US/Photoshop/11.0/WSF7DD9B60-7866-4f01-915E-DE39F672E418a.html

  • Uneven color between background text frame and underlying frame fill

    Hi. I'm using InDesign CS3 on Windows XP.
    On my document, the main heading is in a frame with a fill of 'None'. The heading text has a bevel and emboss. The text frame sits on a background A4 frame which is filled with a Pantone spot colour.
    When I print the cover page, the color filling the text frame is slightly different from the background Pantone color, even though the text frame has no color fill.
    When I checked the document before printing in View>Overprint Preview, it appeared to be fine. The PDF also looked fine. In both situations, I could not discern a color difference but it is there in the printed document.
    To provide a color behind the text which matches the fill color of the frame occupying the whole page, what should I do? My gut feel is to select the background frame and the text frame and check the knockout box on the effects panel or something like that.
    I hope I have explained sufficiently clearly the problem I am experiencing.
    Look forward to hearing your suggestions.
    Thanks
    Frank

    http://indesignsecrets.com/eliminating-ydb-yucky-discolored-box-syndrome.php

  • Records alternate between non drop frame and drop frame...

    I am seeing a pattern with Premiere records, that alternate the records from being non drop frame to drop frame.  So one day we recorded 7 segments.  The records ended up coming out like this (without any changes being made between records):
    Segment 1 - non drop frame
    Segment 2 - drop frame
    Segment 3 - non drop frame
    Segment 4 - drop frame
    Segment 5 - non drop frame
    Segment 6 - drop frame
    Segment 7 - non drop frame
    Is this from a hidden setting we can't find, or is this a known bug?

    Hi Angela,
    I'm following up with you from your Tweets on Twitter. As I mentioned there, we have seen similar issues in Premiere Pro CC (7.0.1) but they were fixed. It is possible that they could be rearing up again, so I would encourage you to file a bug report: http://adobe.ly/ReportBug
    Further, I would contact AJA support. They have released new drivers very recently, which may assist your issue.
    You are also free to contact Adobe support. When you are connecting via phone or chat, ask for the video queue: Contact Customer Care
    Thanks,
    Kevin

  • Multi Frame Reader with Infrared Frame and Body Frame

    Hello,
    I have just started developing programs using Kinect. I have just learn some basic from toolkit samples. From Coordinate Mapping sample, there is a Multi Frame Reader that used to help us use many reader at the same time.
    I used multi frame reader on my code, but I cannot run it. I've combining Infrared example and body example code that run both frame inside:
    private void Reader_MultiSourceFrameArrived(object sender, MultiSourceFrameArrivedEventArgs e)
    do I also using coordinateMapper inside my program ?
    Thank You

    Thanks for your reply. I have followed the pattern from coordinateMapping sample and still got some errors haha. I'll checked it again, I am afraid there is outside this method that suppose to be use also from the sample. Also, I'll check the tutorial,
    look awesome. I am not sure about my understanding about coordinateMapping type or variable used. Can you give me some easy understanding about coordinateMapping functionality ?
    Thank you very much
    Adityo Setyonugroho

  • Mixing DVCPRO HD 720p 60 shot at 24 frames and 30 frames (with HVX-200)

    I realize my first mistake was shooting at two different frame rates. So when I edit these two different types of HD footage, I notice the one shot at 24 frames has a slower feel. Whereas the 30 frame clips playback nice and smooth.
    How do I now convert the 24 frame stuff to playback smoothly like the 30 frame footage? (I recored straight to a Firestore 100 in quicktime format. These are DVCPRO HD quicktimes at 59.94)
    Please advise,

    They will never look the same. The reason for shooting 24fps vs 30 fps is to get that different look.
    Now, to get the BEST result in matching the two, put your 24fps clips in Compressor, create a new set of settings that match your clip's settings exactly (same compressor, etc). Chose 30fps and change the retimming option to BEST (Motion Compensated). This uses Shake's optical flow technology and will create a 30fps that will be very smooth. But again, there will still be a difference.

  • Help enabling gnash and disabling flash in Firefox

    This is a "Further woes with..." thread, following on from https://bbs.archlinux.org/viewtopic.php?id=164901. In that episode, I managed to watch a youtube video by installing the gnash plugin and gstreamer0.10-ffmpeg, disabling the flash plugin in Firefox and enabling the gnash one.
    Now, however, I find that gnash is disabled as well as flash. Moreover, if I enable gnash, flash is also enabled. If I disable flash, gnash is also disabled.
    Disclaimer: I use a Firefox binary from Mozilla because I cannot otherwise use my preferred interface language. However, Firefox (/usr/local/bin/firefox which is linked to the binary in /usr/local/lib/firefox) has no problems using Arch plugins installed at /usr/lib/mozilla/plugins. I also have icedtea, kpartsplugin and djview (though I forget why I have the last).
    The plugins are definitely there according to both pacman and ls /usr/lib/mozilla/plugins.
    Does anybody have any idea why Firefox insists it must be either flash and gnash or no ash at all? I realise I could just uninstall flash but I'm reluctant to do this unless I really have to as it is handy to be able to enable it quickly if necessary. I just want to keep it disabled so Firefox etc. picks up gnash. (Actually, Firefox should default to gnash given my settings for mimetypes in preferences but that doesn't seem to be effective.)

    That is interesting, flahsplugin doesn't work at all?  That is strange, and not the first time I have heard that.  It makes me wonder then why you want to keep flashplugin installed on your computer if it doesn't do much.
    If you are willing to open a different browser to watch youtube videos, chromium seems to handle these plugins quite well.  I actually have, ATM for testing here, flashplugin, pepper flash, and gnash.  I was able to enable each one by one, and it seemed to be doing what I wanted it to do. 
    Besides that, I actually keep pepper flash set up for chromium all the time.  I actually find it to be pretty superior to flashplugin, though it doesn't change my opinion that the world needs to move away from flash content more quickly.  It is in the AUR and is very easy to install.  As long as you don't have anything set in /etc/chromium/default, the install script will set eveything up automatically for you.  If you do have something there (I keep the cache in tmpfs with --disk-cache-dir=/tmp), then you just need to edit the file and clean it up a little.  It gets the quoting all wonky.

  • FCP 7.2 : colors in canvas change between paused frames and playing frames

    To all the FCP-Experts...
    Just before this project I switched from FCP 6 to 7 (clean install) and started using ProRes 422 HQ instead of Blackmagic Uncompressed 10bit.
    To my surprise, the preview-picture in the canvas is never the same when playback is paused compared to a running playback. On an external monitor, this effect does not occur. Briefly, the colors when paused are much more saturated.
    There are some other minor differences concerning filters when playing back or pausing the image, which I can live with, but the color-difference is most annoying.
    Any help greatly appreciated.

    I don't think trimming back does anything.  I've tried it once and also it's not in the media itself.  It is strange though that it appears this way in QT player and then like a strange bump or hit in the video when played in another app like MPEG streamclip.  Very weird!  I'm beginning to think there is just some bugginess with FCP 7.0.3 and Lion 10.7.3.  I should add that I get pretty consistent problems with crashing on my system also.  It's periodic but definitely not the most stable.  Would be great if Apple was still developing this version of FCP but I know that's just not the reality anymore.  Thanks for all your time in looking at the issue with me.
    Best,
    JD

  • HELP: CLOSING MAIL AND GOOGLE MAPS

    Dear guys,
    My 3gs suffer from battery drain caused by background 3g traffic data activity.
    Even if I have no background running app, my phone keeps sending receiving huge mb of data.
    I've downloaded from appstore an app, system lite, which has revealed that, between runnin apps, there are mail and google maps. Maybe this colud cause traffic data.
    How can I close them? Obviously, double pressing home button doesn't show these apps running....
    Thanks in advance.
    Daniele

    Dan70 wrote:
    How can I close them? Obviously, double pressing home button doesn't show these apps running....
    If double pressing the home button does not show the programs in the bar, they are not running. There is no possible way for them to be running in the background unless they are showing the quick switching bar.
    What is showing in this bar when you double tap the home button?
    Have you tried the basics from the manual or reset, restart, and restore?

  • T3i sensor size vs. full frame and how does that effect lens measurements?

    I am new to both photography and the T3i camera. I have been reading Jeff Revell's book "Canon EOS Rebel T3i / 600D: From Snapshots to Great Shots". In chapter two he talks about "Lenses and Focal Lengths". In discussing wide-angle lenses he says
    "As for which lenses would be considered wide angle, anything 35mm or smaller could be considered as wide."
    Latter he discusses normal lenses and says
    "The normal lens for full-frame and 35mm cameras is the 50mm lens, but for the T3i it is more in the neighborhood of a 35mm lens."
    I understand that there is a 1 / 1.6 ratio between the T3i and a Full Frame camera. In the first quote does the 35mm refer to the T3i measurement or a full frame measurement?
    Is there a standard nomenclature to indicate if you are specifying a "full frame" value verses the T3i value? If so, what is it?
    When I look at one of my lenses, say the 18-55mm lens, is this the T3i measurement or the standard full frame?
    Thanks in advance for your assistance.
    --Jesse
    P.S.  I could not find a publisher’s forum for this book or I would have asked the question there.

    Jesse-T3i wrote:
    "As for which lenses would be considered wide angle, anything 35mm or smaller could be considered as wide."
    In the first quote does the 35mm refer to the T3i measurement or a full frame measurement?
    Is there a standard nomenclature to indicate if you are specifying a "full frame" value verses the T3i value? If so, what is it?
    When I look at one of my lenses, say the 18-55mm lens, is this the T3i measurement or the standard full frame?
    The fast answers are:
    When he mentions the 35mm as the basis for determining what's "wide" he is referring to the APS-C crop-frame size sensor.
    There is no nomenclature to indicate if you are "full frame" vs. "crop frame" on a lens because all lenses are reported in true focal lengths.  There is a nomenclature to indicate if the lens was designed to only project an image circle onto the sensor which is large enough for "crop frame" ... which is what the "EF-S" lens is.  If the lens is for "full frame" (which also works on all crop-frame) then it will have the designation "EF" for most lenses, but Canon also has a few specialty lenses such as the "TS-E" (tilt shift) and "MP-E" (macro photo) lenses which also provide full-frame sensor coverage.  Incidentally... this is just Canon's way of tagging a lens... Nikon uses the terms "FX" and "DX" (for full frame and crop frame respectively).  Everyone has their own tag.  Just remember that focal lengths reported are true (well... there's a TINY bit of round-off allowed) and ignore the sensor size.
    Here's the background which may help you understand why this is.
    The "normal" focal length is based on the human eye, and to understand it, it's easier to think in terms of "angle of view" rather than "focal length."
    If you sit and stare straight ahead without moving your eyes or head to "look around", there is an area of vision that the average person can see (and it does vary), but the "angle of view" for that area is about 40 degrees (horizontally). Of course our vision doesn't present our brain with a nice little rectangular image... it fades and is irregular, but it's generally accepted that the angle of view covers about 40 degrees.
    The LENS that provides 40 degree angle of view coverage on a "full frame" camera turns out to be a 50mm lens.  Images taken with such a lens will seem neither stretched out nor compressed... they'll seem "normal" to your brain.  Also, if you can see an object without having to look around to take in the view, then your camera can "see" it with that lens.  
    A "full frame" camera is one which has a sensor size which is approximately the same as a single frame of 35mm film.  The dimensions are roughly 36mm x 24mm.  
    There are many different crop frame sizes, but for DSLR cameras, the most popular (by far) is the APS-C size.  This means the sensor is roughly the same size as a single frame for the "Advanced Photo System - Classic" film.   You can think of this as being roughly 21mm x 14mm (although it varies by a just a few millimeters -- on your camera it's really 22.3 x 14.9mm).
    If you were to use a movie projector and movie screen and you projected an image so that it fit perfectly on a 12' x 8' screen and called that "full frame", then a "crop frame" would be derived by shriking the movie screen down to about 8' wide by about 5-1/3' tall but (and here's the key) without doing ANYTHING to the movie projector.  Essentially that means you're projecting an image intended to fit ona 12x8' screen... but the real screen is smaller.  What happens to the part of the image that doesn't fit on the screen?    It just spills off the sides and is lost.  That is EXACTLY what happens inside a crop-frame camera.
    Canon EOS "EF" lenses are designed to project an image large enough to fill a full-frame sensor ... so when used on a crop-frame camera some of that image just spills off the sides.   This means that if your lens was providing a 40 degree angle of view (measured horizontally) then the crop-frame is only capturing the 26 degrees in the middle of it.  If you want a 40 degree angle of view again... you'll need to change lenses.
    And this is where your author suggests a 35mm lens is "normal" for a camera with an APS-C body.  The math actually works out in the neighborhood of a 31mm lens, but nobody actually makes a 31mm lens... and a 35mm focal length (commonly available) is pretty close.  Also 28mm lenses are commonly available and are ALSO pretty close.  It's my personal opinion that 28mm is probably a bit more normal than 35mm, but that's because as an avid amateur astronomer, I am fairly used to looking through Plossl design eyepieces which provide a 50 degree apparent angle of view and my eye actually can see the edges of the frame, but if I go a bit wider... I can no longer see the edges of the field without "looking around" (regardless... 40 degrees seems to be the established norm and THAT is the value that everything is based on.)
    For purposes of buying lenses, the focal lengths are NOT converted or adjusted in any way.  For example, Canon makes "EF-S" lenses designed specifically to work with their crop-frame bodies.  So when the kit lens that comes with the camera says it is a zoom with an 18-55mm focal length range... it really is 18-55mm regardless of sensor size.   (Canon isn't multiplying or dividing focal lengths and putting a different value on the box just because it's intended for a crop-sensor camera.)
    Hope this helps.
    Regards,
    Tim
    Tim Campbell
    5D II, 5D III, 60Da

  • Overview and package frames not present in index.html

    I launch the Javadoc tool with:
    javadoc -sourcepath ..\src\ -d %DIR_JAVADOCS% -author -package -use -version %SOURCES% -classpath %CP%
    (where the %XXX% are environment variables properly set).
    The problem is that the packages frame and overview frame doesnt appear in the resultant index.html
    Also, in thread
    http://forum.java.sun.com/thread.jsp?forum=41&thread=72781
    Doug Kramer says:
    "If you supply package names on the command line, links to their
    docs should all appear automatically on the Overview page,
    which is named overview-summary.html. The -overview flag
    merely allows you to add a description to that page."
    So, what I have to do to solve this??

    This is one of the most commonly-asked questions
    I'll bet you are passing in only one package.
    Here's the blurb:
      The Javadoc tool will generate either two or three HTML frames, as shown in the  
      figure below. It creates the minimum necessary number of frames by omitting the
      list of packages if there is only one package (or no packages). That is, when you 
      pass a single package name or source files (*.java) belonging to a single package
      as arguments into the javadoc command, it will create only one frame (C) in the 
      left-hand column -- the list of classes. When you pass into javadoc two or more
      package names, it creates a third frame (P) listing all packages, as well as an
      overview page (Detail).
                  |C| Detail |                  |P| Detail |
                  | |        |                  | |        |
                  | |        |                  |-|        |
                  | |        |                  |C|        |
                  | |        |                  | |        |
                  | |        |                  | |        |
                 javadoc *.java           javadoc java.lang java.awtSource:
    http://java.sun.com/j2se/1.4.2/docs/tooldocs/solaris/javadoc.html#htmlframes

  • Working with frames and applets

    Hi, I am writing an applet that recieves information from a sever. before the applet loads I display a frame that allows the user to select the information that is transfered across the net.
    I block the applet from finishing until the okay button is clicked on the frame. However if I don't add my frame to the applet I can't manipulate the frame, and the frame doesn't recognize any mouse events
    When i do add the frame to the applet, the checkboxes work and the button toggles, but the click doesn't do anything.
    Finally the program works while using the applet viewer but it doesn't work across the net. Any information any one has would be greatly appreciated.

    here is the code of the frame that doesn't work
    import java.awt.*;
    import java.awt.event.*;
    public class channelSelect extends Frame implements ActionListener
    {/*This class alows the user to pick from a number of channels to be transfered
    across an internet connection*/
    private int channels = 8; //the total number of channels
    private Checkbox[] checkbox = new Checkbox[channels]; //an array of checkboxes
    private Button button1 = new Button(); //the button to signify the user has choosen the channels
    private int[] c = new int[channels]; //an array to determine which checkboxes were checked
    private boolean done = false; //a flag to tell the base class if the user is finished
    public channelSelect()
    try
    jbInit();
    catch(Exception e)
    e.printStackTrace();
    public int[] obtainChannels()
    {//returns the array of choosen channels
    return c;
    public int isDone()
    {//returns if the user is finsihed
    if(done)
    return 1;
    else
    return 0;
    private void jbInit() throws Exception
    {//sets the layout for the frame
    this.setLayout(null);
    this.setTitle("Select Channels");
    for(int j = 0; j < channels; j++)
    checkbox[j] = new Checkbox();
    checkbox[0].setBackground(new java.awt.Color(0, 200, 250));
    checkbox[0].setBounds(new Rectangle(64, 55, 198, 20));
    checkbox[0].setLabel("sinwave");
    checkbox[1].setBackground(new java.awt.Color(0, 200, 250));
    checkbox[1].setBounds(new Rectangle(64, 133, 198, 20));
    checkbox[1].setLabel("squarewave");
    checkbox[2].setBackground(new java.awt.Color(0, 200, 250));
    checkbox[2].setBounds(new Rectangle(64, 211, 142, 30));
    checkbox[2].setLabel("coolant temp");
    checkbox[3].setBackground(new java.awt.Color(0, 200, 250));
    checkbox[3].setBounds(new Rectangle(64, 289, 198, 20));
    checkbox[3].setLabel("No signal1");
    checkbox[4].setBackground(new java.awt.Color(0, 200, 250));
    checkbox[4].setBounds(new Rectangle(356, 55, 198, 20));
    checkbox[4].setLabel("No signal2");
    checkbox[5].setBackground(new java.awt.Color(0, 200, 250));
    checkbox[5].setBounds(new Rectangle(356, 133, 198, 20));
    checkbox[5].setLabel("No signal3");
    checkbox[6].setBackground(new java.awt.Color(0, 200, 250));
    checkbox[6].setBounds(new Rectangle(356, 211, 198, 20));
    checkbox[6].setLabel("No signal4");
    checkbox[7].setBackground(new java.awt.Color(0, 200, 250));
    checkbox[7].setBounds(new Rectangle(356, 289, 198, 20));
    checkbox[7].setLabel("No signal5");
    this.setBackground(new java.awt.Color(0, 200, 250));
    button1.setBounds(new Rectangle(235, 477, 98, 30));
    button1.setLabel("OK");
    button1.addActionListener(this);//new java.awt.event.ActionListener()
    public void actionPerformed(ActionEvent e)
    button1_actionPerformed(e);
    */ this.add(checkbox[0], null);
    this.add(checkbox[5], null);
    this.add(checkbox[6], null);
    this.add(checkbox[1], null);
    this.add(checkbox[7], null);
    this.add(checkbox[2], null);
    this.add(checkbox[3], null);
    this.add(checkbox[4], null);
    this.add(button1, null);
    this.setSize(610,527);
    this.setVisible(true);
    this.toFront();
    public void actionPerformed(ActionEvent e)
    {//populates the array of choosen channels
    Object source = e.getSource();
    if(source == button1)
    for(int i = 0; i < channels; i++)
    if(checkbox.getState())
    c[i] = 1;
    else
    c[i] = 0;
    done = true;
    and this is where i instantiate it and call some of it's methods.
    /* Setup channel selections */
    channel_select = new channelSelect();
    while(channel_select.isDone() == 0)
    { //wait for the channel selection to occur
    channels = channel_select.obtainChannels();
    channel_select.dispose();
    channel_select = null;
    setChannels();

  • Servlet Handling(Moving of Hyperlink from Left frame to Top Frame)

    hi
    in the Servlet page (Introduction, Check, reports etc.) should be moved to a top frame instead of a left frame.
    Regards
    Atul

    You should read some basic books about the Servlet like core Java Servlet etc. your second question is not understandable what is meaning by u that left frame and top frame.

Maybe you are looking for

  • I forgot my icloud email and my password pls help me ineed my phone fix

    i forgot my icloud email and password what can i do ? pls help me

  • Format of PI messageID in mapping

    Hi, in a message-mapping (inbound messages from external partners), I have a UDF where I read the PI messageID from runtime as described in differnt posts here. The messageId is mapped in an IDoc text field. Unfortunately the format of the messageID

  • SAP IS-HER implementation?

    Hi Experts, I am a new entrant in this community. Could you pls. guide me: Does the SAP IS-HER need any of the SAP modules implemented in the university or can be implemented as an standalone application? If yes, could you pls. specify which are the

  • Drop temp tbs without end

    Hi, Database is Oracle 8.1.7.4 about Windows NT. I have a temporary tablespace with a datafile wich take more than 2Go. I would like to create another temp tablespace locally managed with a tempfile to replace the first. When I drop the old temp tabl

  • How do I export 16:9 to 4:3

    Hi guys, I've edited an HD movie and need to project it using a 4:3 projector. I'm looking to keep the 16:9 ratio with bars on top and bottom (I believe this is called letterbox). The Sequence is 1440 x 1080 Apple Intermediate Codec I thought I figur