Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 1 of 1

Thread: removing the small arrow of Synth L&F JInternalFrame title bar (Nimbus)

  1. #1
    Java kindergarten chronoz13's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    659
    Thanks
    177
    Thanked 30 Times in 28 Posts

    Exclamation removing the small arrow of Synth L&F JInternalFrame title bar (Nimbus)

    im diving around google looking how to remove the small arrow of a JInternalFrame set up with a Synth(Nimbus) Look and Feel
    with a Default L&F
    this code removes some of property of a JInternalFrame object, leaving only the close button
    internalFrame.putClientProperty("JInternalFrame.isPalette", Boolean.TRUE);

    but switching the lookAndFeel of the components using this code, a Synth Style internal frame has a default behavior that retains a small arrow button, a Simple png image is attached, to see what it looks like
    try {
     
                for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
     
                    if ("Nimbus".equals(info.getName())) {
     
                        UIManager.setLookAndFeel(info.getClassName());
                        break;
                    }
                }
            } catch (Exception e) {
     
                e.printStackTrace();
            }

    whole code for the program
    import java.beans.PropertyVetoException;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JInternalFrame;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    import java.awt.Rectangle;
    import java.awt.RenderingHints;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.Color;
    import java.awt.Point;
    import javax.swing.UIManager;
    import javax.swing.UIManager.LookAndFeelInfo;
    import javax.swing.plaf.InternalFrameUI;
    import javax.swing.plaf.synth.SynthInternalFrameUI;
     
    public class Window {
     
        public Window() {
     
     
            try {
     
                for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
     
                    if ("Nimbus".equals(info.getName())) {
     
                        UIManager.setLookAndFeel(info.getClassName());
                        break;
                    }
                }
            } catch (Exception e) {
     
                e.printStackTrace();
            }
     
            setUp();
        }
     
        public void setUp() {
     
            JFrame f = new JFrame();
            JPanel p = new JPanel(null);
            JInternalFrame internalFrame = new JInternalFrame();
     
            internalFrame.setSize(200, 150);
            internalFrame.setOpaque(true);
            internalFrame.setLocation(new Point(50 ,2));
            internalFrame.putClientProperty("JInternalFrame.isPalette", Boolean.TRUE);    
            internalFrame.setClosable(true);
            internalFrame.setResizable(true);
            internalFrame.setVisible(true);
            p.add(internalFrame);
            p.setBackground(Color.BLACK);
            f.add(internalFrame);
            f.getContentPane().add(p);
            f.setSize(400, 200);
            f.setLocationRelativeTo(null);
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.setVisible(true);
        }
     
        public static void main(String[] args) {
     
            new Window();
        }
    }

    until i found this thread on another forum, having the same problem with that arrow
    java - Is it possible to remove the little dropdown arrow in a JInternalFrame? - Stack Overflow

    pointing out this thing
    InternalFrame:InternalFrameTitlePane:"InternalFram eTitlePane.menuButton".icon
    questions:
    1.) is there a (maybe not an Easy way) but a considerable approach to JUST REMOVE that small arrow button of a Synth Look and Feel Internal frame?
    2.) i ended up on BasicInternalFrameUI, InternalFrameUI, SynthInternalFrameUI classes, where or which of these classes should i focus on to deal with this problem?
    3.) how to use this classes?, google resources gives me tons of confusing codes,

    i need some guides and maybe some idea, for this one
    Attached Images Attached Images


Similar Threads

  1. Moving an image around the screen using the arrow keys.
    By nemo in forum What's Wrong With My Code?
    Replies: 4
    Last Post: March 19th, 2013, 12:08 AM
  2. Replies: 1
    Last Post: September 26th, 2011, 07:23 AM
  3. Bold font in JTabbedpane in Nimbus L&F
    By sponarun in forum What's Wrong With My Code?
    Replies: 0
    Last Post: February 28th, 2011, 02:09 AM
  4. video game problem - delay in response to arrow key presses
    By gib65 in forum What's Wrong With My Code?
    Replies: 6
    Last Post: October 17th, 2010, 07:39 PM
  5. JTable gridlines not showing in a nimbus L&F
    By chronoz13 in forum AWT / Java Swing
    Replies: 0
    Last Post: February 22nd, 2010, 07:45 AM