国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

??
?? ??? JPanel? ?????? ????
? Java java?? ?? ?? ???? ???? ????? ??? ? JPanel? ?????? ?? ??? ??????

?? ???? ???? ????? ??? ? JPanel? ?????? ?? ??? ??????

Nov 28, 2024 pm 06:36 PM

Why Doesn't My JPanel Update After Adding or Moving Images in a Puzzle Game?

?? ??? JPanel? ?????? ????

??? ?? ????? ??? ???? ???? ???? ???? ?????. ? ????? ?? ??? ??? ??? ???? 'place' ? 'number' ??? ????. ?? ??? '??'? ???? ???? ???? ???? '??' ??? ???????. ??? ????? ???? JPanel? ???? ??? ???? ?????? ????.

? ??? ???? ?? JPanel? ???? ?? ???? addComponents() ???? ?????.

public void addComponents(Img[] im){
    this.removeAll();
    for(int i=0; i<16; i++){
        im[i].addActionListener(this);
        im[i].setPreferredSize(new Dimension(53,53));
        add(im[i]);
    }
    // Explicitly revalidate and repaint the JPanel
    this.revalidate();
    this.repaint();
}

revalidate() ? repaint()? ???? JPanel? ????? ?? ???? ?????? ? ???? ??????? ???. ???.

?? ?? ???? ?? ??? ???? ?? ?? ??? ??? ???.

import java.awt.Container;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.GridLayout;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.Timer;
import javax.swing.WindowConstants;

public class PuzzleGame {

    private static final int N = 4;
    private final JPanel panel = new JPanel(new GridLayout(N, N));
    private final JButton[][] buttons = new JButton[N][N];
    private final BufferedImage image;

    private PuzzleGame() throws IOException {
        image = ImageIO.read(new File("image.jpg"));
        createButtons();
        JFrame frame = new JFrame();
        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        frame.add(panel);
        frame.pack();
        frame.setVisible(true);
        
        // Timer to simulate image swapping
        Timer timer = new Timer(1000, new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                shuffleButtons();
            }
        });
        timer.start();
    }

    private void createButtons() {
        int count = 0;
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < N; j++) {
                buttons[i][j] = new JButton();
                buttons[i][j].setPreferredSize(new Dimension(50, 50));
                int w = image.getWidth() / N;
                int h = image.getHeight() / N;
                BufferedImage subImage = image.getSubimage(j * w, i * h, w, h);
                buttons[i][j].setIcon(new ImageIcon(subImage));
                panel.add(buttons[i][j]);
                buttons[i][j].addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        JButton b = (JButton) e.getSource();
                        // Swap logic here
                    }
                });
                count++;
            }
        }
    }

    private void shuffleButtons() {
        Container parent = panel.getParent();
        if (parent != null) {
            panel.remove(buttons[0][3]);
            parent.add(buttons[0][3], 0);
        }
        // Update the UI
        panel.revalidate();
        panel.repaint();
    }

    public static void main(String[] args) {
        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                try {
                    new PuzzleGame();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        });
    }
}

? ??? ??? ??? ??? ???? 4x4 ???? ?????. ???? ??? ?? ??? ? ?? ??? ???? ??? ???? ?????. revalidate() ? repaint() ???? ? ?? ?? ? UI? ???? ??????? ?????.

? ??? ?? ???? ???? ????? ??? ? JPanel? ?????? ?? ??? ??????? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? ????? ??
? ?? ??? ????? ???? ??? ??????, ???? ?????? ????. ? ???? ?? ???? ?? ??? ?? ????. ???? ??? ???? ???? ??? ?? admin@php.cn?? ?????.

? AI ??

Undresser.AI Undress

Undresser.AI Undress

???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover

AI Clothes Remover

???? ?? ???? ??? AI ?????.

Video Face Swap

Video Face Swap

??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

???

??? ??

???++7.3.1

???++7.3.1

???? ?? ?? ?? ???

SublimeText3 ??? ??

SublimeText3 ??? ??

??? ??, ???? ?? ????.

???? 13.0.1 ???

???? 13.0.1 ???

??? PHP ?? ?? ??

???? CS6

???? CS6

??? ? ?? ??

SublimeText3 Mac ??

SublimeText3 Mac ??

? ??? ?? ?? ?????(SublimeText3)

???

??? ??

??? ????
1600
29
PHP ????
1501
276
???
?? ??? ??? ????? ?? ?? ??? ??? ????? ?? Jul 07, 2025 am 02:24 AM

Java? ??? ?? ??, ?? ? ??? (? : Projectreactor) ? Java19? ?? ???? ??? ??? ?????? ?????. 1. CompletableFuture? ?? ??? ?? ?? ??? ? ?? ??? ????? ?? ??????? ? ?? ??? ?????. 2. Projectreactor? ?? ? ??? ??? ???? ?? ???? ? ??? ???? ?? ? ?????? ?????. 3. ?? ???? ??? ??? ??? I/O ??? ? ??? ???? ?? ??? ????? ??? ???? ????. ? ???? ?? ??? ????? ??? ??? ??? ?? ??? ??? ?????? ???? ???? ?? ?? ??? ??????.

???? ??? ?????? ?? ?? ???? ??? ?????? ?? ?? Jul 07, 2025 am 02:35 AM

Java?? ??? ?? ?? ??? ???? ? ?????. ?? ???? ??? ?????. 1. ?? ?? ? ???? ??????? ?? ?? ?? ??? ???? ??? ?????. 2. ?? ??, ???, ??? ?? ?? ?? ???? ????? ?? ??? ??? ??? ?????. 3. ENUMMAP ? ENUMSET? ???? ?? ? ?? ???? ???? ??? ???? ? ?????? ?????. 4. ?? ?, ??? ?? ?? ??? ?? ????? ?? ??? ??? ?????.? ????? ?? ???? ????????. ??? ???? ???? ?? ??? ????? ??? ?? ? ??? ?? ?????? ???????.

Java Nio? ? ??? ????? Java Nio? ? ??? ????? Jul 08, 2025 am 02:55 AM

Javanio? Java 1.4? ?? ? ??? IOAPI???. 1) ?? ? ??? ?????, 2) ??, ?? ? ??? ?? ?? ??, 3) ? ??? ??? ???? 4) ?? ??? ?? IO?? ? ????? ?????. 1) ? ?? IO? ??? ?? ??? ???, 2) ??? ??? ?? ???? ?????, 3) ???? ?????? ???? 4) ??? ?? ??? ?? ?? ? ??? ?????. 1) ??? ??/??? ??? ?? ?????, 2) ???? ???? ???? ?? ???? ???????. 3) ??? ??? ??? ???????.

Java ??? ??? ????? ???? ?? Java ??? ??? ????? ???? ?? Jul 06, 2025 am 02:53 AM

Java? ????? ????? ??? ??? ?? ???? ?? ?? ??????, ?? ? ???? ? ??? ????. ?? ???? ??? ??? ???? ??? ??? ???? ?? ??? ??? ????. ???? ???? ??? ??, ?? ??? ???? ???? ?? ??? ?? ???? ?? ?????. ???? ?? ?? ??? ?? ?? ??? ?????. ?????? ?? ??? ??? ???? ?? ??? ??? ?? ??? ???? ???? ??? ?? ??? ?????? ???? ????? ??? ?? ?? ???, ?? ? ?? ???? ??? ??? ?????. ???? urlclassl? ?? ??? ??? ??? ?? ? ? ????

?? ?? ???? ????? ??? ?????? ?? ?? ???? ????? ??? ?????? Jul 15, 2025 am 03:10 AM

?? ?? Java? ?? ???? ?? ? ? ? ????? ????, ? ??? ??? ??? ??? ???? ? ????. 1. ?? ?? hashcode () ???? ???? ?? ?? ???? ?? ??? ?? ?? ???? ?????. 2. ?? ??? ??? ?? ?? ???? ??? ??? ? ????. ?? ??? ?? ? ??? ??? ?????. JDK8 ? ?? ? ??? ?? ?? (?? ?? 8) ??? ????? ?? ???? ?? ? ??? ?????. 3. ??? ?? ???? ?? ???? ?? equals () ? hashcode () ???? ?? ???????. 4. ?? ?? ??? ???? ?????. ?? ?? ??? ???? ?? ?? (?? 0.75)? ??? ?? ? ???; 5. ?? ?? ??? ??? ??? Multithreaded?? Concu? ???????.

Java ?? ? ?? ??? ???? ?? Java ?? ? ?? ??? ???? ?? Jul 07, 2025 am 02:43 AM

Java ??? ??? ???? ??? ??? ??? ?????, ???? ????, ?????? ??? ? ????. 1. ??? ????? ???? ??? ? ? ??? ?? ?? ????? ???? ? ???? ??????. 2. ???? ?? ?? ???? ??? ??? ???? ?? ?? ???? ??? ??? ? ????. 3. ???? ???? ??? ??? ?? ??? ?? ? ? ??????. 4. ?? ?? ?? ??? ? ??? ??? ?? ????? ?? ?? ??? ??? ? ????. 5. ??, ?? ?? ??, ?? ?? ?? ???, ????? ?? ?? ? ???? ??? ????? ??????.

Java?? ??? ???? ???? ??? ?????? Java?? ??? ???? ???? ??? ?????? Jul 06, 2025 am 02:43 AM

Java? ??? ???? ??? ??? ??? ???? ???? ??? ?? ?? ????. ?? ??? ?? ?? ?? ??? ???? ???? ??? ??? CheckedException? ?? ??? ??????. ??? ??? ?? ???????. ??, ?? ??? ??? ???? ??? ???? ??? ?? ? ??, ?? ?? ?????????. ??, ??? ??? ???? ???? ??????, ????? ??? ???????. ??, ??? ?? ??, runtimeexception ?? ??? ?? ?? ?? ???? ?? ???? ??? ???????.

Java? ?? ? ??? ??? ?????? Java? ?? ? ??? ??? ?????? Jul 09, 2025 am 01:32 AM

Java? Singleton Design Pattern? ???? ??? ???? ? ?? ?? ??? ? ?? ??? ?? ??? ??? ???? ???? ?? ???? ?? ???? ???? ??? ?????. ?? ???? ??? ?????. 1. ?????, ? ????? ? ?? ??? ?? ? ?? ????, ?? ?? ??? ?? ??? ???? ?? ??? ?????. 2. ???-?? ??, ??? ?? ?? ?? ?? ??? ?? ?? ??? ???? ??? ???? ? ???? ?? ??? ????. 3. ??? ?? ?? ????? ?? ????? ??? ??? ?? ??? ? ??? ??? ?? ?? ????? ?????. 4. ?? ??? ???? ???, ??? ??? ? ?? ??? ???? ?? ??? ???? ??? ??? ?????. ?? ??? ?? ?? ?? ??? ??? ? ????.

See all articles