Difference Frame and JFrame

can somebody help me to explain the difference between Frame and JFrame OR maybe you can put a link of (java.sun.com) so that i may understand it!
thanx!

Start here,
[url http://java.sun.com/docs/books/tutorial/uiswing/start/swingIntro.html#awt]How Are Swing Components Different from AWT Components?
continue with [url http://java.sun.com/docs/books/tutorial/uiswing/converting/index.html]Converting to Swing

Similar Messages

  • Problem with ScrollPane and JFrame Size

    Hi,
    The code is workin but after change the size of frame it works CORRECTLY.Please help me why this frame is small an scrollpane doesn't show at the beginning.
    Here is the code:
    import java.awt.*;
    public class canvasExp extends Canvas
         private static final long serialVersionUID = 1L;
         ImageLoader map=new ImageLoader();
        Image img = map.GetImg();
        int h, w;               // the height and width of this canvas
         public void update(Graphics g)
            paint(g);
        public void paint(Graphics g)
                if(img != null)
                     h = getSize().height;
                     System.out.println("h:"+h);
                      w = getSize().width;
                      System.out.println("w:"+w);
                      g.drawRect(0,0, w-1, h-1);     // Draw border
                  //  System.out.println("Size= "+this.getSize());
                     g.drawImage(img, 0,0,this.getWidth(),this.getHeight(), this);
                    int width = img.getWidth(this);
                    //System.out.println("W: "+width);
                    int height = img.getHeight(this);
                    //System.out.println("H: "+height);
                    if(width != -1 && width != getWidth())
                        setSize(width, getHeight());
                    if(height != -1 && height != getHeight())
                        setSize(getWidth(), height);
    }I create frame here...
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.JFrame;
    public class frame extends JFrame implements MouseMotionListener,MouseListener
         private static final long serialVersionUID = 1L;
        private ScrollPane scrollPane;
        private int dragStartX;
        private int dragStartY;
        private int lastX;
        private int lastY;
        int cordX;
        int cordY;
        canvasExp canvas;
        public frame()
            super("test");
            canvas = new canvasExp();
            canvas.addMouseListener(this);
            canvas.addMouseMotionListener(this);
            scrollPane = new ScrollPane();
            scrollPane.setEnabled(true);
            scrollPane.add(canvas);
            add(scrollPane);
            setSize(300,300);
            pack();
            setVisible(true);
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        public void mousePressed(MouseEvent e)
            dragStartX = e.getX();
            dragStartY = e.getY();
            lastX = getX();
            lastY = getY();
        public void mouseReleased(MouseEvent mouseevent)
        public void mouseClicked(MouseEvent e)
            cordX = e.getX();
            cordY = e.getY();
            System.out.println((new StringBuilder()).append(cordX).append(",").append(cordY).toString());
        public void mouseEntered(MouseEvent mouseevent)
        public void mouseExited(MouseEvent mouseevent)
        public void mouseMoved(MouseEvent mouseevent)
        public void mouseDragged(MouseEvent e)
            if(e.getX() != lastX || e.getY() != lastY)
                Point p = scrollPane.getScrollPosition();
                p.translate(dragStartX - e.getX(), dragStartY - e.getY());
                scrollPane.setScrollPosition(p);
    }...and call here
    public class main {
         public main(){}
         public static void main (String args[])
             frame f = new frame();
    }There is something I couldn't see here.By the way ImageLoader is workin I get the image.
    Thank you for your help,please answer me....

    I'm not going to even attempt to resolve the problem posted. There are other problems with your code that should take priority.
    -- class names by convention start with a capital letter.
    -- don't use the name of a common class from the standard API for your custom class, not even with a difference of case. It'll come back to bite you.
    -- don't mix awt and Swing components in the same GUI. Change your class that extends Canvas to extend JPanel instead, and override paintComponent(...) instead of paint(...).
    -- launch your GUI on the EDT by wrapping it in a SwingUtilities.invokeLater or EventQueue.invokeLater.
    -- calling setSize(...) followed by pack() is meaningless. Use one or the other.
    -- That's not the correct way to display a component in a scroll pane.
    Ah, well, and the problem is that when you call pack(), it retrieves the preferredSize of the components in the JFrame, and you haven't set a preferredSize for the scroll pane.
    Please, for your own good, take a break from whatever it is you're working on and go through The Java™ Tutorials: [Creating a GUI with JFC/Swing|http://java.sun.com/docs/books/tutorial/uiswing/TOC.html]
    db

  • 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

  • Modal Internal Frames and JCombos

    Hi,
    I'm trying to create a modal internal frame as suggested in Sun's TechTip:
    http://developer.java.sun.com/developer/JDCTechTips/2001/tt1220.html
    All I need is to block the input for the rest of the GUI, I don't care about real modality (the setVisible() call returns immediately).
    I need to have a JComboBox in my internal frame. It turns out that under JDK1.4.0/1.4.1 the list for the combo is visible only with the Windows Look And Feel, while in every other JDK version it's not visible, except for the portion falling out of the internal frame.
    The code to verify this follows. Does anybody know how to fix this? I've opened a bug for it, but I was wondering if someone can help in the forum...
    Run the application passing "Windows" or "CDE/Motif", click on "open" and play with the combo to observe the result.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class Modal {
    static class ModalAdapter
    extends InternalFrameAdapter {
    Component glass;
    public ModalAdapter(Component glass) {
    this.glass = glass;
    // Associate dummy mouse listeners
    // Otherwise mouse events pass through
    MouseInputAdapter adapter =
    new MouseInputAdapter(){};
    glass.addMouseListener(adapter);
    glass.addMouseMotionListener(adapter);
    public void internalFrameClosed(
    InternalFrameEvent e) {
    glass.setVisible(false);
    public static void main(String args[]) {
    System.out.println("Installed lookAndFeels:");
    UIManager.LookAndFeelInfo[] lafInfo = UIManager.getInstalledLookAndFeels();
    for(int i=0; i<lafInfo.length; i++) {
    System.out.println(lafInfo.getName());
    String lookAndFeel = null;
    if (args.length>0)
    lookAndFeel = args[0];
    initLookAndFeel(lookAndFeel);
    final JFrame frame = new JFrame(
    "Modal Internal Frame");
    frame.setDefaultCloseOperation(
    JFrame.EXIT_ON_CLOSE);
    final JDesktopPane desktop = new JDesktopPane();
    ActionListener showModal =
    new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    // Manually construct a message frame popup
    JOptionPane optionPane = new JOptionPane();
    optionPane.setMessage("Hello, World");
    optionPane.setMessageType(
    JOptionPane.INFORMATION_MESSAGE);
    // JInternalFrame modal = optionPane.
    // createInternalFrame(desktop, "Modal");
                        JInternalFrame modal = new JInternalFrame("test", true, true, true);
    JPanel jp = (JPanel )modal.getContentPane();
              JComboBox jcb = new JComboBox(new String[]{"choice a", "choice b"});
    jp.setLayout(new BorderLayout());
              jp.add(jcb,BorderLayout.NORTH);
              jp.add(new JTextArea(),BorderLayout.CENTER);
    // create opaque glass pane
    JPanel glass = new JPanel();
    glass.setOpaque(false);
    // Attach modal behavior to frame
    modal.addInternalFrameListener(
    new ModalAdapter(glass));
    // Add modal internal frame to glass pane
    glass.add(modal);
    // Change glass pane to our panel
    frame.setGlassPane(glass);
    // Show glass pane, then modal dialog
    modal.setVisible(true);
    glass.setVisible(true);
    System.out.println("Returns immediately");
    JInternalFrame internal =
    new JInternalFrame("Opener");
    desktop.add(internal);
    JButton button = new JButton("Open");
    button.addActionListener(showModal);
    Container iContent = internal.getContentPane();
    iContent.add(button, BorderLayout.CENTER);
    internal.setBounds(25, 25, 200, 100);
    internal.setVisible(true);
    Container content = frame.getContentPane();
    content.add(desktop, BorderLayout.CENTER);
    frame.setSize(500, 300);
    frame.setVisible(true);
    private static void initLookAndFeel(String lookAndFeel) {
    String lookAndFeelClassName = null;
    UIManager.LookAndFeelInfo[] lafInfo = UIManager.getInstalledLookAndFeels();
    for(int i=0; i<lafInfo.length; i++) {
    if (lafInfo[i].getName().equals(lookAndFeel)) {
    lookAndFeelClassName = lafInfo[i].getClassName();
    if (lookAndFeelClassName == null)
    System.err.println("No class found for lookAndFeel: "+ lookAndFeel);
    try {
    UIManager.setLookAndFeel(lookAndFeelClassName);
    } catch (ClassNotFoundException e) {
    System.err.println("Couldn't find class for specified look and feel:"
    + lookAndFeel);
    System.err.println("Did you include the L&F library in the class path?");
    System.err.println("Using the default look and feel.");
    } catch (UnsupportedLookAndFeelException e) {
    System.err.println("Can't use the specified look and feel ("
    + lookAndFeel
    + ") on this platform.");
    System.err.println("Using the default look and feel.");
    } catch (Exception e) {
    System.err.println("Couldn't get specified look and feel ("
    + lookAndFeel
    + "), for some reason.");
    System.err.println("Using the default look and feel.");
    e.printStackTrace();

    Hi,
    Had exactly the same problem. Seems there are plenty of similar problems all related to the glass pane, so have solved the problem here by putting the event-blocking panel onto the MODAL_LAYER of the layered pane, rather than replacing the glass pane. Otherwise pretty much the same technique - you may need a property change listener to track changes in the size of the layered pane
    something like ...
    layer = frame.getLayeredPane();
    glass.setSize (layer.getSize()); // will need to track size
    glass.add (modal);
    layer.add(glass, JLayeredPane.MODAL_LAYER, 0);
    I've modified the original examples so the frames can be re-used so you may have to play around with the example a bit
    Hope it helps
    cheers.

  • Dynamic resize of JButton and JFrame in response to Font

    Im supposed to increase the font size of the text with JButton by 1 within each click.
    Eventually the text becomes shorter and less visible like WORD becomes WOR... then WO... etc
    How to make the button always resize with text so that the text is fully visible and JFrame always resize with button so that the button doesn't change its position within the Frame ?
    edit:
    I managed to make buttons resize with increasing font
    by making
    JButton b = new JButton("button");
    b.setHorizontalTextPosition(CENTER);
    b.setVerticalTextPosition(CENTER);However the window size doesnt increase with components ;[
    any help would be appretiated.
    Edited by: pimpcane on Dec 11, 2007 12:16 PM

    Ok I managed to get it working moreless by
    adding pack() to the actionPerformed(...) function
    public void actionPerformed(ActionEvent e)
                 int index = Integer.parseInt(e.getActionCommand());
              int size = buttons[index].getFont().getSize();
              size++;
              buttons[index].setFont(new Font(name, style, size));
              pack();
    }The problem is in the task im given it is forbidden to use pack();
    Is there any other method to obtain the same result of JFrame resizing dynamically in response to components resize ?
    Edited by: pimpcane on Dec 12, 2007 12:13 PM
    Edited by: pimpcane on Dec 12, 2007 12:15 PM

  • Drag JTabbedPane out of the main Frame and set scroll bars for the tabs

    hi ,
    Iam working on a Swing application . In it i have Six Tabs added to a single JTabbedPane. all the tabs are different class files . is it possible to drag any of the tabs out of the frame.
    how to add scroll bars for the tabs individually. i have tried adding JScrollPane to the main frame and add the JTabbedPane to the Scrollpane . the scroll bar was not visible and i have tried adding
    all the six tabs to the individual JScrollPanes and add the six scrollpanes to the TabbedPane .
    only the scroll arrows are visible , when i minimised or resized the application the scrollbars were not appearing .
    could any one help me to solve the above two problems.

    just trying.....
    public void mouseDragged(MouseMotionEvent e){
    // this event should be activated only when the Drag goes out of scope of the parent JFrame which i dont know how
    Component c=JTab.getComponentAt(JTab.getSelectedIndex());
    JFrameobj.getContentPane().add(c,"Center");
    }

  • Help with JDialog and JFrame

    I have a class that extends JDialog to display images in a slide show. I use the action performed method of a button in my main Jframe Application to start the slideshow .
    When the button is clicked the JDialog opens multiple windows and the images arent displayed properly at all . But when I tested the slideshow of Jdialog separately , it works.
    Here is the code of the Jdialog part
    import java.awt.*;
    import javax.swing.*;
    import java.util.*;
    import java.awt.event.*;
    public class Test extends JDialog implements ActionListener
    {  private Image img; 
    private     JMenuBar     menuBar;
    private     JMenu          menuStart;
    public Vector images = new Vector();
    public Test()
    for (int i = 1; i < 8; i++)
    {      images.add(new ImageIcon("gty"+i+".jpg").getImage());  
    menuBar = new JMenuBar();
         setJMenuBar( menuBar );
         menuStart = new JMenu( "Start" );
         menuStart.setMnemonic( 'S' );
         menuStart.addActionListener(this);
         menuBar.add( menuStart );
    setSize(600, 600);
    setVisible(true);
    showImages(images);
    private void showImages(Vector images) {
    for (int i = 1; i < images.size(); i++)
    img = (Image) (images.elementAt(i));
    int imgWidth = img.getWidth(this);
    int imgHeight = img.getHeight(this);
    setSize( imgWidth, imgHeight );
    JLabel temp=new JLabel(new ImageIcon(img));
    this.getContentPane().add(temp);
    pack();
    setVisible(true);
    try { Thread.sleep(2000);
    } catch (Exception e) {} //do nothing
    getContentPane().remove(temp);
    pack();
    setVisible(true);
    public void actionPerformed( ActionEvent event )
    public static void main(String[] arghs)
    {//new Test(null,true);
    In the main application I just gave created an object of this type test
    i.e new Test();
    I have tried changing the constructor of the Jdialog to include parent frame and modal , but it still dosen't work . Help !

    when you declare the final variables, it should be initialized otherwise you will get error
    private final JTabbedPane tabbedPane; //not assigned yet should be
    private final JTabbedPane tabbedPane = new JTabbedPane()

  • Cut and Paste: Frame and Content Size Auto Changes

    I'm working in InDesign CS2 and am having this reoccurring problem.
    When I cut and paste frames with placed images (or pull images from a library) the frame and image will both expand to between 300%-3,000%. As you can imagine, it's very frustrating to have to create new frames and place new images every time. Any suggestions on how to fix or work around?

    I'm still having problems with this, even using Paste and Match Style.
    My table has three rows with gray background, then three rows of white; this pattern repeats for many rows. In the center row of each three rows is some text, while all other rows are blank. I want to move all this text down three rows, so that the text that was in the center row of the gray rows now is in the center row of the white rows, but I want the row colors to remain unchanged. Here's what I've tried.
    If I "Cut" the selected cells, then the background colors are cut, so this is no good. Instead, I Copy the cells, then hit the Delete key. This leaves the background alone. Now I select a cell three rows down from the top. If I Paste, then the old backgrounds are pasted in, which is not the behavior I want. If I Paste and Match Style, then all the backgrounds are overwritten with white, except those single rows that originally contained both text, and had a gray background. The original cells that were gray but had no text are pasted in as white.
    This latter behavior makes no sense to me. There seems to be a difference in how Paste and Match Style works, depending on whether the copied cells had text, or were blank.
    Is there another way to do this rather common task—moving text around a table that has alternating-colored rows, without messing up those colors?

  • Close/Remove a frame and display another

    I have a frame with a JButton.
    when the JButton is clicked i am displaying a new frame (By calling the instance of a GUI class).
    Now i want to close/remove the old frame, once the new frame is displayed.
    Can anybody help me out?
    -Achyuth B

    both are entirely different frames.
    this is the first time i am doing Swings program. And I am not sure whether the way i am doing is correct or not.
    Do tell me if there is a better approach.
    this is my login screen class.
    public class LoginScreen
         public static Container container; //i made this static so that i can call this from other class with out creating the object of class
         protected static JTextField txtLoginId, txtPassword; // made staic as i can access easly from other class
         public void createGUI()
              JFrame frame = new JFrame();
              container = frame.getContentPane();
              container.setLayout(new GridBagLayout());
              GridBagConstraints c = new GridBagConstraints();
              JPanel panel = new JPanel();
              panel =  createLogin();     //this panel displays a login id and password TextBoxs.
              c.gridx = 5;
              c.gridy = 6;
              c.anchor = GridBagConstraints.CENTER;
              container.add(panel, c);
              panel =  createdButtons(); //the submit button
              c.gridx = 5;
              c.gridy = 7;
              c.anchor = GridBagConstraints.PAGE_END;
              container.add(panel, c);
              frame.pack();
              frame.setLocation(190, 120);
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.show();
         private JPanel createLogin()
              //create & return panel
         //other functions
    }

  • C300 Red Frames and other experiences with 2014

    Hello,
    Just incase it's helpful, I'm sharing my experiences with Premiere 2014, C300 footage and a few other things.  First about me.  I have a small studio with two new mac mini's and one macbook bro running CC.  We recently bought a C300 and upgraded to 2014. 
    We've only had one project started and finished with C300.  Red frames and crashing were a constant problem.   We muscled through it.  Restart, Disk Permissions repair, PRAM,  bow to the east.
    Our next c300 project we just started.  I only have two interviews so far.  In 2014, one interview has red frames in it for about 10 of the 35 minutes.  After reading a bunch here I started a new 2014 project, imported that interview via the media browser and still got red frames. 
    Just for giggles, I opened up the previous version of premiere,  CC,  on the same machine, started a new project and imported the clip via the media browser.  There are NO red frames in the interview.  The only difference is the version of Premiere.  Same drive, same media, same mac.
    Most old projects the I've upgraded to 2014 crash constantly.  These consist of ProRes footage from an Atomos Ninja.  I've deleted my media cache on all my machines.  This problem has been pretty consistent. 
    For now, I'm going to work in CC.  On another thread, I hear there's a 2014 update on the way.  We'll see. 
    Good luck!
    J

    " ... bow to the east ... "
    lol ...
    We used to use that phrase a lot when I was younger and a problem that was intermittent popped up in something that we at times seemed to "solve", until ... it wasn't. At times, it does seem rather appropriate mostly jesting comment doesn't it?
    Neil

  • 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);

  • Scale an Imported Graphic (Frame and Contents at Once)

    I have read the help files, the knowledge base, even watched the instructional videos but can' t figure out how to size a placed graphic. I understand the difference between a frame and the contents. I can scale either one using the mouse or the numeric controls. But to scale the whole thing, do I have to scale each seseparately?
    E.g., I want to size a photo to 2.0 inches wide. I don't see a way to do this in one operation.
    I see that you CAN do it by %. Select object frame and if you size to 50%, it works -- both frame and contents go to half size. But if I size to a dimension, (width=1.5"), I have to do the frame, then the contents.
    Is there a way to act on both frame and contents at once?
    This is InDesign CS3 on a Mac.

    This is not exactly intuitive. Select the frame, then look in the  control panel for the horizontal and vertical scale fields, which should both say 100% when you first select an object. The default unit of measurement in these fields is %, but like any of the numeric fields in ID you can use any units you want, as long as tell InDesign what units you're using. If you want 2.0" wide, enter 2.0i (you don't need the n) in the width field and press enter. Your frame and content will scale to 2".

  • Adobe Muse and "frames" and "iframes" in the code

    Hello,
    i was ask by an SEO specialist that i had to remove all the "frame" code from my Muse sites because this is something that Google dont like. My question is : is it really bad for google to have a web site with frames? Is this something i cant fix in Muse, if yes how? If the frames generated by Muse when exporting in html are OK for search Engin like Google, please just give me some explanation so i can understand how this works and respond to the SEO specialist.
    I was asking my self, why would Adobe generate a bad SEO code? This is not logical, I'm sure SOMEBODY can help me understand this.
    Here is an example : (simple frame), some times i have "clip frames"
      <div class="clearfix" id="page"><!-- column -->
       <div class="position_content" id="page_position_content">
        <div class="clearfix colelem" id="ppu2528"><!-- group -->
         <div class="grpelem" id="pu2528"><!-- inclusion -->
          <div id="u2528"><!-- simple frame --></div>
          <div class="clearfix" id="pu2529-4"><!-- group -->
           <div class="clearfix grpelem" id="u2529-4"><!-- content -->
            <p>Réalisation de projets</p>
           </div>
          </div>
         </div>
         <div class="browser_width grpelem" id="u113"><!-- group -->
          <div class="clearfix" id="u113_align_to_page">
           <div class="grpelem" id="u2354"><!-- simple frame --></div>
          </div>
         </div>
         <div class="PamphletWidget clearfix grpelem" id="pamphletu2305"><!-- group -->
          <div class="ThumbGroup clearfix grpelem" id="u2331"><!-- none box -->
           <div class="popup_anchor">
            <div class="Thumb popup_element rounded-corners" id="u2333"><!-- simple frame --></div>
    Thanks
    Melanie Benoit

    There is no actual reference to HTML frames in the code snippet you provided. The ones you see are just HTML comments.
    Muse would use iFrames in cases such as inserting a YouTube/Vimeo video (this is what Google/Vimeo themselves provide for embedding purposes) or an Edge animation for example.
    Regarding impact on SEO, take a look at these articles.
    https://support.google.com/webmasters/answer/34445?hl=en
    http://webmasters.stackexchange.com/questions/54169/does-iframe-affect-seo-of-its-parent-p age
    Also note that HTML Frame and iFrame are different <http://stackoverflow.com/questions/1079128/whats-the-difference-between-iframe-and-frame> and that the latter is well supported in HTML5 - http://www.w3schools.com/tags/tag_iframe.asp.
    Thanks,
    Vinayak

  • I am trying to create a simple animated gif in Photoshop. I've set up my frames and want to use the tween to make the transitions less jerky. When I tween between frame 1 and frame 2 the object in frame two goes out of position, appearing in a different p

    I am trying to create a simple animated gif in Photoshop. I've set up my frames and want to use the tween to make the transitions less jerky. When I tween between frame 1 and frame 2 the object in frame two goes out of position, appearing in a different place than where it is on frame 2. Confused!

    Hi Melissa - thanks for your interest. Here's the first frame, the second frame and the tween frame. I don't understand why the tween is changing the position of the object in frame 2, was expecting it to just fade from one frame to the next.

  • Has anyone experienced this problem: I am editing in FCP 7.0.3 on a Mac 10.6.8 - I have a clip in the browser that is full frame and matched the other clips but when I drop it in the time line it becomes a fully zoomed in version of itself

    has anyone experienced this problem: I am editing in FCP 7.0.3 on a Mac 10.6.8 - I have a clip in the browser that is full frame and fine and it matches the other clips in my bins but when I drop it into the time line it becomes a fully zoomed in version of itself and I can only see a small portion of the image.  What's going on?  I've noticed this has happened in the past randomly with other clips and it's driving me cray cray!  Any help appreciated greatly and thanks in advance for taking the time

    In the FCP Browser, click on the source clip that is showing up sized incorrectly to select it. Once it is selected, type Command + 9 to see the item properties for the clip. Either report those properties here, or take a screen shot of the item properties and post the screen shot here.
    Next, click anywhere in your sequence timeline and then type Command + 0 {zero} to see your sequence settings. Either report those settings or take a screen shot of the sequence settings and post that screen shot here.
    MtD

Maybe you are looking for

  • Email Moderation Error

    Hi, I am having this issue as a moderator. when someone wants to send a message to a certain group in my company, the email comes to me first, i then decide whether to approve the message or not. when i click on accept i receive the following error;

  • Acrobat adds extra page

    When scanning from a Fujitsu scanner, using the color document option in Acrobat 9.1.3, Acrobat adds and extra page between scanned pages so instead of getting say a 3 page document I end up with 6.  It works normally using a black and white document

  • How to create process chain for this data flow

    Hi experts, My data flow is: ====================================== 2lis_11_vahdr->Transfer rules->2lis_11_vahdr->Update rules->DSO1->Transformation->DTP->Cube1. 2lis_11_vaitm->Transfer rules->2lis_11_vaitm->Update rules->DSO1->Transformation->DTP->C

  • Slow Playback and Scrubbing on Fast System in Premiere CS6

    I own a Eurocom desktop replacement laptop. 2 Nvidia 580m running in SLI 24 gigs of DDR3 ram 4 internal SSD Intel I7 990x Extreme CPU (6 cores) Last time I checked my video cards were not certified for the Mercury Playback Engine, but surely I should

  • Missing links to my profile

    This have been working in the past, but suddenly the links to "My Site" and "My Profile" is missing in the dropdown. That is only for my root site. I have four subsites where the links shows up and working. How can the links dissapear from the main s