Setting the font of the titlebar of JInternal Frames??

hi all,
i am trying to change the font of the titles of JinternalFrames..
i have tried it but cant p*** compilation..
i have done.. title.setFont(X,X,X);
is it possible to set the fonts of titlebars of frames?
If i cant do it like this, is there another way around this?
thank u ..

If you tried it and it doesn't work, then that likely means they work the same as JFrames, where the title bar is rendered by the operating system and not by Java. If you are using Windows, that means you have to go into the Control Panel and adjust the Display properties to change the font.

Similar Messages

  • How to set the state of browser frame?

    hello all,
    can u suggest some way to set the state of applet broser from minimized to maximized.
    the class name for browser window is shown as
    "com.ms.applet.BrowserAppletFrame."
    i can type cast the browser frame reference to Frame class, but the method setState(Frame.NORMAL) is not working as this method is not available in micorsoft implementation of java.awt.Frame class.
    i would like to maximize the brower programatically..
    thanks in advance...
    regards
    Sojan

    Hi,
    Did you find a solution for this problem? I am trying to do the same thing. Thanks.
    J

  • How to fix the position of JInternal frames added in JFrame

    Hay Frnds, I am having a problem. I have a JFrame ,in which i have added five JInternalFrames. My problem is that i want to fix the position of thaose Internal frames so that user cant move them from one place to other. Is there any way to fix there position. Plz reply as soon as possible. Its very urgent.
    Thanks.

    In Jframe I added one rootPanelI don't know what a rootPanel is or why you think you need to add one.
    The general code should probably be something like:
    frame.add(userPanel, BorderLayout.CENTER);
    frame.add(buttonPanel, BorderLayout.SOUTH);
    frame.pack();Read the section from the Swing tutorial on [Using Layout Managers|http://java.sun.com/docs/books/tutorial/uiswing/TOC.html] for more information and working examples.
    For more help create a [SSCCE (Short, Self Contained, Compilable and Executable, Example Program)|http://sscce.org], that demonstrates the incorrect behaviour.
    Don't forget to use the Code Formatting Tags so the posted code retains its original formatting. That is done by selecting the code and then clicking on the "Code" button above the question input area.

  • Dynamically vary the size of various frames

    I have a jsp page which has a number of frames. What I want is to vary the size and location of the frames.
    If you use eclipse IDE you can just drag and drop one frame from one place to another , I want something of that sort.

    Don't know how this applies to this forum, but you can set the size of a frame using a JSP expression (i.e. <frame width="<%=mySize%>"...>) where you've previously assigned a value to mySize.
    HTH.

  • Saving contents of jinternal frame

    Hi, I seem to have a problem saving files from jinternal frames. I created two files, the main GUI which holds the jdesktop pane and the other file (Documento) extends jinternalframe. I want to be able to save the current (active) jinternal frame but I have no idea how to do it. can anyone help me?
    import javax.swing.JInternalFrame;
    import javax.swing.JDesktopPane;
    import javax.swing.JMenu;
    import javax.swing.JMenuItem;
    import javax.swing.JMenuBar;
    import javax.swing.JFrame;
    import javax.swing.KeyStroke;
    import java.awt.event.*;
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.Graphics.*;
    import javax.swing.JOptionPane;
    import java.io.*;
    import java.util.*;
    *This is the main GUI of the program.
    public class mainGUI extends JFrame
                                   implements ActionListener,
                                    KeyListener{
        JDesktopPane desktop;
        Documento frame;
         private Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
         private JPanel toolbar, editarea, resultarea, blankPanel;
         private JMenu file, edit, project;
         private JMenuItem f_open, f_new, f_save, f_saveas, f_exit, e_select, e_copy, e_paste, p_compile;
         private JTextArea resultfield, editfield,editArea, tstr;
         private JButton bcompile;
         private JFileChooser fc = new JFileChooser();
         private String filepath;
         private ImageIcon bugicon;
         private static int docNum = 0;
         private boolean b_openfile;
         File filename;
        public mainGUI() {
            super("DGJ Program Scanner");
            setSize(800,600);
              setLocation((screen.width-800)/2, (screen.height-600)/2);
            /*Creates the workspace*/
            desktop = new JDesktopPane();
            setContentPane(desktop);
            setJMenuBar(createMenuBar());
            /*Make dragging a little faster*/
            desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
          *This function creates the menu bar
        protected JMenuBar createMenuBar() {
             /*Initializes/instantiates the menu bar and its items*/
              file = new JMenu("File");
              edit = new JMenu("Edit");
              project = new JMenu("Project");
              f_new = new JMenuItem("Create new file");
              f_open = new JMenuItem("Open file...");
              f_save = new JMenuItem("Save current file");
              f_saveas = new JMenuItem("Save As...");
              f_exit = new JMenuItem("Exit program");
              e_select = new JMenuItem("Select All");
              e_copy = new JMenuItem("Copy selected");
              e_paste = new JMenuItem("Paste selected");
              p_compile = new JMenuItem("Scan current file for errors");
              /*Adds listeners to the menu items*/
              f_open.setActionCommand("f_open");
              f_open.addActionListener(this);
              f_save.setActionCommand("f_save");
              f_save.addActionListener(this);
              f_saveas.addActionListener(this);
              f_saveas.setActionCommand("f_saveas");
              f_new.setActionCommand("f_new");
              f_new.addActionListener(this);
              f_exit.setActionCommand("f_exit");
              f_exit.addActionListener(this);
              e_select.setActionCommand("e_select");
              e_select.addActionListener(this);
              e_paste.setActionCommand("e_paste");
              e_paste.addActionListener(this);     
              e_copy.setActionCommand("e_copy");
              e_copy.addActionListener(this);               
              /*Creates the icon of the bug*/
              bugicon = new ImageIcon("images/ladybug.gif");
              /*Creates the menu bar*/
              JMenuBar menu = new JMenuBar();
              menu.add(file);
                   file.add(f_new);
                   file.add(f_open);
                   file.add(f_save);
                   file.add(f_saveas);
                   file.add(f_exit);
              menu.add(edit);
                   edit.add(e_select);
                   edit.add(e_copy);
                   edit.add(e_paste);
              menu.add(project);
                   project.add(p_compile);
              /*Disables the save current file menu...(when program starts, no file is open yet)*/
              f_save.setEnabled(false);
              f_saveas.setEnabled(false);
            return menu;
        //React to menu selections.
        public void actionPerformed(ActionEvent e) {
            if ("f_new".equals(e.getActionCommand()))
            { //new
                createFrame(null);
                f_saveas.setEnabled(true);
            else if("f_open".equals(e.getActionCommand()))
            {//open documento
                   fc.setFileFilter(new SpanFilter());
                  int retval = fc.showOpenDialog(mainGUI.this);
                   tstr = new JTextArea();
                   /*This checks if the user has chosen a file*/
                if (retval == JFileChooser.APPROVE_OPTION) {
                    filename = fc.getSelectedFile();
                        filepath = filename.getPath();            
                        openFile(filename, new Point(30,30));       
            else if("f_save".equals(e.getActionCommand()))
                 try {
                      BufferedWriter out = new BufferedWriter(new FileWriter(filepath));
                      String str;
                      str = editArea.getText();
                      editArea.setText("");  
                      int length = str.length();
                      out.write(str, 0, length);
                      out.close();
                       } catch (Exception ex) {}
                       JInternalFrame fr = new JInternalFrame();
                       fr = desktop.getSelectedFrame();
                       Point p = fr.getLocation();
                        fr.dispose();    
                       openFile(filename, p);
            else if("f_saveas".equals(e.getActionCommand()))
                 fc.setFileFilter(new SpanFilter());
                  int retval = fc.showSaveDialog(mainGUI.this);
                if (retval == JFileChooser.APPROVE_OPTION) {
                    filename = fc.getSelectedFile();
                        filepath = filename.getPath();
                        if(!(filepath.contains(".dgj")))
                             filepath+=".dgj";
                      try {
                           BufferedWriter out = new BufferedWriter(new FileWriter(filepath));
                                String str;
                           str = editArea.getText();
                           int length = str.length();
                           out.write(str, 0, length);
                           out.close();
                       } catch (Exception ex) {}
                       Point p = frame.getLocation();
                        frame.dispose();
                   //     editArea.setText("");     
                       openFile(filename, p);
            else if("e_select".equals(e.getActionCommand()))
                 editArea.selectAll();
            else if("e_copy".equals(e.getActionCommand()))
                   editArea.copy();
            else if("e_paste".equals(e.getActionCommand()))
                 editArea.paste();
            else if("f_exit".equals(e.getActionCommand()))
            { //quit
                quit();
        public void openFile(File filename, Point p)
                        /*Reads the file*/
                        try {
                           BufferedReader in = new BufferedReader(new FileReader(filepath));
                             String str;
                             /*empties the textarea*/
                             tstr.setText("");
                             str = in.readLine();
                             /*Copy each line of the file into the temporary textarea*/
                           do{  
                          tstr.append(str);
                          str = in.readLine();
                          /* the "\n" is for the line to appear in the next line in the textarea,
                           * the "\r" is for windows system, wherein "\r" is required for the text
                           * to appear in beginning of the first line*/
                          if(str!=null)
                               tstr.append("\r\n");
                           }while (str != null);
                             /*Opens the new frame*/
                           createFrame(filename, filename.getName(), tstr.getText(), p);
                           in.close();
                       } catch (Exception ex){}
                      b_openfile = true;
                      f_save.setEnabled(true); 
                      f_saveas.setEnabled(true);   
         *Create a new internal frame.
        protected void createFrame(File f) {
             frame = new Documento(f);
         /*     frame = new JInternalFrame("Document "+(++docNum),
                  true, //resizable
                  true, //closable
                  true, //maximizable
                  true);
            docNum++;
              frame.setSize(600,400);
              frame.setLocation(20*(docNum%10), 20*(docNum%10));       
             editArea = new JTextArea();
              JScrollPane scroll = new JScrollPane(editArea);     
              editArea.addKeyListener(this);
              editArea.append("");
              frame.add(scroll);
            frame.setVisible(true); //necessary as of 1.3
            desktop.add(frame);
            try {
                frame.setSelected(true);
            } catch (java.beans.PropertyVetoException e) {}
          *Overwrite an existing internal frame for an open file
        protected void createFrame(File f, String title, String text, Point P) {
             frame = new Documento(title, f, P);
              frame.setSize(600,400);
              frame.setLocation(P); 
             editArea = new JTextArea();
              JScrollPane scroll = new JScrollPane(editArea);     
              editArea.setText("");
              editArea.addKeyListener(this);
              editArea.append(text);
              frame.add(scroll);
            frame.setVisible(true); //necessary as of 1.3
            desktop.add(frame);
            try {
                frame.setSelected(true);
            } catch (java.beans.PropertyVetoException e) {}
        //Quit the application.
        protected void quit() {
            System.exit(0);
         * Create the GUI and show it.  For thread safety,
         * this method should be invoked from the
         * event-dispatching thread.
        private static void createAndShowGUI() {
            //Make sure we have nice window decorations.
            //JFrame.setDefaultLookAndFeelDecorated(true);
            //Create and set up the window.
            mainGUI frame = new mainGUI();
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Display the window.
            frame.setVisible(true);
        public void keyTyped(KeyEvent k){}
        public void keyPressed(KeyEvent k)
             if(k.getKeyCode()==10)
                  editArea.append("\r");           
        public void keyReleased(KeyEvent k){}
        public static void main(String[] args) {
            //Schedule a job for the event-dispatching thread:
            //creating and showing this application's GUI.
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();
    }here's the one that extends jinternalframe
    import javax.swing.JInternalFrame;
    import javax.swing.plaf.InternalFrameUI;
    import java.awt.event.*;
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.io.*;
    import java.util.*;
    /* Used by mainGUI.java */
    public class Documento extends JInternalFrame {
        static final int xOffset = 30, yOffset = 30;
         static JTextArea editArea;
         static int docNum = 0;
         static File file;
          *The constructer for a new documento
        public Documento(File file) {
            super("Document "+(++docNum),
                  true, //resizable
                  true, //closable
                  true, //maximizable
                  true);//iconifiable
            docNum++;
              this.file = file;
              setSize(600,400);
              setLocation(xOffset*(docNum%10), yOffset*(docNum%10));
    //        setUI(new InternalFrameUI());
         *The constructor for an existing documento
        public Documento(String title, File file, Point p) {
            super(title,
                  true, //resizable
                  true, //closable
                  true, //maximizable
                  true);//iconifiable
              this.file = file;             
              setSize(600,400);          
              setLocation(p);
    //        setUI(new InternalFrameUI());
        public int getNum()
             return docNum;
        public File getPath()
             return file;
    }I know it's pretty lengthy...it's probably all messed up since I'm lost :p
    Thanks if you could help me!

    I would be glad to help, but first I need a clarification. If I understand properly, you have two Java classes that you have created: the "main GUI" (which is most likely a JFrame extension in which the constructor adds a JDesktopPane to the content pane) and "Documento" (which you say is a JInternalFrame extension).
    My question is this: what do you mean by "save the current JInternalFrame"? Do you want to record its position, location, and identity? Do you want to save its contents?
    Thanks. Good luck. ;)

  • How to set focus order of multiple Component in a Frame

    I have created a Frame with contain some Label, Textfield, Choice and Buttons
    How do set focus order on these Components

    write an implementation of
    import java.awt.*;
    public class PanelFocusTraversalPolicy extends FocusTraversalPolicy
        public Component getComponentAfter(Container container, Component component)
            if(component.equals(cmp1))
                return cmp2;
            if(component.equals(cmp2))
                return cmp3;
            return cmp1;
        public Component getComponentBefore(Container container, Component component)
            //implentation of method
        public Component getDefaultComponent(Container container)
          return cmp1;
        public Component getLastComponent(Container container)
            return cmp3;
        public Component getFirstComponent(Container container)
           return cmp1;
        public PanelFocusTraversalPolicy()
    }and set the focus traversal of frame.
    setFocusTraversalPolicy(new PanelFocusTraversalPolicy())

  • Setting the font of the titlebar on JInternalFrames

    hi all,
    i am trying to change the font of the titles of JinternalFrames..
    i have tried it but cant pass compilation..
    i have done.. title.setFont(X,X,X);
    is this possible to set the fonts of titles of frames?
    If i cant do it like this, is there another way around this?
    thank u ..

    http://search.java.sun.com/search/java/index.jsp?qp=&nh=10&qt=%2BJTabbedPane+%2Btab+%2Bfont&col=javaforums

  • Setting the title font and axis labels in a graph created with the Report Generation Toolkit

    I'm using the LabVIEW Report Generation Toolkit for Microsoft Office to generate Excel worksheets containing plots. Unfortunately, the default font size used in the plots is huge (see attached worksheet). I was able to use Excel Set Graph Font.vi to reduce the size of the axis labels, but there does not appear to be a function to do this to the title and legend. In addition, there does not appear to be a function to set the axis text labels. Before I write my own, has NI released additional functions to perform these tasks?
    Thanks for your help,
    Zach Lerner
    Software Engineer
    OnWafer Technologies, Inc.
    Attachments:
    Test1_-_embedded_graph's_title_and_legend_font_is_huge.xls ‏14 KB

    Hello Zeidan
    The graph title and legend font sizes can be changed by accessing a low level VI (Excel_Insert_Chart.vi) that is part of the excelsub.llb that is located at (C:\Program Files\National Instruments\LabVIEW 8.2\vi.lib\addons\_office). This VI is called dynamically from within the Excel Insert Graph.vi and it uses VI server technology to access the Excel exposed properties. Attached to this post is an image of the block diagram of this VI after I have modified it to set the font sizes of the title and legend to 15. The circles in the image represent what I had to add to accomplish this.
    Best Regards,
    Ayman Kabire
    Attachments:
    Excel_Insert_Chart.JPG ‏99 KB

  • How can I set the font size of a form field in the fdf file?

    I need to dynamically set the font size of a field to accommodate text of varying length, automatic font size won't work in this case. It seems like this can be done in the FDF but I have tried several variants without success. Could someone help out with a real example of what the syntax in the fdf should look like.
    I am using Acrobat Professional 8.1 but the created fdf will need to work with Reader also.

    I think that the font size has to be set in the form itself, not the FDF.

  • How do I set the font in firefox 4.0 using ubuntu?

    The zoom feature is OK but I want to permanently set the font size on my firefox pages using the Ubuntu operating system. I don't see anything under Tools and there doesn't seem to be a lot of questions previously asked in the Help area about Firefox in Ubuntu.

    It's difficult to set a single font size without wrecking the display of most web sites. One alternative would be to store your preferred zoom level and apply that to all sites. This requires an add-on such as:
    * [https://addons.mozilla.org/en-US/firefox/addon/6965/ Default FullZoom Level]
    * [https://addons.mozilla.org/en-US/firefox/addon/2592/ NoSquint]
    Does that work for you?

  • Formatting issues: when I open a msg, the font is sooo small you need a magnifier to read it. How can I set the font size to one I can easily read?

    == Issue
    ==
    I have another kind of problem with Firefox
    == Description
    ==
    I have various formatting issues:
    a. When I open a msg from my web browser (Cablevision), the font is sooo small I need a magnifier to read it. How can I set the font to a size I can easily read?
    b. When I forward msgs, the text gets all distorted and I need to clean it up (some symbols, lots of spaces between words). How can this be fixed?
    c. When I want to tell someone about a website, I cannot type the URL in so that all they have to do is click on it. How can this be fixed?
    d. When I open messages, the text opens in a small window and covers the "Show Images" button. Why?
    == This happened
    ==
    Every time Firefox opened
    == Ever since I started using Firefox (a few months ago)
    ==
    '''Troubleshooting information'''
    I didn't find any results
    == Firefox version
    ==
    3.6.3
    == Operating system
    ==
    Windows 7
    == User Agent
    ==
    Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
    == Plugins installed
    ==
    *-nphpclipbook
    *Office Plugin for Netscape Navigator
    *The QuickTime Plugin allows you to view a wide variety of multimedia content in Web pages. For more information, visit the QuickTime Web site.
    *Default Plug-in
    *Adobe PDF Plug-In For Firefox and Netscape "9.3.2"
    *NPRuntime Script Plug-in Library for Java(TM) Deploy
    *The Hulu Desktop Plugin allows Hulu.com to integrate with the Hulu Desktop application.
    *Shockwave Flash 10.0 r45
    *Adobe Shockwave for Director Netscape plug-in, version 11.5
    *iTunes Detector Plug-in
    *3.0.40624.0
    *NPWLPG
    *Next Generation Java Plug-in 1.6.0_20 for Mozilla browsers

    The text editor is the text area that you use on the webmail (Yahoo, Hotmail) website to create a new mail.
    You can compare that with the ''Post new message'' text area that you use to create a new post on this forum.
    Just above the text area that you use to enter the message text there is usually a button bar with buttons that allows some text formatting like Bold and Italic and can also include a button to make a clickable hyperlink.
    Check the tooltip of each button by hovering with the mouse over each button.
    Make Link - https://addons.mozilla.org/firefox/addon/142

  • How do you set the font color for a specific entire row inside a JTable?

    How do you set the font color for a specific entire row inside a JTable?
    I want to change the font color for only a couple of rows inside a JTable.
    I've seen some ways to possibly do this with an individual cell.
    Clarification on changing the font color in an individual cell would be helpful too if
    there is no easy way to do this for a row.

    hai,
    Try out with this piece of code.Create your table and assign the renderer to each column in the table.
    CellColorRenderer m_CellColorRenderer = new CellColorRenderer();
    for(int i=0;i<your_JTable.getColumnCount();i++)
    your_JTable.getColumnModel().getColumn(i).setCellRenderer(m_CellColorRenderer);
    class CellColorRenderer extends JLabel implements TableCellRenderer
    CellColorRenderer()     
    setOpaque(true);     
    setHorizontalAlignment(LEFT);
    setVerticalAlignment(CENTER);
    setBackground(Color.white);
    setForeground(Color.black);
    protected void setValue(Object value)
         setText((value == null) ? "" : value.toString());
    public Component getTableCellRendererComponent(JTable table,Object value,boolean isSelected, boolean hasFocus, int row,int column)
         if(isSelected == true)
              setForeground(Color.red);
         else
              setForeground(Color.black);
         setValue(value);
         return this;
    regards,
    bala

  • How to set the desired font to the selected text in textframe?

    Hi,
    I want to change the font(let's say Times New Roman) of selected text in textframe when I click on  menu-item of my plug-in.
    I went through the Adobe Text Engine documentation and  tried some code for setting font but failed. I don't see any member function in IFont class to set desired font, so unable to move forward.
    plz see the code. I would like to know one more thing that how can we set a particular font for a textframe?
    TextRangesRef rangesRef = NULL;
    result = sAIDocument->GetTextSelection(&rangesRef);
    aisdk::check_ai_error(result);
    ITextRanges ranges(rangesRef);
    if (ranges.GetSize() > 0)
         ITextRange range = ranges.Item(0);
         ICharFeatures features = range.GetUniqueLocalCharFeatures();
         IFont  font;                     // I don't see any method to put desired font.
       // features.SetFont(); 
    Thanks.
    D.A

    First, get the font:
    AIFontKey fontKey = 0;
    AIErr error = sAIFont->FindFont("Times New Roman Regular", kAIAnyFontTechnology, kNativeAIScript, 0, &fontKey);
    // do something with error
    ATE::FontRef fontRef = 0;
    error = sAIFont->FontFromFontKey(fontKey, &fontRef);
    // do something with error
    ATE::IFont font(fontRef);
    Then, apply it like this:
    ATE::TextRangeRef textRangeRef = 0;
    AIErr error = sAITextFrame->GetATETextRange(handle_to_artwork, &textRangeRef);
    // check error
    ATE::ITextRange textRange(textRangeRef);
    ATE::ICharFeatures charFeatures = textRange.GetUniqueLocalCharFeatures();
    charFeatures.SetFont(font);
    textRange.ReplaceOrAddLocalCharFeatures(charFeatures);
    There are a few other ways to set the text, but you need to understand how character & paragraph styles interact with each other to understand the differneces. This is the most straight forward way to do it though.

  • How can I set the size of the font so I don't have to change every new word?

    How can I set the size of the font so I don't have to change every new word?

    In what application?

  • How to set the size of a Font in Pixel?

    Hi,
    i know how to get the screen resolution of the current monitor and I know how to use Fonts (and I know how to read the API, but that didnt help).
    Is there a way to set the size (or at least the height) of a Font in pixel rather then in points?
    All I actually need is how many pixels the height of my String will be when I print it on the screen.
    I use Swing and drawString(...) to draw my String (this information shouldnt matter, but just in case).
    thanx

    Hi,
    search doc about FontMetrics, you'll find infos about how to get the font height... If I remember well, you need to get the Graphics of the component, then call getFontMetrics() or getFontMetrics(font) to obtain the metrics, then call getHeight() to know the font height...

Maybe you are looking for

  • My phone is not working after i tried to update it to IOS 8!

    Hello everyone, i hope that you can help me with my problem! Yesterday i tried to update my Iphone 5s to ios 8 via itunes on my mac. After a while it displayed that there was an error an it stopped. After that i tried to open my phone and it was in r

  • Creative Zen:M is not being recognized please he

    Hi,I have had a creative vision zen:M for a few months now and had no real issues with it. Except the other day i was playing a music?video around 2mins and i tried to turn the volume up and it didnt respond i then tried the rest of the buttons and n

  • Upload Download Emergency on Samsung Gleam

    I've seen a few posts on this issue with no resolution.  I had this happen today for several hours.  After several attempts to return to service, and removing and reinstalling the battery.  My phone finally came back up.  I'm glad that it was long en

  • How to define interface builder outlets in Cocoa-Python?

    Hi, I am writing a Cocoa-Python application but I couldn't find a way to define outlets in Python code that I can use in the Interface Builder. Of course I know how to do that in Objective-C and this doc http://developer.apple.com/documentation/Cocoa

  • Use an iphoto slideshow as a screensaver

    I created a slideshow in iPhoto.  Is there a way I can use that slideshow as my screensaver instead of one of the default photo slideshows in preferences?  If so, is there a way to share that between multiple computers as well?  I am using iLife 11.