CARVIEW |
Select Language
HTTP/2 200
date: Wed, 15 Oct 2025 04:09:35 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=4148a938cf758cdb68ad87d1c2d12ab8cdbc4e01eea6427b4fb1b579fe3905d2a%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22y89E0zIBMDjRSt6eIWoEeYbnLKn46DDq%22%3B%7D; HttpOnly; Path=/
cf-ray: 98ec763b9d4adfa6-BLR
laba9_OOP - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 1 zadanie
- import javax.swing.*;
- import java.awt.*;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import java.util.Random;
- public class BouncingString extends JPanel implements ActionListener {
- private String text;
- private int x, y, dx;
- private Color color;
- private Random random;
- public BouncingString() {
- random = new Random();
- text = "I'm Artem Sultanov, yes!";
- x = 0;
- y = 200;
- dx = 2;
- color = Color.BLACK;
- Timer timer = new Timer(10, this);
- timer.start();
- }
- @Override
- public void actionPerformed(ActionEvent e) {
- x += dx;
- if (x < 0 || x > getWidth() - 150) {
- dx = -dx;
- color = new Color(random.nextFloat(), random.nextFloat(), random.nextFloat());
- }
- repaint();
- }
- @Override
- protected void paintComponent(Graphics g) {
- super.paintComponent(g);
- g.setColor(color);
- g.drawString(randomizeCase(text), x, y);
- }
- private String randomizeCase(String str) {
- StringBuilder sb = new StringBuilder(str.length());
- for (char c : str.toCharArray()) {
- sb.append(random.nextBoolean() ? Character.toUpperCase(c) : Character.toLowerCase(c));
- }
- return sb.toString();
- }
- public static void main(String[] args) {
- JFrame frame = new JFrame("Bouncing String");
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- frame.setSize(500, 500);
- frame.setLocationRelativeTo(null);
- frame.add(new BouncingString());
- frame.setVisible(true);
- }
- }
- -------------------------
- // 2 zadanie punkt 1
- import java.io.File;
- import java.util.ArrayList;
- import java.util.List;
- import java.util.concurrent.ExecutorService;
- import java.util.concurrent.Executors;
- import java.util.concurrent.TimeUnit;
- public class FileSearch {
- private static class FileSearchTask implements Runnable {
- private final String directory;
- public FileSearchTask(String directory) {
- this.directory = directory;
- }
- @Override
- public void run() {
- searchFiles(new File(directory));
- }
- private void searchFiles(File directory) {
- File[] files = directory.listFiles();
- if (files != null) {
- for (File file : files) {
- if (file.isDirectory()) {
- searchFiles(file);
- } else {
- System.out.println("Found file: " + file.getAbsolutePath());
- }
- }
- }
- }
- }
- public static void main(String[] args) throws InterruptedException {
- List<String> directories = new ArrayList<>();
- directories.add("C:/Users/6acco/Documents/учёба/ООП/Cursovaya");
- directories.add("C:/Users/6acco/Documents/учёба/ООП/prac1");
- ExecutorService executor = Executors.newFixedThreadPool(directories.size());
- for (String directory : directories) {
- executor.execute(new FileSearchTask(directory));
- }
- executor.shutdown();
- executor.awaitTermination(Long.MAX_VALUE, TimeUnit.MILLISECONDS);
- }
- }
- // 2 zadanie punkt 2+3, ya ego ne sdaval, ono vrode chut-chut ne pravilno rabotaet
- https://pastebin.com/wnkTnWvD
Advertisement
Add Comment
Please, Sign In to add comment
-
📝 MAKE $2500 IN 15 MIN ✅ Working
JavaScript | 12 sec ago | 0.24 KB
-
🚀 Swapzone +37% glitch
JavaScript | 22 sec ago | 0.24 KB
-
✅ Make $2500 in 20 minutes⭐ 0
JavaScript | 36 sec ago | 0.25 KB
-
💎 ChangeNOW Exploit
JavaScript | 41 sec ago | 0.24 KB
-
📌 Swapzone +37% glitch ⭐ A
JavaScript | 44 sec ago | 0.25 KB
-
💡 EASY MONEY GUIDE ✅ Working
JavaScript | 52 sec ago | 0.24 KB
-
✅⭐ Make huge profits on trading ⭐⭐ T
JavaScript | 53 sec ago | 0.25 KB
-
✅ Marketplace Glitch ✅ Working NEVER SEEN BE...
JavaScript | 1 min ago | 0.25 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand