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

  • SEARCH
  • Home
  • 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 8256425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:51:35+00:00 2026-06-08T01:51:35+00:00

Here is where the GUI is drawn(note, the class extends JFrame). public Cache() {

  • 0

Here is where the GUI is drawn(note, the class extends JFrame).

public Cache() {
    SubstanceColorChooserUI col = new SubstanceColorChooserUI();
    while (mode == 0);
    setResizable(false);
    setTitle("Cache");
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setBounds(100, 100, 483, 374);
    setLocationRelativeTo(null);
    contentPane = new JPanel();
    contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
    setContentPane(contentPane);
    contentPane.setLayout(new BorderLayout());

    textField = new JTextField();
    textField.setBounds(10, 11, 328, 20);
    contentPane.add(textField);
    textField.setColumns(10);

    JButton btnLoadCache = new JButton("Load cache");
    btnLoadCache.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            try {
                String loc = textField.getText();
                if (loc.equals("")) {
                    JOptionPane.showMessageDialog(Cache.this, "Please specify a location for the cache.", "Unable to load", JOptionPane.ERROR_MESSAGE);
                    return;
                }
                if (!loc.endsWith("\\"))
                    loc = loc + "\\";
                cache = new Store(loc);
                loadImages();
            } catch (Exception e) {
                JOptionPane.showMessageDialog(Cache.this, "Cache failed to initialize.\n" + e.getMessage(), "Unable to load", JOptionPane.ERROR_MESSAGE);
            }
        }
    });
    btnLoadCache.setBounds(351, 9, 112, 23);
    contentPane.add(btnLoadCache);

    JSplitPane splitPane = new JSplitPane();
    splitPane.setDividerLocation(150);
    splitPane.setContinuousLayout(true);
    splitPane.setBounds(10, 44, 453, 279);
    contentPane.add(splitPane);

    JPanel panellie = new JPanel();
    panellie.setLayout(new BorderLayout(0, 0));
    panel = new ImagePanel(null);

    scrollPane_1 = new JScrollPane();
    panellie.add(scrollPane_1, "Center");

    scrollPane_1.setViewportView(panel);
    splitPane.setRightComponent(panellie);

    JPanel panel_1 = new JPanel();
    splitPane.setLeftComponent(panel_1);
    panel_1.setLayout(new BorderLayout(0, 0));

    JScrollPane scrollPane = new JScrollPane();
    panel_1.add(scrollPane, BorderLayout.CENTER);

    model = new DefaultListModel<ListedImage>();
    list = new JList<ListedImage>(model);
    list.addListSelectionListener(new ListSelectionListener() {
        public void valueChanged(ListSelectionEvent arg0) {
            if (arg0.getValueIsAdjusting())
                return;
            ListedImage img = list.getModel().getElementAt(list.getSelectedIndex());
            panel.setImage(img.getImage());
        }
    });
    scrollPane.setViewportView(list);

    progressBar = new JProgressBar();
    progressBar.setStringPainted(true);
    progressBar.setDoubleBuffered(true);
    progressBar.setBounds(10, 328, 453, 14);
    contentPane.add(progressBar);

}

How would I make it so when I setResizeable to true and I start dragging the program to be bigger and smaller, how do I make it so that the components inside of the frame(buttons, labels, etc) resize when the whole Frame is resizes

  • 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-08T01:51:36+00:00Added an answer on June 8, 2026 at 1:51 am

    Use a layout manager instead of setting the bounds for each component.

    It is going to vary from program to program how you want your components to move.

    Take a look at this, and try to see which layout will work best for you.

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

Sidebar

Related Questions

I have a new button in my GUI here is its callback: function ptlNew_ClickedCallback(hObject,
Here's the view: @if (stream.StreamSourceId == 1) { <img class=source src=@Url.Content(~/Public/assets/images/own3dlogo.png) alt= /> }
fairly new to java here. I'm writing a GUI program of which I want
I want to make a gui for what i explained here C# visual control
I am making a GUI of Stack using Java. Here is my code private
I am writing a Java client/server GUI application using sockets and here is the
i'm having this markup: <div class=gui> <div class=form> <div class=textbox></div> <div class=textbox></div> <div class=textbox></div>
Here is my gui xml: <FrameLayout android:layout_width=fill_parent android:layout_height=fill_parent android:id=@+id/frameLayout xmlns:android=http://schemas.android.com/apk/res/android> <ScrollView android:layout_width=fill_parent android:id=@+id/scrollView android:fillViewport=true
I want to extract text contents from GUI apps,here are 2 examples:: example 1:
I have a script that makes a GUI list here: zenity --list --text=Choose action

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.