public static boolean copy = false;
public static boolean turn = false;
public static BufferedImage image = null;
public GrafEditor() {
try {
image = ImageIO.read(new...
Type: Posts; User: DonnyWatts
public static boolean copy = false;
public static boolean turn = false;
public static BufferedImage image = null;
public GrafEditor() {
try {
image = ImageIO.read(new...
import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JFrame;
import javax.swing.JPanel;
import...
String thisLine = null;
String text = "";
try{
BufferedReader br = new BufferedReader( new FileReader( new File(("c:\\users"))));
while ((thisLine = br.readLine()) !=...
import javax.swing.*;
import java.awt.AWTException;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Robot;
import java.awt.color.*;
import java.awt.event.MouseEvent;
import...
import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
public class Pyramida extends JFrame {...
JTextArea textAreaDatum = new JTextArea();
JTextArea textAreaCas = new JTextArea();
JLabel lblAktualny = new JLabel("Aktu\u00E1lny \u010Das a d\u00E1tum");
JLabel lblRokov = new...
j = Integer.parseInt(DoString);
for(i = Integer.parseInt(OdString); i<=j; i++) {
System.out.println((char)i);
textArea.setText(textArea.getText()+(char)i+"\n");
}
JFileChooser...
public class Sum{
public static void main(String[] args) throws Exception {
File file = new File("c:\\user.txt");
BufferedReader reader = null;
try {
reader = new...
String strLine;
JTextArea textArea = new JTextArea();
JTextArea textArea2 = new JTextArea();
String subor = "";
public void readData() {
try {
BufferedReader br = new...
private JPanel contentPane;
private JTextField textField;
float vysledok = 0;
public Kalkulator() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 300);...
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new FileReader(new File("c:\\users")));
String strLine;
int num = 0;
float...
public class Parentheses extends JFrame {
private JPanel contentPane;
private JTextField textField;
private JButton btnOtestuj;
private JLabel lblNewLabel;
public static void...
String thisLine = null;
String name= "";
try{
BufferedReader br = new BufferedReader( new FileReader( new File(("c:\\users"))));
while ((thisLine = br.readLine()) !=...
String thisLine = null;
String text = "";
try{
BufferedReader br = new BufferedReader( new FileReader( new File(("c:\\users"))));
while ((thisLine = br.readLine()) !=...
How can I reset both integers me and pc once I have used them?
int random = 0;
int me = 0;
int pc = 0;
public void vyber(int typ) {
random = (int) (Math.random() * 3 + 0);
public class ListColor extends JFrame {
Color[] farby = {Color.RED, Color.YELLOW, Color.BLUE, Color.GRAY, Color.GREEN, Color.ORANGE, Color.BLACK};
private JPanel contentPane;
private JPanel...
JPanel panel = new JPanel(){
public void paint(Graphics g) {
int rad = Integer.parseInt(textA1.getText());
int stlp = Integer.parseInt(textA2.getText());
for(int...
public void paint(Graphics g) {
for(int j = 0; j<4; j++)
{
for(int i = 0; i<8; i++)
{
if(i%2==0) {
g.setColor(Color.red);
}else {
String word = "Hello";
String code = "";
for(int i = 0; i < word.length(); i++) {
char cipher = (char) (word.charAt(i)+2);
code = code+Character.toString(cipher);
}
...
public void mouseClicked(MouseEvent e) {
String sentence = textArea.getText();
String find = textVyhl.getText();
for(String st : sentence.split(" ")){
if(st.indexOf(find)!=-1){...
btnSave.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent arg0) {
String text = textArea.getText();
JFileChooser chooser = new JFileChooser();...
public class EuclidAlg {
public static int NSD (int a, int b) {
if(a>b) {
return NSD(a-b,b);
}
if(a<b) {
return NSD(a,b-a);
}
public class BubbleSort {
public static int[] bubblesort(int [] array) {
for(int i = 0; i < array.length - 1; i++) {
for (int j = 0; j <array.length - i - 1; j++) {
...
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.InputStreamReader;
public class Sum{
public static void...
public class FromBin{
public static int power(int number, int exp){
int k=1;
for(int i=1; i<=exp;i++) {
k*=number;
}
return(k);
}