JDialog problem with 1.4.2_05?

I've got a program that needs to stop processing and display a JDialog (or JFrame if easier) to gather user information. The problem I'm having seems to be in .setVisible(). It renders the window and the title bar, and never finishes rendering the guts of the JDialog. I've stripped it down to basically a "hello world" label, and it still doesn't disply. Can some one please help me with this? I'm totally stumped. I've seen posting and bug reports that sound similar, but they say a fix was coming in 1.4, and I'm using 1.4. Thanks in advance.

The problem actually seems to be the combination of setModal(true) and setVisible(). If I remove the setModal, the screen renders properly, but processing continues.
My outter class is a socket server that listens, and validates some data. It gets to this section :
if (open == false) {
DateScreen ds = new DateScreen();
I need a valid date for this transaction. The DateScreen looks like :
public class DateScreen extends JDialog implements ShipInterface/*, ActionListener*/ {
private NumberFormat nto2a = NumberFormat.getInstance();
private JDatePicker jdp = new JDatePicker();
private Carrier carrier = null;
public DateScreen() {
this.setModal(true);
nto2a.setMinimumIntegerDigits(2);
nto2a.setGroupingUsed(false);
int debug=0;
this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
JPanel main = new JPanel();
this.setContentPane(main);
this.getContentPane().setLayout(new BoxLayout(main, BoxLayout.X_AXIS));
jdp = new JDatePicker();
jdp.setAutoCalendarPosition(true);
Calendar cal = Calendar.getInstance();
try {
jdp.setMinDate(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DATE));
} catch (JDatePickerException e) {
e.printStackTrace();
this.getContentPane().add(Box.createHorizontalStrut(10));
this.getContentPane().add(jdp);
JButton jb = new JButton("Continue");
jb.setActionCommand("date_continue");
this.getContentPane().add(Box.createHorizontalStrut(5));
this.getContentPane().add(jb);
this.getContentPane().add(Box.createHorizontalStrut(10));
this.pack();
this.setVisible(true);
}

Similar Messages

  • Problem with version 1.2_05 & attributes

    I have just updated to the latest version of JSF (1.2_05) and the onclick events of my commandButton tags are no longer recognised. Using the version shipped with SJAS 9.1 the following page worked OK, after running the update JAR the javascript and the onclick event is no longer rendered.
    Is there anything I need to do to use the tags due to the optimisation of the passthrough attributes in this version?
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
    <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>JSP Page</title>
        </head>
        <body>
            <f:view>
                <h1><h:outputText value="JavaServer Faces" /></h1>
                <h:form>
                    <h:commandButton onclick="alert('Hello');" value="Hello">
                    </h:commandButton>
                </h:form>
            </f:view>
        </body>
    </html>Thanks for any help,
    Peter

    Did you use the glassfish-updater to update your existing glassfish?
    If so, we have found an issue where asadmin doesn't always return a status
    code to determine if a failure has occurred.
    To manually upgrade please follow these steps:
    - download the 1.2_05 binary bundle from the project page
    - backup your existing jsf-impl.jar found in GF_HOME/lib
    - copy the new jsf-api and jsf-impl JARs to GF_HOME/lib
    - edit your GF_HOME/domains/<domain-name>/config/domain.xml
    and add 'classpath-prefix="${com.sun.aas.installRoot}/lib/jsf-api.jar"
    to the java-config element.
    - restart your server
    If the API (jsf-api) isn't properly upgraded in place with the implementation, there
    will be issues.
    I will be pulling the updater in favor of the manual upgrade.

  • Problem with jDialog in a JFrame

    Hello to everyone...i'm newby java GUI developer, and i've got a problem with a JDialog within a JFrame...
    I made a JFrame which creates a new customized JDialog in his contructor, like this:
    MioJdialog dlg = new MioJdialog(this, true);
    dlg.setVisible(true);
    ...The "MioJdialog" class store his JFrame parent under a private attribute, in this way:
    class MioJdialog {...
    private Frame parent;
    public MioJdialog (Frame parent, boolean modal){
        this.parent=parent;
    ....}and here's the problem: when i try to close the parent JFrame with a command like this:
    parent.dispose();
    ( in order to close the whole window), sometimes happens that the JFrame is still visible on the screen...and i don't know why...
    got some hints?
    thanks to everyone!
    Edited by: akyra on Jan 14, 2008 4:36 AM
    Edited by: akyra on Jan 14, 2008 4:37 AM
    Edited by: akyra on Jan 14, 2008 4:37 AM

    If you need further help then you need to create a "Short, Self Contained, Compilable and Executable, Example Program (SSCCE)", that demonstrates the incorrect behaviour.
    http://homepage1.nifty.com/algafield/sscce.html
    Don't forget to use the "Code Formatting Tags", so the posted code retains its original formatting.
    http://forum.java.sun.com/help.jspa?sec=formatting

  • Problem with JDialogs and Threads

    Hi. I'm new to this forum and I hope I'm not asking a repeat question. I didn't find what I needed after a quick search of existing topics.
    I have this problem with creating a new JDialog from within a thread. I have a class which extends JDialog and within it I'm running a thread which calls up another JDialog. My problem is that the JDialog created by the Thread does not seem to function. Everything is unclickable except for the buttons in the titlebar. Is there something that I'm missing out on?

    yeah, bad idea, don't do that.

  • Problem with JDialogs

    Hi All,
    I have a problem with JDialogs in my standalone application. This app pops-up multiple JDialogs, say a stack of JDialogs.
    I have a standalone application which runs as a JFrame, call it JFrame1, which is working fine. JFrame1 pops-up a JDialog, on some button click on JFrame1, call it JDialog1, which is also working fine. Now JDialog1 pops-up another JDialog, again on some button click on JDialog1, call it JDialog2, which is too working fine. But, after I finish with JDialog2 and dispose it my JDialog1 is not working fine, though that is the front dialog at present.
    Any ideas why JDialog1 is not working fine? Am I missing anything?
    Thanks,
    Srinivas.

    Hi,
    I have a component called DateComponent that works similar to a JComboBox. When you click a small button of DateComponent, it pops-up a Calendar similar to the drop down list of JComboBox and user can pick a date from it. It gets closed when it loses focus.
    I have this DateComponent on JFrame1, JDialog1 and JDialog2. The Calendar is not being diaplayed on JDialog1 upon clicking the small button of DateComponent after JDialog2 is disposed. But it is being diaplayed properly on JDialog1 before JDialog1 opens JDialog2. What could be wrong?
    I am using JDK1.3.1.
    Thanks,
    Srinivas.

  • Problem with a template method in JDialog

    Hi friends,
    I'm experiencing a problem with JDialog. I have a base abstract class ChooseLocationDialog<E> to let a client choose a location for database. This is an abstract class with two abstract methods:
    protected abstract E prepareLocation();
    protected abstract JPanel prepareForm();Method prepareForm is used in the constructor of ChooseLocationDialog to get a JPanel and add it to content pane.
    Method prepareLocation is used to prepare location of a database. I have to options - local file and networking.
    There are two subclasses ChooseRemoteLocationDialog and ChooseLocalFileDialog.
    When I start a local version, ChooseLocalFileDialog with one input field for local file, everything works fine and my local client version starts execution.
    The problem arises when I start a network version of my client. Dialog appears and I can enter host and port into the input fields. But when I click Select, I get NullPointerException. During debugging I noticed that the values I entered into these fields ("localhost" for host and "10999" for port) were not set for corresponding JTextFields and when my code executes getText() method for these input fields it returns empty strings. This happens only for one of these dialogs - for the ChooseRemoteLocationDialog.
    The code for ChooseLocationDialog class:
    public abstract class ChooseLocationDialog<E> extends JDialog {
         private E databaseLocation;
         private static final long serialVersionUID = -1630416811077468527L;
         public ChooseLocationDialog() {
              setTitle("Choose database location");
              setAlwaysOnTop(true);
              setModal(true);
              Container container = getContentPane();
              JPanel mainPanel = new JPanel();
              //retrieving a form of a concrete implementation
              JPanel formPanel = prepareForm();
              mainPanel.add(formPanel, BorderLayout.CENTER);
              JPanel buttonPanel = new JPanel(new GridLayout(1, 2));
              JButton okButton = new JButton(new SelectLocationAction());
              JButton cancelButton = new JButton(new CancelSelectAction());
              buttonPanel.add(okButton);
              buttonPanel.add(cancelButton);
              mainPanel.add(buttonPanel, BorderLayout.SOUTH);
              container.add(mainPanel);
              pack();
              Toolkit toolkit = Toolkit.getDefaultToolkit();
              Dimension screenSize = toolkit.getScreenSize();
              int x = (screenSize.width - getWidth()) / 2;
              int y = (screenSize.height - getHeight()) / 2;
              setLocation(x, y);
              addWindowListener(new WindowAdapter() {
                   @Override
                   public void windowClosing(WindowEvent e) {
                        super.windowClosing(e);
                        System.exit(0);
         public E getDatabaseLocation() {
                return databaseLocation;
         protected abstract E prepareLocation();
         protected abstract JPanel prepareForm();
          * Action for selecting location.
          * @author spyboost
         private class SelectLocationAction extends AbstractAction {
              private static final long serialVersionUID = 6242940810223013690L;
              public SelectLocationAction() {
                   putValue(Action.NAME, "Select");
              @Override
              public void actionPerformed(ActionEvent e) {
                   databaseLocation = prepareLocation();
                   setVisible(false);
         private class CancelSelectAction extends AbstractAction {
              private static final long serialVersionUID = -1025433106273231228L;
              public CancelSelectAction() {
                   putValue(Action.NAME, "Cancel");
              @Override
              public void actionPerformed(ActionEvent e) {
                   System.exit(0);
    }Code for ChooseLocalFileDialog
    public class ChooseLocalFileDialog extends ChooseLocationDialog<String> {
         private JTextField fileTextField;
         private static final long serialVersionUID = 2232230394481975840L;
         @Override
         protected JPanel prepareForm() {
              JPanel panel = new JPanel();
              panel.add(new JLabel("File"));
              fileTextField = new JTextField(15);
              panel.add(fileTextField);
              return panel;
         @Override
         protected String prepareLocation() {
              String location = fileTextField.getText();
              return location;
    }Code for ChooseRemoteLocationDialog
    public class ChooseRemoteLocationDialog extends
              ChooseLocationDialog<RemoteLocation> {
         private JTextField hostField;
         private JTextField portField;
         private static final long serialVersionUID = -2282249521568378092L;
         @Override
         protected JPanel prepareForm() {
              JPanel panel = new JPanel(new GridLayout(2, 2));
              panel.add(new JLabel("Host"));
              hostField = new JTextField(15);
              panel.add(hostField);
              panel.add(new JLabel("Port"));
              portField = new JTextField(15);
              panel.add(portField);
              return panel;
         @Override
         protected RemoteLocation prepareLocation() {
              String host = hostField.getText();
              int port = 0;
              try {
                   String portText = portField.getText();
                   port = Integer.getInteger(portText);
              } catch (NumberFormatException e) {
                   e.printStackTrace();
              RemoteLocation location = new RemoteLocation(host, port);
              return location;
    }Code for RemoteLocation:
    public class RemoteLocation {
         private String host;
         private int port;
         public RemoteLocation() {
              super();
         public RemoteLocation(String host, int port) {
              super();
              this.host = host;
              this.port = port;
         public String getHost() {
              return host;
         public void setHost(String host) {
              this.host = host;
         public int getPort() {
              return port;
         public void setPort(int port) {
              this.port = port;
    }Code snippet for dialog usage in local client implementation:
    final ChooseLocationDialog<String> dialog = new ChooseLocalFileDialog();
    dialog.setVisible(true);
    location = dialog.getDatabaseLocation();
    String filePath = location;Code snippet for dialog usage in network client implementation:
    final ChooseLocationDialog<RemoteLocation> dialog = new ChooseRemoteLocationDialog();
    dialog.setVisible(true);
    RemoteLocation location = dialog.getDatabaseLocation();Exception that I'm getting:
    Exception occurred during event dispatching:
    java.lang.NullPointerException
         at suncertify.client.gui.dialog.ChooseRemoteLocationDialog.prepareLocation(ChooseRemoteLocationDialog.java:42)
         at suncertify.client.gui.dialog.ChooseRemoteLocationDialog.prepareLocation(ChooseRemoteLocationDialog.java:1)
         at suncertify.client.gui.dialog.ChooseLocationDialog$SelectLocationAction.actionPerformed(ChooseLocationDialog.java:87)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
         at java.awt.Component.processMouseEvent(Component.java:6134)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
         at java.awt.Component.processEvent(Component.java:5899)
         at java.awt.Container.processEvent(Container.java:2023)
         at java.awt.Component.dispatchEventImpl(Component.java:4501)
         at java.awt.Container.dispatchEventImpl(Container.java:2081)
         at java.awt.Component.dispatchEvent(Component.java:4331)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4301)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3965)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3895)
         at java.awt.Container.dispatchEventImpl(Container.java:2067)
         at java.awt.Window.dispatchEventImpl(Window.java:2458)
         at java.awt.Component.dispatchEvent(Component.java:4331)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:178)
         at java.awt.Dialog$1.run(Dialog.java:1046)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)java version "1.6.0"
    OpenJDK Runtime Environment (build 1.6.0-b09)
    OpenJDK Client VM (build 1.6.0-b09, mixed mode, sharing)
    OS: Ubuntu 8.04
    Appreciate any help.
    Thanks.
    Edited by: spyboost on Jul 24, 2008 5:38 PM

    What a silly error! I have to call Integer.parseInt instead of getInt. Integer.getInt tries to find a system property. A small misprint, but a huge amount of time to debug. I always use parseInt method and couldn't even notice that silly misprint. Sometimes it's useful to see the trees instead of whole forest :)
    It works perfectly. Sorry for disturbing.

  • Potential Thread Problem with JVM (1.4.2_05)

    This junit test fails on 1.4.2_05 (running on Windows XP), is there a problem with the code or the JVM?
    public class BadJVMTest extends junit.framework.TestCase {
      static byte[] b = new byte[] { -1, 1 };
      public int m2(int offset) {
        while (true) {
          if (b[offset] >= 0)
            return offset + 1;
          offset++;
      class Inner {
        int fOffset = 0;
        public void m1() {
          fOffset = m2(fOffset);
          if (fOffset == 0)
            throw new RuntimeException("Internal Error.");
      private class ReadThread extends Thread {
        int failed = 0;
        public void run() {
          for (int i = 0; i < 100000; i++) {
            try {
              new Inner().m1();
            } catch (Throwable t) {
              failed++;
              System.err.println("Problem on call number " + (i + 1) + " (" + t + ")");
      public void test() throws Exception {
        int numOfThreads = 100;
        ReadThread threads[] = new ReadThread[numOfThreads];
        for (int i = 0; i < numOfThreads; i++) {
          threads[i] = new ReadThread();
          threads.start();
    for (int i = 0; i < numOfThreads; i++) {
    threads[i].join();
    for (int i = 0; i < numOfThreads; i++) {
    assertEquals(0, threads[i].failed);

    Nothing jumps out at me about the code (other than
    its general convolutedness, which I assume you're
    aware of).
    What, exactly, are you observing? I assume it's that
    fOffset is zero after calling m2(), so you're
    throwing the RTE, right?Which does look like a bug to me, however, there are parts of nested class arcania that are beyond my paltry knowledge, so I may be basing that on faulty assumptions.

  • Problem with JDialog box

    Hi Guys,
    I have a problem with the JDialog box. The close button (Cross mark of the box) is not displayed when I was trying to use my custom LookAndFeel and Custom theme. I am pasting the code sample here.
    import java.awt.Color;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import javax.swing.Icon;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.LookAndFeel;
    import javax.swing.SwingUtilities;
    import javax.swing.UIDefaults;
    import javax.swing.UIManager;
    import javax.swing.plaf.ColorUIResource;
    import com.jgoodies.looks.plastic.Plastic3DLookAndFeel;
    import com.jgoodies.looks.plastic.PlasticTheme;
    import com.medplexus.looks.plastic.theme.SkyGreen;
    public class TestTheDialog implements ActionListener {
    JFrame mainFrame = null;
    JButton myButton = null;
    public TestTheDialog() {
    mainFrame = new JFrame("TestTheDialog Tester");
    mainFrame.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {System.exit(0);}
    try{
         MyLookAndFeel.setCurrentTheme(new CustomLaF());
         UIManager.setLookAndFeel(new MyLookAndFeel());
         SwingUtilities.updateComponentTreeUI(mainFrame);
         CustomDialog cd = new CustomDialog();
         cd.setDefaultLookAndFeelDecorated(true);
    catch(Exception e){
    myButton = new JButton("Test the dialog!");
    myButton.addActionListener(this);
    mainFrame.setLocationRelativeTo(null);
    mainFrame.getContentPane().add(myButton);
    mainFrame.setSize(200, 150);
    //mainFrame.pack();
    mainFrame.setVisible(true);
    public void actionPerformed(ActionEvent e) {
    if(myButton == e.getSource()) {
    System.err.println("Opening dialog.");
    CustomDialog myDialog = new CustomDialog(mainFrame, true, "Do you like Java?");
    System.err.println("After opening dialog.");
    if(myDialog.getAnswer()) {
    System.err.println("The answer stored in CustomDialog is 'true' (i.e. user clicked yes button.)");
    else {
    System.err.println("The answer stored in CustomDialog is 'false' (i.e. user clicked no button.)");
    static class CustomLaF extends PlasticTheme {
    protected ColorUIResource getPrimary1() {
    return new ColorUIResource(255,128,0);
    public ColorUIResource getPrimary2() {
              return (new ColorUIResource(Color.white));
         public ColorUIResource getPrimary3() {
              return (new ColorUIResource(255,128,0));
    public ColorUIResource getPrimaryControl() {
    return new ColorUIResource(Color.GREEN);
    protected ColorUIResource getSecondary1() {
    return new ColorUIResource(Color.CYAN);
    protected ColorUIResource getSecondary2() {
              return (new ColorUIResource(Color.gray));
         protected ColorUIResource getSecondary3() {
              return (new ColorUIResource(235,235,235));
         protected ColorUIResource getBlack() {
              return BLACK;
         protected ColorUIResource getWhite() {
              return WHITE;
         private Object getIconResource(String s) {
    return LookAndFeel.makeIcon(getClass(), s);
    private Icon getHastenedIcon(String s, UIDefaults uidefaults) {
    Object obj = getIconResource(s);
    return (Icon) ((javax.swing.UIDefaults.LazyValue) obj).createValue(uidefaults);
    static class MyLookAndFeel extends Plastic3DLookAndFeel {
              protected void initClassDefaults(UIDefaults table) {
                   super.initClassDefaults(table);
              protected void initComponentDefaults(UIDefaults table) {
                   super.initComponentDefaults(table);
                   Object[] defaults = {
                             "MenuItem.foreground",new ColorUIResource(Color.white),
                             "MenuItem.background",new ColorUIResource(Color.gray),
                             "MenuItem.selectionForeground",new ColorUIResource(Color.gray),
                             "MenuItem.selectionBackground",new ColorUIResource(Color.white),
                             "Menu.selectionForeground", new ColorUIResource(Color.white),
                             "Menu.selectionBackground", new ColorUIResource(Color.gray),
                             "MenuBar.background", new ColorUIResource(235,235,235),
                             "Menu.background", new ColorUIResource(235,235,235),
                             "Desktop.background",new ColorUIResource(235,235,235),
                             "Button.select",new ColorUIResource(255,128,0),
                             "Button.focus",new ColorUIResource(255,128,0),
                             "TableHeader.background", new ColorUIResource(255,128,0),
                             "TableHeader.foreground", new ColorUIResource(Color.white),
                             "ScrollBar.background", new ColorUIResource(235,235,235),
                             "OptionPane.questionDialog.border.background", new ColorUIResource(Color.gray),
                             "OptionPane.errorDialog.titlePane.foreground", new ColorUIResource(Color.white),
                             "OptionPane.questionDialog.titlePane.background", new ColorUIResource(255,128,0),
                             "InternalFrame.borderColor", new ColorUIResource(Color.gray),
                             "InternalFrame.activeTitleForeground", new ColorUIResource(Color.white),
                             "InternalFrame.activeTitleBackground", new ColorUIResource(Color.gray),
                             "InternalFrame.borderColor", new ColorUIResource(Color.white),
                             "Table.selectionBackground",new ColorUIResource(255,128,0)
                   table.putDefaults(defaults);
    public static void main(String argv[]) {
    TestTheDialog tester = new TestTheDialog();
    package CustomThemes;
    import javax.swing.JDialog;
    import java.awt.event.ActionListener;
    import javax.swing.JPanel;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JButton;
    import java.awt.event.ActionEvent;
    public class CustomDialog extends JDialog implements ActionListener {
    private JPanel myPanel = null;
    private JButton yesButton = null;
    private JButton noButton = null;
    private boolean answer = false;
    public boolean getAnswer() { return answer; }
    public CustomDialog(){
    public CustomDialog(JFrame frame, boolean modal, String myMessage) {
    super(frame, modal);
    setTitle("Guess?");
    myPanel = new JPanel();
    getContentPane().add(myPanel);
    myPanel.add(new JLabel(myMessage));
    yesButton = new JButton("Yes");
    yesButton.addActionListener(this);
    myPanel.add(yesButton);
    noButton = new JButton("No");
    noButton.addActionListener(this);
    myPanel.add(noButton);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    pack();
    setLocationRelativeTo(frame);
    setVisible(true);
    public void actionPerformed(ActionEvent e) {
    if(yesButton == e.getSource()) {
    System.err.println("User chose yes.");
    answer = true;
    setVisible(false);
    else if(noButton == e.getSource()) {
    System.err.println("User chose no.");
    answer = false;
    setVisible(false);
    Thanks and Regards
    Kumar.

    Hi All,
    I am using the JGoodies Look and feel (looks2.0.1.jar). I wrote my own custom LookAndFeel and Theme , but the problem with this is the JDialog/JOptionPane dialog boxes are displayed with out the close button (cross button on the titlebar).
    I am pasting the code here.
    import java.awt.Color;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import javax.swing.Icon;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.LookAndFeel;
    import javax.swing.SwingUtilities;
    import javax.swing.UIDefaults;
    import javax.swing.UIManager;
    import javax.swing.plaf.ColorUIResource;
    import com.jgoodies.looks.plastic.Plastic3DLookAndFeel;
    import com.jgoodies.looks.plastic.PlasticTheme;
    import com.medplexus.looks.plastic.theme.SkyGreen;
    public class TestTheDialog implements ActionListener {
        JFrame mainFrame = null;
        JButton myButton = null;
        public TestTheDialog() {
            mainFrame = new JFrame("TestTheDialog Tester");
            mainFrame.addWindowListener(new WindowAdapter() {
                    public void windowClosing(WindowEvent e) {System.exit(0);}
            try{
                 MyLookAndFeel.setCurrentTheme(new CustomLaF());
                 UIManager.setLookAndFeel(new MyLookAndFeel());
                 //Plastic3DLookAndFeel.setCurrentTheme(new SkyGreen());
                 //UIManager.setLookAndFeel(new Plastic3DLookAndFeel());
                 SwingUtilities.updateComponentTreeUI(mainFrame);
                 CustomDialog cd = new CustomDialog();
                 cd.setDefaultLookAndFeelDecorated(true);
            catch(Exception e){
            myButton = new JButton("Test the dialog!");
            myButton.addActionListener(this);
            mainFrame.setLocationRelativeTo(null);
            mainFrame.getContentPane().add(myButton);
            mainFrame.setSize(200, 150);
            //mainFrame.pack();
            mainFrame.setVisible(true);
        public void actionPerformed(ActionEvent e) {
            if(myButton == e.getSource()) {
                System.err.println("Opening dialog.");
                CustomDialog myDialog = new CustomDialog(mainFrame, true, "Do you like Java?");
                System.err.println("After opening dialog.");
                if(myDialog.getAnswer()) {
                    System.err.println("The answer stored in CustomDialog is 'true' (i.e. user clicked yes button.)");
                else {
                    System.err.println("The answer stored in CustomDialog is 'false' (i.e. user clicked no button.)");
        static class CustomLaF extends PlasticTheme {
            protected ColorUIResource getPrimary1() {
              return new ColorUIResource(255,128,0);
            public ColorUIResource getPrimary2() {
                  return (new ColorUIResource(Color.white));
             public ColorUIResource getPrimary3() {
                  return (new ColorUIResource(255,128,0));
            public ColorUIResource getPrimaryControl() {
              return new ColorUIResource(Color.GREEN);
            protected ColorUIResource getSecondary1() {
              return new ColorUIResource(Color.CYAN);
            protected ColorUIResource getSecondary2() {
                  return (new ColorUIResource(Color.gray));
             protected ColorUIResource getSecondary3() {
                  return (new ColorUIResource(235,235,235));
             protected ColorUIResource getBlack() {
                  return BLACK;
             protected ColorUIResource getWhite() {
                  return WHITE;
             private Object getIconResource(String s) {
                return LookAndFeel.makeIcon(getClass(), s);
            private Icon getHastenedIcon(String s, UIDefaults uidefaults) {
                Object obj = getIconResource(s);
                return (Icon) ((javax.swing.UIDefaults.LazyValue) obj).createValue(uidefaults);
          static class MyLookAndFeel extends Plastic3DLookAndFeel {
                  protected void initClassDefaults(UIDefaults table) {
                       super.initClassDefaults(table);
                  protected void initComponentDefaults(UIDefaults table) {
                       super.initComponentDefaults(table);
                       Object[] defaults = {
                                 "MenuItem.foreground",new ColorUIResource(Color.white),
                                 "MenuItem.background",new ColorUIResource(Color.gray),
                                 "MenuItem.selectionForeground",new ColorUIResource(Color.gray),
                                 "MenuItem.selectionBackground",new ColorUIResource(Color.white),
                                 "Menu.selectionForeground", new ColorUIResource(Color.white),
                                 "Menu.selectionBackground", new ColorUIResource(Color.gray),
                                 "MenuBar.background", new ColorUIResource(235,235,235),
                                 "Menu.background", new ColorUIResource(235,235,235),
                                 "Desktop.background",new ColorUIResource(235,235,235),
                                 "Button.select",new ColorUIResource(255,128,0),
                                 "Button.focus",new ColorUIResource(255,128,0),
                                 "TableHeader.background", new ColorUIResource(255,128,0),
                                 "TableHeader.foreground", new ColorUIResource(Color.white),
                                 "ScrollBar.background",  new ColorUIResource(235,235,235),
                                 "OptionPane.questionDialog.border.background", new ColorUIResource(Color.gray),
                                 "OptionPane.errorDialog.titlePane.foreground", new ColorUIResource(Color.white),
                                 "OptionPane.questionDialog.titlePane.background", new ColorUIResource(255,128,0),
                                 "InternalFrame.borderColor", new ColorUIResource(Color.gray),
                                 "InternalFrame.activeTitleForeground", new ColorUIResource(Color.white),
                                 "InternalFrame.activeTitleBackground", new ColorUIResource(Color.gray),
                                 "InternalFrame.borderColor", new ColorUIResource(Color.white),
                                 "Table.selectionBackground",new ColorUIResource(255,128,0)
                       table.putDefaults(defaults);
        public static void main(String argv[]) {
            TestTheDialog tester = new TestTheDialog();
    import javax.swing.JDialog;
    import java.awt.event.ActionListener;
    import javax.swing.JPanel;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JButton;
    import java.awt.event.ActionEvent;
    public class CustomDialog extends JDialog implements ActionListener {
        private JPanel myPanel = null;
        private JButton yesButton = null;
        private JButton noButton = null;
        private boolean answer = false;
        public boolean getAnswer() { return answer; }
        public CustomDialog(){
        public CustomDialog(JFrame frame, boolean modal, String myMessage) {
            super(frame, modal);
            setTitle("Guess?");
            myPanel = new JPanel();
            getContentPane().add(myPanel);
            myPanel.add(new JLabel(myMessage));
            yesButton = new JButton("Yes");
            yesButton.addActionListener(this);
            myPanel.add(yesButton);       
            noButton = new JButton("No");
            noButton.addActionListener(this);
            myPanel.add(noButton);
            setDefaultCloseOperation(EXIT_ON_CLOSE);
            pack();
            setLocationRelativeTo(frame);
            setVisible(true);
        public void actionPerformed(ActionEvent e) {
            if(yesButton == e.getSource()) {
                System.err.println("User chose yes.");
                answer = true;
                setVisible(false);
            else if(noButton == e.getSource()) {
                System.err.println("User chose no.");
                answer = false;
                setVisible(false);
    }Thanks and Regards
    Kumar.

  • Memory problem with JTextFields

    Hello,
    I have a wierd problem with JTextField and the memory.
    I need to fill a JPanel with different Components (including JTextFields), then do some calculation, remove the Components and filling the JPanel again.
    When i so this too often my i get an OutOfMemory Exception. I narrowed to problem down and wrote a small sample program to demonstrate the problem.
    When i call the method doIT (where the Panel is repeatedly filled) from the main-function everything works fine, but when it is called as a result from the GUI-Button-Event the memory for the JTextFields is not freed (even the call of the Garbage collector changes nothing)
    When i only use JButtons to fill the Panel everything works fine.
    Has anyone an idea why this problem occurs and how i can work around it?
    [Edit] I tested it whith java 1.5.0_06, 1.5.0_11, 1.6.0_02
    Thanks
    Marc
    import java.awt.Frame;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.lang.management.ManagementFactory;
    import java.lang.management.MemoryUsage;
    import javax.swing.JButton;
    import javax.swing.JDialog;
    import javax.swing.JPanel;
    import javax.swing.JTextField;
    public class MemoryTestDLG extends JDialog {
         public MemoryTestDLG(Frame owner) {
              // create Dialog with one Button that calls the testMethod
              super(owner);
              JButton b = new JButton("doIT ...");
              b.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        doIT();
                        setVisible(false);
              getContentPane().add(b);
              pack();
         public void doIT() {
              // Testmethod that fills a JPanel 20 times with Components and clears it
              // again
              JPanel p = new JPanel();
              long memUse1 = 0;
              long memUse2 = 0;
              long memUseTemp = 0;
              for (int count = 0; count < 20; count++) {
                   // Clear the panel
                   p.removeAll();
                   // Get memory usage before the task
                   Runtime.getRuntime().gc();
                   memUse1 = ManagementFactory.getMemoryMXBean().getHeapMemoryUsage()
                             .getUsed();
                   // Fill Panel with components
                   for (int i = 0; i < 200; i++) {
                        // The Buttons seem to be released without any problem
                        p.add(new JButton("test" + Math.random()));
                        // JTextFields are not released when used from the dialog.
                        p.add(new JTextField("test " + Math.random()));
                   // get memory usage after the task
                   Runtime.getRuntime().gc();
                   memUseTemp = memUse2;
                   memUse2 = ManagementFactory.getMemoryMXBean().getHeapMemoryUsage()
                             .getUsed();
                   // print Memory results
                   System.out.println("Memory Usage: " + f(memUse1) + "   ->"
                             + f(memUse2) + " [ Used:" + f(memUse2 - memUse1)
                             + " ] [ Freed: " + f(memUseTemp - memUse1) + "]");
         public String f(long m) // formats the output
              String s = "" + m;
              while (s.length() < 8)
                   s = " " + s;
              return s;
         public static void main(String[] args) {
              MemoryTestDLG d = new MemoryTestDLG(null);
              System.out
                        .println("------------------ Direct Call (all is OK) -------------------");
              d.doIT(); // Memory is freed with every call to JPanel.removeAll()
              System.out
                        .println("------------ Call from Dialog (memory is not freed) -------------");
              // The Memory keeps blocked
              d.setModal(true);
              d.setVisible(true);
              System.exit(0);
    }Message was edited by:
    marcvomorc

    Thank you for your answer,
    In this sample the programm does not run out of memory. But when you look at the output you see, that in the first run (direct call) the memory ist freed immediately when tha panel is cleared but in the second run (from the Button) the memory usage is getting bigger and bigger. Wenn you change the number of components to 2000 (4000)
    // Fill Panel with components
            for (int i = 0; i < 2000; i++) {
                // The Buttons seem to be released without any problem
    //... ...and use the default memory settings (69mb heap) the programm runns out of memory.
    I get the following output:
    ------------------ Direct Call (all is OK) -------------------
    Memory Usage:   445504   -> 8121016 [ Used: 7675512 ] [ Freed:  -445504]
    Memory Usage:   617352   -> 8114336 [ Used: 7496984 ] [ Freed:  7503664]
    Memory Usage:   810488   -> 8491768 [ Used: 7681280 ] [ Freed:  7303848]
    Memory Usage:   943704   -> 8114976 [ Used: 7171272 ] [ Freed:  7548064]
    Memory Usage:   836760   -> 8505072 [ Used: 7668312 ] [ Freed:  7278216]
    Memory Usage:   978352   -> 8114784 [ Used: 7136432 ] [ Freed:  7526720]
    Memory Usage:   835552   -> 8498288 [ Used: 7662736 ] [ Freed:  7279232]
    Memory Usage:   977096   -> 8114312 [ Used: 7137216 ] [ Freed:  7521192]
    Memory Usage:   835640   -> 8498376 [ Used: 7662736 ] [ Freed:  7278672]
    Memory Usage:   977296   -> 8115000 [ Used: 7137704 ] [ Freed:  7521080]
    Memory Usage:   835392   -> 8504872 [ Used: 7669480 ] [ Freed:  7279608]
    Memory Usage:   976968   -> 8115192 [ Used: 7138224 ] [ Freed:  7527904]
    Memory Usage:   836224   -> 8501624 [ Used: 7665400 ] [ Freed:  7278968]
    Memory Usage:   977840   -> 8115120 [ Used: 7137280 ] [ Freed:  7523784]
    Memory Usage:   835664   -> 8498256 [ Used: 7662592 ] [ Freed:  7279456]
    Memory Usage:   976856   -> 8114384 [ Used: 7137528 ] [ Freed:  7521400]
    Memory Usage:   835784   -> 8502848 [ Used: 7667064 ] [ Freed:  7278600]
    Memory Usage:   977360   -> 8114592 [ Used: 7137232 ] [ Freed:  7525488]
    Memory Usage:   835496   -> 8502720 [ Used: 7667224 ] [ Freed:  7279096]
    Memory Usage:   976440   -> 8115128 [ Used: 7138688 ] [ Freed:  7526280]
    ------------ Call from Dialog (memory is not freed) -------------
    Memory Usage:   866504   -> 8784320 [ Used: 7917816 ] [ Freed:  -866504]
    Memory Usage:  7480760   ->14631152 [ Used: 7150392 ] [ Freed:  1303560]
    Memory Usage: 14245264   ->22127104 [ Used: 7881840 ] [ Freed:   385888]
    Memory Usage: 19302896   ->27190744 [ Used: 7887848 ] [ Freed:  2824208]
    Memory Usage: 27190744   ->35073944 [ Used: 7883200 ] [ Freed:        0]
    Memory Usage: 31856624   ->39740176 [ Used: 7883552 ] [ Freed:  3217320]
    Memory Usage: 39740176   ->47623040 [ Used: 7882864 ] [ Freed:        0]
    Memory Usage: 44410480   ->52293864 [ Used: 7883384 ] [ Freed:  3212560]
    Memory Usage: 52293864   ->58569304 [ Used: 6275440 ] [ Freed:        0]
    Memory Usage: 58569304   ->64846400 [ Used: 6277096 ] [ Freed:        0]
    Exception occurred during event dispatching:
    java.lang.OutOfMemoryError: Java heap spacewhen I outcomment the adding of the JButtons the amount of freed memory is 0 in the second run. So my guess is, that there is a problem with freeing the memory for the JTextFields.
    Memory Usage:   447832   -> 6509960 [ Used: 6062128 ] [ Freed:  6332768]
    Memory Usage:   722776   -> 6785632 [ Used: 6062856 ] [ Freed:  5787184]
    ------------ Call from Dialog (memory is not freed) -------------
    Memory Usage:   468880   -> 6770240 [ Used: 6301360 ] [ Freed:  -468880]
    Memory Usage:  6770240   ->13016264 [ Used: 6246024 ] [ Freed:        0]
    Memory Usage: 13016264   ->19297080 [ Used: 6280816 ] [ Freed:        0]
    Memory Usage: 19297080   ->25570152 [ Used: 6273072 ] [ Freed:        0]
    Memory Usage: 25570152   ->31849160 [ Used: 6279008 ] [ Freed:        0]
    Memory Usage: 31849160   ->38124368 [ Used: 6275208 ] [ Freed:        0]
    Memory Usage: 38124368   ->44402072 [ Used: 6277704 ] [ Freed:        0]
    Memory Usage: 44402072   ->50677928 [ Used: 6275856 ] [ Freed:        0]
    Memory Usage: 50677928   ->56955880 [ Used: 6277952 ] [ Freed:        0]
    Memory Usage: 56955880   ->63232152 [ Used: 6276272 ] [ Freed:        0]
    Exception occurred during event dispatching:
    java.lang.OutOfMemoryError: Java heap spaceAdditionally the JPanel I am using is not displayed on the screen. It stays invisible the whole time, but i cannot work around that, because the calculation is depending on the values being in components on the JPanel)
    Marc

  • Is there a problem with JFrame and window listeners?

    As the subject implies, i'm having a problem with my JFrame window and the window listeners. I believe i have implemented it properly (i copied it from another class that works). Anyway, none of the events are caught and i'm not sure why. Here's the code
    package gcas.gui.plan;
    import java.awt.BorderLayout;
    import java.awt.Component;
    import java.awt.Container;
    import java.awt.event.WindowEvent;
    import java.awt.event.WindowListener;
    import java.util.Hashtable;
    import javax.swing.JDialog;
    import javax.swing.JFrame;
    import gcas.plandata.TaskData;
    import gcas.util.GCASProperties;
    import gcas.gui.planlist.MainPanel;
    * MainFrame extends JPanel and is the main class for the plan details window
    public class MainFrame extends JFrame implements WindowListener
         * the container for this window
        private Container contentPane;
         * a string value containing the name of the plan being viewed
        private String labelText;
         * a string value containing the name of the window (GCAS - plan list)
        private static String title;
         * an instance of JDialog class
        private static MainFrame dialog;
         * hashTable that correlates the task name to its id as found in the
         * plan
        private Hashtable taskNameToId = new Hashtable();
         * an instance of taskSetPane.  This is the current instance of taskSetPane
         * being viewed
        private PlanTaskSet currentPane;
         * instance of TaskData class.  Each instance will hold information on
         * an individual task
        private TaskData taskData;
         * hashTable containing instances of the taskSetPane class
        private Hashtable taskSetPanes = new Hashtable();
         * an instance of the OuterPanel class
        OuterPanel mainPanel;
         * an instance of the ButtonPanel class
        ButtonPanel buttonsPanel;
         * an instance of the LeftPanel class
        LeftPanel leftPanel;
         * an instance of the the GCASProperties class
        GCASProperties gcasProps;
        private static MainFrame thisPlanMain = null;
        private MainPanel planListMain;
         * constructor for MainFrame
         * @param frame the parent frame calling this class
         * @param locationComp the location of the component that initiated the opening of the dialog
         * @param labelText the name of the plan that is being viewed
         * @param title title of window
        private MainFrame(JFrame frame, Component locationComp, String labelText,
                String title)
            super(title);
            gcasProps = GCASProperties.getInstance();
            mainPanel = new OuterPanel(labelText, currentPane,
                    taskNameToId, taskSetPanes);
            leftPanel = mainPanel.getLeftPanel();
            System.out.println("LABLE: " + labelText);
            leftPanel.setMainPanelContents();
            buttonsPanel = new ButtonPanel(labelText, taskSetPanes,
                    taskNameToId, leftPanel);
            contentPane = getContentPane();
            contentPane.add(mainPanel, BorderLayout.CENTER);
            contentPane.add(buttonsPanel, BorderLayout.PAGE_END);
            this.addWindowListener(this);
            this.labelText = labelText;
            pack();
            setLocationRelativeTo(locationComp);
            this.setVisible(true);
            planListMain = MainPanel.getInstance();
            planListMain.setVisible(false);
        public static MainFrame getInstance(JFrame frame, Component locationComp, String labelText,
                String title)
            if (thisPlanMain == null)
                thisPlanMain = new MainFrame(frame, locationComp, labelText,
                        title);
            return thisPlanMain;
        public static MainFrame getDialogObject()
        {   //from the location this is called (ButtonPanel), this will never
            //be null
            return thisPlanMain;
        public static void setABMDDialogNull()
            thisPlanMain = null;
         * returns an instance of MainFrame
         * @return MainFrame instance
        public static MainFrame getDialog()
            return dialog;
         * setter for MainFrame
         * @param aDialog a MainFrame instance
        public static void setDialog(MainFrame aDialog)
            dialog = aDialog;
         * window opened event
         * @param windowEvent the window event passed to this method
        public void windowOpened(WindowEvent windowEvent)
         * The window event when a window is closing
         * @param windowEvent the window event passed to this method
        public void windowClosing(WindowEvent windowEvent)
            gcasProps.storeProperties("PlanList");
            MainPanel abmd = MainPanel.getInstance();
    //        planMain = this.getDialogObject();
    //        if(planMain != null)
    //            planMain.setVisible(false);
    //            abmd.setVisible(true);
    //            planMain.setABMDDialogNull();
            if(this.getDialogObject()!= null)
                abmd.setVisible(true);
                setVisible(false);
                setABMDDialogNull(); 
         * Invoked when the Window is set to be the active Window
         * @param windowEvent the window event passed to this method
        public void windowActivated(WindowEvent windowEvent)
         * Invoked when a window has been closed as the result of calling dispose on the window
         * @param windowEvent the window event passed to this method
        public void windowClosed(WindowEvent windowEvent)
         * Invoked when a Window is no longer the active Window
         * @param windowEvent the window event passed to this method
        public void windowDeactivated(WindowEvent windowEvent)
            System.out.println("HI");
         * Invoked when a window is changed from a minimized to a normal state
         * @param windowEvent the window event passed to this method
        public  void windowDeiconified(WindowEvent windowEvent)
            //we could have code here that changed the way alerts are done
           System.out.println("Invoked when a window is changed from a minimized to a normal state.");
         * Invoked when a window is changed from a normal to a minimized state
         * @param windowEvent the window event passed to this method
        public  void windowIconified(WindowEvent windowEvent)
            //we could have code here that changed the way alerts are done
    //        System.out.println("Invoked when a window is changed from a normal to a minimized state.");
    }anyone know whats wrong?

    It turned out that my ide was running the old jar and not updating it, so no matter what code i added, it wasn't being seen. Everything should be fine now.

  • Problems with java j2re using mozilla

    Hi,
    i'm using j2re1.4.2_05 plugin for mozilla in linux (Fedora Core 2). My internet access goes throught a router (SMC Networks ISDN Barricade SMC7301TA). It's settings can be edited throught a web browser LAN connection. And here the problems begin. On routers settings page a java output console (for error and other messages) is running, which doesn't work, despite java applications on other web pages work well (I tested it on sun's java test page and it's working properly). Java console exits the following errorr message:
    >
    load: class DynamicTable.class not found.
    java.lang.ClassNotFoundException: DynamicTable.class
         at sun.applet.AppletClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadCode(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.plugin.AppletViewer.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.IOException: open HTTP connection failed.
         at sun.applet.AppletClassLoader.getBytes(Unknown Source)
         at sun.applet.AppletClassLoader.access$100(Unknown Source)
         at sun.applet.AppletClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         ... 10 more
    Is there a way to fix this problem? Cause without the command output it's mearly unpossible to configure the router.

    Yes i can make changes. Not everything is realised with java, just the output console, which reports if the changes i made succeded, prints out logs, gives additional info about some settings etc. So, i can make changes, but i have no response, for example: everytime i save something i don't know if the save was succesful. I can't take a look at IP routing table and DHCP configuration...
    On windows xp, using internet explorer (the default version for xp) everything works perfect. But mozilla for windows has also problems with java. I know i can still change settings on wins, but right now i'm having some problems with networking on linux and i have to set things up in it (besides i use wins only because of school purposes).

  • [GNOME] problem with gvfsd-metada

    I have problems with gvfs. My computer sometimes crash. I already have upgraded gvfs to version 1.5 but still the same. Can someone help me?
    >everything.log
    Nov 18 01:47:51 myhost NetworkManager: <info> Activation (eth0) Stage 5 of 5 (IP Configure Commit) complete.
    Nov 18 01:48:47 myhost kernel: gvfsd-metadata[2171]: segfault at 8 ip 0804c9ba sp bfef3b40 error 4 in gvfsd-metadata[8048000+b000]
    Nov 18 02:10:17 myhost -- MARK --
    Nov 18 02:11:18 myhost kernel: gvfsd-metadata[16155]: segfault at 8 ip 0804c9ba sp bfbc7650 error 4 in gvfsd-metadata[8048000+b000]
    Nov 18 02:16:37 myhost kernel: gvfsd-metadata[30265]: segfault at 8 ip 0804c9ba sp bf841b60 error 4 in gvfsd-metadata[8048000+b000]
    Nov 18 02:26:09 myhost kernel: gvfsd-metadata[13060]: segfault at 8 ip 0804c9ba sp bf85a740 error 4 in gvfsd-metadata[8048000+b000]
    Nov 18 02:53:58 myhost kernel: gvfsd-metadata[18275]: segfault at 8 ip 0804c9ba sp bff7fea0 error 4 in gvfsd-metadata[8048000+b000]
    Nov 18 02:55:03 myhost kernel: gvfsd-metadata[21812]: segfault at 8 ip 0804c9ba sp bffdb110 error 4 in gvfsd-metadata[8048000+b000]
    Nov 18 03:10:37 myhost NetworkManager: <info> (eth0): supplicant connection state: completed -> disconnected
    Nov 18 03:10:37 myhost NetworkManager: <info> (eth0): supplicant connection state: disconnected -> scanning

    Btw, it only happens if you specify that you want JFrame and JDialog decorated:
    setDefaultLookAndFeelDecorated(true)
    As much as I like the new 1.5 Swing decorations I guess I will have to stick to no decorations under Linux.

  • No problem with sdk 1.3- problem with 1.4!!!

    I am trying to make an interface using swing objects..
    The buttons are looking like images (2D) when compiling and running the program with sdk 1.4...
    although if I use 1.3 everything is ok??
    even with the new java version I still have the same problem..
    has anyone any idea how to fix this??
    thx in advance!

    /*                      BET                                 */
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
      * Summary description for BET
    public class BET extends JFrame
         // Variables declaration
         private JLabel jLabel1;
         private JLabel jLabel2;
         private JLabel jLabel3;
         private JTextField jTextField1;
         private JTextField jTextField2;
         private JTextField jTextField3;
         private JTextField jTextField4;
         private JTextField jTextField6;
         private JButton jButton1;
         private JButton jButton2;
         private JPanel contentPane;
         // End of variables declaration
         public BET()
              super();
              initializeComponent();
              // TODO: Add any constructor code after initializeComponent call
              this.setVisible(true);
          * This method is called from within the constructor to initialize the form.
          * WARNING: Do NOT modify this code. The content of this method is always regenerated
          * by the Windows Form Designer. Otherwise, retrieving design might not work properly.
          * Tip: If you must revise this method, please backup this GUI file for JFrameBuilder
          * to retrieve your design properly in future, before revising this method.
         private void initializeComponent()
              jLabel1 = new JLabel();
              jLabel2 = new JLabel();
              jLabel3 = new JLabel();
              jTextField1 = new JTextField();
              jTextField2 = new JTextField();
              jTextField3 = new JTextField();
              jTextField4 = new JTextField();
              jTextField6 = new JTextField();
              jButton1 = new JButton();
              jButton2 = new JButton();
              contentPane = (JPanel)this.getContentPane();
              // jLabel1
              jLabel1.setForeground(new Color(59, 241, 227));
              jLabel1.setText("<HTML><B><U>QUESTION</B><HTML>");
              // jLabel2
              jLabel2.setForeground(new Color(50, 245, 113));
              jLabel2.setText("<HTML><B><U>CHOICE</B><HTML>");
              // jLabel3
              jLabel3.setForeground(new Color(50, 245, 113));
              jLabel3.setText("<HTML><B><U>POINTS</B><HTML>");
              // jTextField1
              jTextField1.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e)
                        jTextField1_actionPerformed(e);
              // jTextField2
              jTextField2.setText("YES");
              jTextField2.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e)
                        jTextField2_actionPerformed(e);
              // jTextField3
              jTextField3.setText("10");
              jTextField3.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e)
                        jTextField3_actionPerformed(e);
              // jTextField4
              jTextField4.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e)
                        jTextField4_actionPerformed(e);
              // jTextField6
              jTextField6.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e)
                        jTextField6_actionPerformed(e);
              // jButton1
              jButton1.setBackground(new Color(117, 158, 145));
              jButton1.setText("OK");
              jButton1.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e)
                        jButton1_actionPerformed(e);
              // jButton2
              jButton2.setBackground(new Color(117, 158, 145));
              jButton2.setText("CANCEL");
              jButton2.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e)
                        jButton2_actionPerformed(e);
              // contentPane
              contentPane.setLayout(null);
              contentPane.setBackground(new Color(67, 97, 83));
              addComponent(contentPane, jLabel1, 172,8,60,18);
              addComponent(contentPane, jLabel2, 73,78,60,18);
              addComponent(contentPane, jLabel3, 211,76,60,18);
              addComponent(contentPane, jTextField1, 9,27,403,28);
              addComponent(contentPane, jTextField2, 24,101,134,22);
              addComponent(contentPane, jTextField3, 203,101,51,22);
              addComponent(contentPane, jTextField4, 21,151,137,22);
              addComponent(contentPane, jTextField6, 18,200,140,22);
              addComponent(contentPane, jButton1, 299,188,80,70);
              addComponent(contentPane, jButton2, 299,90,80,70);
              // BET
              this.setTitle("BET");
              this.setLocation(new Point(-2, 1));
              this.setSize(new Dimension(424, 316));
         /** Add Component Without a Layout Manager (Absolute Positioning) */
         private void addComponent(Container container,Component c,int x,int y,int width,int height)
              c.setBounds(x,y,width,height);
              container.add(c);
         // TODO: Add any appropriate code in the following Event Handling Methods
         private void jTextField1_actionPerformed(ActionEvent e)
              System.out.println("\njTextField1_actionPerformed(ActionEvent e) called.");
              // TODO: Add any handling code here
         private void jTextField2_actionPerformed(ActionEvent e)
              System.out.println("\njTextField2_actionPerformed(ActionEvent e) called.");
              // TODO: Add any handling code here
         private void jTextField3_actionPerformed(ActionEvent e)
              System.out.println("\njTextField3_actionPerformed(ActionEvent e) called.");
              // TODO: Add any handling code here
         private void jTextField4_actionPerformed(ActionEvent e)
              System.out.println("\njTextField4_actionPerformed(ActionEvent e) called.");
              // TODO: Add any handling code here
         private void jTextField6_actionPerformed(ActionEvent e)
              System.out.println("\njTextField6_actionPerformed(ActionEvent e) called.");
              // TODO: Add any handling code here
         private void jButton1_actionPerformed(ActionEvent e)
              System.out.println("\njButton1_actionPerformed(ActionEvent e) called.");
              // TODO: Add any handling code here
         private void jButton2_actionPerformed(ActionEvent e)
              System.out.println("\njButton2_actionPerformed(ActionEvent e) called.");
              // TODO: Add any handling code here
         // TODO: Add any method code to meet your needs in the following area
    //============================= Testing ================================//
    //=                                                                    =//
    //= The following main method is just for testing this class you built.=//
    //= After testing,you may simply delete it.                            =//
    //======================================================================//
         public static void main(String[] args)
              JFrame.setDefaultLookAndFeelDecorated(true);
              JDialog.setDefaultLookAndFeelDecorated(true);
              try
                   UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
              catch (Exception ex)
                   System.out.println("Failed loading L&F: ");
                   System.out.println(ex);
              new BET();
    //= End of Testing =
    This is my code.. the problem is that when i use sdk 1.3 everything is fine... I tried to use 1.4 and now 5 and I have a problem with the appearance of buttons... I have some comments in my code. is just a form with some textfields and labels and the 2 buttons!
    thx in advance

  • Problem with a JList and JScrollpane

    Hi,
    Im having a problem with horizontal scrolling in that I have a simple JList inside a panel and a text box below where the user enters text. Now the text box has a width of 15, but the user can type as many characters as they want..Now the Jlist only displays 15 characters, but the horizontal scroller does not come up, instead just displays for example abcdefghijkl... (the three dots in the end)..
    Isnt my scroller supposed to be automatically scrolling when there is more on the line then the screen displays?? I already have this so far..
    scroller = new JScrollPane(dataList, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);thanks!

    Try the following code:
    package sample;
    import java.awt.*;
    import javax.swing.*;
    public class MyDialog extends JDialog {
      public static void main( String[] args) {
        new MyDialog().setVisible(true);
      JPanel contentPanel = new JPanel();
      JScrollPane scrollPane = new JScrollPane();
      JList list = new JList( new Object[] {"abcdefghijklmnopqrstuvwxyz", "123456789012345678901234567890"});
      public MyDialog() {
        contentPanel.setLayout(new BorderLayout());
        getContentPane().add(contentPanel);
        contentPanel.add(scrollPane, BorderLayout.CENTER);
        scrollPane.getViewport().add(list, null);   
        setSize( 100,100);
        setLocation( 100,100);
    }Michael

  • Problems with JPopupMenu

    Hi :
    I have a problems with a JPopupMenu.
    I have a JTable in a modal JDialog with some rows and I want to make some action with some rows so I make JPopupMenu visible with right click (no problem) but, when it reachs the JDialog border, it appears cut because it can't paint out of JDialog limits.
    What can I do to watch the entire JPopupMenu ? It's urgent.
    Thanks.
    Miquel

    This is because the Popupmenu is a lightweight component (which can't display beyond the borders of the window), try myPopup.setLightWeightPopupEnabled(false); that makes all popups in your app heavyweight.

Maybe you are looking for

  • Sleep problems after 10.9.4 update

    After Mavericks Update 10.9.4 sleep mode are not working properly. My Mac Pro goes to sleep but after a amount of time (sometimes minutes, sometimes seconds) the Mac awakes with black screen (monitors in sleep, the mac not). Pressing mouse or keyboar

  • I can not run corectly of youtube on mozila..and my idm was do not run on mozila too

    the view of youtube on mozila was soo big.. look like error.. i can not sett it for the original size.. i try too reinstall mozila, but i still can not make it.. honestly.. i more like to use mozila than chrome so , i hope, i can get a good result fo

  • System crashes, even after clean install. How to diagnose?

    Hi all, Have been experiencing weird errors with my 2010 MBP, among which infrequent system crashes. I've seen my MBP swallow keypresses of the external Logitech keyboard I use. Replacing it with another (similar) model didn't help. It was getting qu

  • Migrating to staroffice 8

    Hello all, I have just recently setup a sunray server for the school that i work at. I have used solaris 10 11/06 and we are using jds for solaris as our chosen environment. But the install of solaris 10 came with staroffice 7 which is surprising sei

  • Just Upgraded and now NO AUDIO AT ALL

    I just upgraded my Apple TV to the new update that came out today. It took forever to restart, seems like it restarted/installed at least 3 cycles. Finally it started up and looked beautiful. But no audio. Nothing. I have spent over an hour now, rese