Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8268187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:47:23+00:00 2026-06-08T05:47:23+00:00

From another question , I went ahead with a Singleton Observable. Why doesn’t ArticleSelect.update()

  • 0

From another question, I went ahead with a Singleton Observable. Why doesn’t ArticleSelect.update() execute?

package net.bounceme.dur.usenet.swing;

import java.util.Observable;
import java.util.Observer;
import java.util.logging.Logger;
import javax.swing.ListModel;
import net.bounceme.dur.usenet.controller.ArticleDefaultListModel;
import net.bounceme.dur.usenet.controller.Controller;

public class ArticleSelect extends javax.swing.JPanel implements Observer {

    private static final Logger LOG = Logger.getLogger(ArticleSelect.class.getName());
    private Controller controller = Controller.getInstance();
    private ListModel defaultListModel = new ArticleDefaultListModel();

    public ArticleSelect() {
        controller.addObserver(this);
        initComponents();
    }

    /**
     * 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 Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        jList1 = new javax.swing.JList();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTextPane1 = new javax.swing.JTextPane();

        setLayout(new java.awt.BorderLayout());

        jList1.setModel(defaultListModel);
        jScrollPane1.setViewportView(jList1);

        add(jScrollPane1, java.awt.BorderLayout.WEST);

        jScrollPane2.setViewportView(jTextPane1);

        add(jScrollPane2, java.awt.BorderLayout.CENTER);
    }// </editor-fold>
    // Variables declaration - do not modify
    private javax.swing.JList jList1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JTextPane jTextPane1;
    // End of variables declaration

    @Override
    public void update(Observable o, Object arg) {
        LOG.info("trying to observe.." + arg);
        LOG.info(controller.getGroup());
        //update defaultListModel
    }
}

The object which extends Observe invokes notifyObservers from Controller.setGroup():

package net.bounceme.dur.usenet.controller;

import java.util.Observable;
import java.util.logging.Logger;

public class Controller extends Observable {

    private static final Logger LOG = Logger.getLogger(Controller.class.getName());
    private String group;
    private static Controller instance;

    protected Controller() {
    }

    public static Controller getInstance() {
        if (instance == null) {
            instance = new Controller();
        }
        return instance;
    }


    public void setGroup(String selectedValue) {
        group = selectedValue;
        LOG.fine(group);
        notifyObservers();
    }

    public String getGroup() {
        return group;
    }

}

Perhaps ArticleSelect is not properly registered to observe Controller?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T05:47:26+00:00Added an answer on June 8, 2026 at 5:47 am

    java.util.Observable#notifyObservers()

    The update() method is only called if the object is registered as changed with setChanged().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to implement this example http://jsfiddle.net/gzF6w/1/ (from another question here on stak) on
From another question I recently posted, it seems that Classic ASP might not be
Per a great answer from another question I have begun mounting global resources (css/js/images)
I've got the following code from another question on SO to track the changing
From another stackoverflow question, it seems that Android handles large bitmaps differently than other
I found the following regex from another Stack Overflow question: Change an element's class
In another question, a user posted the following reflog: 8c48bab HEAD@{16}: checkout: moving from
This question is related to another question I wrote: Trouble using DOTNET from PHP.
i get the html from another site with file_get_contens , my question is how
This was the question asked in interview. Can we call one constructor from another

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.