queiram me desculpar, mas tenho certeza de ser ajudado. ganhei um código do professor tunai e ele está todo em cinza, que esttá aberto um dos senhores professores pode fechar ele pra mim e me enviar como resposta? não sei onde fecha-lo.OBRIGADÃO.
@SuppressWarnings(“serial”)
public class matrixRain extends JFrame {
private static final int FONT_SIZE = 20;
private static final int NUMBER_OF_REPEATS = 5;
private static final String TEXT = new String(“あ た
ア カ サ ザ ジ
ズ ゼ ゾ シ ス セ ソ キ ク ケ コ イ ウ エ オ ジャ な”);
private static JPanel panel = new JPanel(null);
private static Random random = new Random();
private static JLabel label[] = new JLabel[NUMBER_OF_REPEATS];
public matrixRain() {
this.add(panel);
panel.setBackground(Color.BLACK);
}
public void scroll() {
//array to hold x coordinates for the labels
int[] random_x = new int[NUMBER_OF_REPEATS];
//create an infinite loop
while (true) {
//initialise all the labels to random characters
for (int i = 0; i < NUMBER_OF_REPEATS; i++) {
int character_initial = random.nextInt(TEXT.length());
random_x[i] = random.nextInt(panel.getWidth() / FONT_SIZE) - 1;
label[i] = new JLabel("" + TEXT.charAt(character_initial));
panel.add(label[i]);
label[i].setFont(new Font(“monospaced”, Font.PLAIN, FONT_SIZE));
label[i].setForeground(new Color(0, 255, 0));
}
// change the text of the labels and their position
for (int j = 0; j < (panel.getHeight() / FONT_SIZE) * 2; j++) {
int character = random.nextInt(TEXT.length());
//move each character
for (int i = 0; i < NUMBER_OF_REPEATS; i++) {
label[i].setBounds(random_x[i] * FONT_SIZE, j * (FONT_SIZE / 2), FONT_SIZE, FONT_SIZE);
label[i].setText("" + TEXT.charAt(character));
label[i].setForeground(new Color(0, 255 - (j * 5), 0));
for (int k = 0; k < NUMBER_OF_REPEATS; k++) {
int character_initial = random.nextInt(TEXT.length());
random_x[k] = random.nextInt(panel.getWidth() / FONT_SIZE) - 1;
label[k] = new JLabel("" + TEXT.charAt(character_initial));
panel.add(label[k]);
label[k].setFont(new Font(“monospaced”, Font.PLAIN, FONT_SIZE));
label[k].setForeground(new Color(0, 255, 0));
Color colour = label[k].getForeground();
if (colour.getGreen() <= 80) {
panel.remove(label[k]);
k = (panel.getHeight() / FONT_SIZE) * 2;
}
}
}
// pause between each character
try {
Thread.sleep(15);
} catch (Exception e) {
}
}
}
}
public static void main(String[] args) {
matrixRain frame = new matrixRain();
frame.setVisible(true);
frame.setSize(600, 400);
frame.setResizable(false);
frame.setMinimumSize(new Dimension(300, 200));
frame.setLocationRelativeTo(null);
frame.setTitle(“Matrix Code Emulator by Ricco”);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.scroll();
}
}
@author Junior
*/
public class matrixteste extends javax.swing.JFrame {
/** Creates new form matrixteste */
public matrixteste() {
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”)
//
private void initComponents() {
@param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new matrixteste().setVisible(true);
}
});
}
// Variables declaration - do not modify
// End of variables declaration
[quote=oljr35]queiram me desculpar, mas tenho certeza de ser ajudado. ganhei um código do professor tunai e ele está todo em cinza, que esttá aberto um dos senhores professores pode fechar ele pra mim e me enviar como resposta? não sei onde fecha-lo.OBRIGADÃO.
@SuppressWarnings(“serial”)
public class matrixRain extends JFrame {
private static final int FONT_SIZE = 20;
private static final int NUMBER_OF_REPEATS = 5;
private static final String TEXT = new String(“あ た
ア カ サ ザ ジ
ズ ゼ ゾ シ ス セ ソ キ ク ケ コ イ ウ エ オ ジャ な”);
private static JPanel panel = new JPanel(null);
private static Random random = new Random();
private static JLabel label[] = new JLabel[NUMBER_OF_REPEATS];
public matrixRain() {
this.add(panel);
panel.setBackground(Color.BLACK);
}
public void scroll() {
//array to hold x coordinates for the labels
int[] random_x = new int[NUMBER_OF_REPEATS];
//create an infinite loop
while (true) {
//initialise all the labels to random characters
for (int i = 0; i < NUMBER_OF_REPEATS; i++) {
int character_initial = random.nextInt(TEXT.length());
random_x[i] = random.nextInt(panel.getWidth() / FONT_SIZE) - 1;
label[i] = new JLabel("" + TEXT.charAt(character_initial));
panel.add(label[i]);
label[i].setFont(new Font(“monospaced”, Font.PLAIN, FONT_SIZE));
label[i].setForeground(new Color(0, 255, 0));
}
// change the text of the labels and their position
for (int j = 0; j < (panel.getHeight() / FONT_SIZE) * 2; j++) {
int character = random.nextInt(TEXT.length());
//move each character
for (int i = 0; i < NUMBER_OF_REPEATS; i++) {
label[i].setBounds(random_x[i] * FONT_SIZE, j * (FONT_SIZE / 2), FONT_SIZE, FONT_SIZE);
label[i].setText("" + TEXT.charAt(character));
label[i].setForeground(new Color(0, 255 - (j * 5), 0));
for (int k = 0; k < NUMBER_OF_REPEATS; k++) {
int character_initial = random.nextInt(TEXT.length());
random_x[k] = random.nextInt(panel.getWidth() / FONT_SIZE) - 1;
label[k] = new JLabel("" + TEXT.charAt(character_initial));
panel.add(label[k]);
label[k].setFont(new Font(“monospaced”, Font.PLAIN, FONT_SIZE));
label[k].setForeground(new Color(0, 255, 0));
Color colour = label[k].getForeground();
if (colour.getGreen() <= 80) {
panel.remove(label[k]);
k = (panel.getHeight() / FONT_SIZE) * 2;
}
}
}
// pause between each character
try {
Thread.sleep(15);
} catch (Exception e) {
}
}
}
}
public static void main(String[] args) {
matrixRain frame = new matrixRain();
frame.setVisible(true);
frame.setSize(600, 400);
frame.setResizable(false);
frame.setMinimumSize(new Dimension(300, 200));
frame.setLocationRelativeTo(null);
frame.setTitle(“Matrix Code Emulator by Ricco”);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.scroll();
}
}
@author Junior
*/
public class matrixteste extends javax.swing.JFrame {
/** Creates new form matrixteste */
public matrixteste() {
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”)
//
private void initComponents() {
@param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new matrixteste().setVisible(true);
}
});
}
// Variables declaration - do not modify
// End of variables declaration
}[/code][/quote]
Cara até que queria te ajudar… mas do jeito que vc escreve é dificil entender o que vc quer… vc é estrangeiro por acaso??? se não é está parecendo, pq um cara da sua idade escrevendo dessa forma tem algo errado…
bom rodei aqui o que vc postou, e me apareceu o tal matrix que vc quer… mas ainda quero saber o que vc quer… tente se expressar melhor e quem sabe eu te ajude…
Professor bom dia! obrigado por ter dado resposta. eu quero colocar o efeito matrix dentro de um rodapé num jframe e ganhei este código de outro programador. se possível corrija as falhas e me envie ele pronto para ser executado me deixe ele no ponto de ser executado. cá pra nós eu não sei o local exato de colá-lo no netbeans na área do código fonte. é isso. aguardo reposta. há diminua o tamanho da tela para ficar embaixo mais ou menos 280x190. um abraço. no aguardo.
O Olivio Jr, professor de física, indicou que não está conseguindo copiar o arquivo com o programa para um projeto dele dentro do NetBeans.
Pelo menos é o que eu consegui descobrir usando minha bola de cristal, que quando voltou do conserto está mostrando tudo embaçado
Alguém consegue contactá-lo pelo Skype e explicar exatamente como é que se faz para criar um arquivo novo dentro do NetBeans com o nome certinho para ele poder rodar o programa que lhe deram gentilmente de presente? Porque ele não consegue ler explicações com atenção, devido à “anciedade”, provavelmente é melhor explicar oralmente mesmo.
obrigado professor muito obrigado o senhor é uma simpatia. segue abaixo o código completo para sua analize. P;S: mande exemplos claros por favor é que eu sou meio lento.
@SuppressWarnings(“serial”)
public class matrixRain extends JFrame {
private static final int FONT_SIZE = 20;
private static final int NUMBER_OF_REPEATS = 5;
private static final String TEXT = new String(“あ た
ア カ サ ザ ジ
ズ ゼ ゾ シ ス セ ソ キ ク ケ コ イ ウ エ オ ジャ な”);
private static JPanel panel = new JPanel(null);
private static Random random = new Random();
private static JLabel label[] = new JLabel[NUMBER_OF_REPEATS];
public matrixRain() {
this.add(panel);
panel.setBackground(Color.BLACK);
}
public void scroll() {
//array to hold x coordinates for the labels
int[] random_x = new int[NUMBER_OF_REPEATS];
//create an infinite loop
while (true) {
//initialise all the labels to random characters
for (int i = 0; i < NUMBER_OF_REPEATS; i++) {
int character_initial = random.nextInt(TEXT.length());
random_x[i] = random.nextInt(panel.getWidth() / FONT_SIZE) - 1;
label[i] = new JLabel("" + TEXT.charAt(character_initial));
panel.add(label[i]);
label[i].setFont(new Font(“monospaced”, Font.PLAIN, FONT_SIZE));
label[i].setForeground(new Color(0, 255, 0));
}
// change the text of the labels and their position
for (int j = 0; j < (panel.getHeight() / FONT_SIZE) * 2; j++) {
int character = random.nextInt(TEXT.length());
//move each character
for (int i = 0; i < NUMBER_OF_REPEATS; i++) {
label[i].setBounds(random_x[i] * FONT_SIZE, j * (FONT_SIZE / 2), FONT_SIZE, FONT_SIZE);
label[i].setText("" + TEXT.charAt(character));
label[i].setForeground(new Color(0, 255 - (j * 5), 0));
for (int k = 0; k < NUMBER_OF_REPEATS; k++) {
int character_initial = random.nextInt(TEXT.length());
random_x[k] = random.nextInt(panel.getWidth() / FONT_SIZE) - 1;
label[k] = new JLabel("" + TEXT.charAt(character_initial));
panel.add(label[k]);
label[k].setFont(new Font(“monospaced”, Font.PLAIN, FONT_SIZE));
label[k].setForeground(new Color(0, 255, 0));
Color colour = label[k].getForeground();
if (colour.getGreen() <= 80) {
panel.remove(label[k]);
k = (panel.getHeight() / FONT_SIZE) * 2;
}
}
}
// pause between each character
try {
Thread.sleep(15);
} catch (Exception e) {
}
}
}
}
public static void main(String[] args) {
matrixRain frame = new matrixRain();
frame.setVisible(true);
frame.setSize(600, 400);
frame.setResizable(false);
frame.setMinimumSize(new Dimension(300, 200));
frame.setLocationRelativeTo(null);
frame.setTitle(“Matrix Code Emulator by Ricco”);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.scroll();
}
}
[/code]
Claro que ajudo… mas eu não faço o trabalho por vc…
o que vc montou está muito cru para eu ajudar… mas vou te dar as dicas e ai vc vai montando e postando aqui o que for fazendo ok?
para funcionar igual o exemplo… seu rodape precisa ser um JPanel e nele vc pode dar praticamente um copy e paste =D
vc já tem a logica de como faz certo? então é só utilizar ela e adaptar pro seu…
faz por etapa… cria o layout da tela e ai ajudo a encaixar ok?[/quote]
Já leu todos os outros 200 tópicos iguais que ele criou? Ele quer que você faça tudo para ele, ele não quer colocar a mão na massa.
[quote=entanglement]O Olivio Jr, professor de física, indicou que não está conseguindo copiar o arquivo com o programa para um projeto dele dentro do NetBeans.
Pelo menos é o que eu consegui descobrir usando minha bola de cristal, que quando voltou do conserto está mostrando tudo embaçado
Alguém consegue contactá-lo pelo Skype e explicar exatamente como é que se faz para criar um arquivo novo dentro do NetBeans com o nome certinho para ele poder rodar o programa que lhe deram gentilmente de presente? Porque ele não consegue ler explicações com atenção, devido à “anciedade”, provavelmente é melhor explicar oralmente mesmo. [/quote]
Agora estou confuso… mas falar com ele precisa de uma bola de cristal mesmo, fora a ansiedade exagerada… já se foram uns 20 postes iguais heeheh
eu testei o codigo que ele postou do matrix louco e rodou de boa aqui… mas só Deus sabe o que ele quer…
Claro que ajudo… mas eu não faço o trabalho por vc…
o que vc montou está muito cru para eu ajudar… mas vou te dar as dicas e ai vc vai montando e postando aqui o que for fazendo ok?
para funcionar igual o exemplo… seu rodape precisa ser um JPanel e nele vc pode dar praticamente um copy e paste =D
vc já tem a logica de como faz certo? então é só utilizar ela e adaptar pro seu…
faz por etapa… cria o layout da tela e ai ajudo a encaixar ok?[/quote]
Já leu todos os outros 200 tópicos iguais que ele criou? Ele quer que você faça tudo para ele, ele não quer colocar a mão na massa.[/quote]
Li sim… e estou chocado ate agora… hehehehe
todo dia eu vejo um post dele novo o.O
pelo que estou entendendo ele quer que esse codigo louco vire um rodapé é isso???
Claro que ajudo… mas eu não faço o trabalho por vc…
o que vc montou está muito cru para eu ajudar… mas vou te dar as dicas e ai vc vai montando e postando aqui o que for fazendo ok?
para funcionar igual o exemplo… seu rodape precisa ser um JPanel e nele vc pode dar praticamente um copy e paste =D
vc já tem a logica de como faz certo? então é só utilizar ela e adaptar pro seu…
faz por etapa… cria o layout da tela e ai ajudo a encaixar ok?[/quote]
Já leu todos os outros 200 tópicos iguais que ele criou? Ele quer que você faça tudo para ele, ele não quer colocar a mão na massa.[/quote]
Li sim… e estou chocado ate agora… hehehehe
todo dia eu vejo um post dele novo o.O
pelo que estou entendendo ele quer que esse codigo louco vire um rodapé é isso???
[/quote]
O que ele quer é que um trouxa faça o programa inteiro e entregue de mão beijada para ele.
Ele alega ser iniciante em java há 5 meses, mas não sabe nem usar o netbeans.
Alega ser professor de física, mas não sabe escrever.
Na minha opinião: é um piá de prédio, criado a leite com pera e vagabundo.
[quote=Slow17]Aqui rodou de boa também o codigo ‘-’
O que esse cara quer afinal …[/quote]
cara, acho que entendi o que ele tá falando de codigo aberto e fechado. ele quer que agente compile pra ele e poste o jar.
cara, coitado desse bicho… vai confiar em qualquer jar que pegar…
vou fazer pelo menos isso pra ele pq se não ele não sai e ainda se estrepa…
bom, esse efeito é muito mixuruca, se vc tivesse disposto a aprender, eu ensinava de boa a fazer algum melhor.
O código que compilei foi esse. Pode fazer a engenharia reversa que o fonte tá limpo.
Se vc voltar aqui mendigando fonte ou programa compilado a galera vai cair em cima de vc. então agora some daqui.
Não quero mai ver vc fazendo isso aqui nesse forum.
se quiser voltar pra aprender vai ser bem vindo.
import java.awt.*;
import java.util.*;
import javax.swing.*;
@SuppressWarnings("serial")
public class matrixRain extends JFrame
{
private static final int FONT_SIZE = 20;
private static final int NUMBER_OF_REPEATS = 5;
private static final String TEXT = new String("A K R J x o y q s j p y u s z s q a ");
private static JPanel panel = new JPanel(null);
private static Random random = new Random();
private static JLabel label[] = new JLabel[NUMBER_OF_REPEATS];
public matrixRain()
{
this.add(panel);
panel.setBackground(Color.BLACK);
}
public void scroll()
{
//array to hold x coordinates for the labels
int[] random_x = new int[NUMBER_OF_REPEATS];
//create an infinite loop
while (true)
{
//initialise all the labels to random characters
for (int i = 0; i < NUMBER_OF_REPEATS; i++)
{
int character_initial = random.nextInt(TEXT.length());
random_x[i] = random.nextInt(panel.getWidth() / FONT_SIZE) - 1;
label[i] = new JLabel("" + TEXT.charAt(character_initial));
panel.add(label[i]);
label[i].setFont(new Font("monospaced", Font.PLAIN, FONT_SIZE));
label[i].setForeground(new Color(0, 255, 0));
}
// change the text of the labels and their position
for (int j = 0; j < (panel.getHeight() / FONT_SIZE) * 2; j++)
{
int character = random.nextInt(TEXT.length());
//move each character
for (int i = 0; i < NUMBER_OF_REPEATS; i++)
{
label[i].setBounds(random_x[i] * FONT_SIZE, j * (FONT_SIZE / 2), FONT_SIZE, FONT_SIZE);
label[i].setText("" + TEXT.charAt(character));
label[i].setForeground(new Color(0, 255 - (j * 5), 0));
for (int k = 0; k < NUMBER_OF_REPEATS; k++)
{
int character_initial = random.nextInt(TEXT.length());
random_x[k] = random.nextInt(panel.getWidth() / FONT_SIZE) - 1;
label[k] = new JLabel("" + TEXT.charAt(character_initial));
panel.add(label[k]);
label[k].setFont(new Font("monospaced", Font.PLAIN, FONT_SIZE));
label[k].setForeground(new Color(0, 255, 0));
Color colour = label[k].getForeground();
if (colour.getGreen() <= 80)
{
panel.remove(label[k]);
k = (panel.getHeight() / FONT_SIZE) * 2;
}
}
}
// pause between each character
try
{
Thread.sleep(15);
}
catch (Exception e)
{
}
}
}
}
public static void main(String[] args)
{
matrixRain frame = new matrixRain();
frame.setVisible(true);
frame.setSize(600, 400);
frame.setResizable(false);
frame.setMinimumSize(new Dimension(300, 200));
frame.setLocationRelativeTo(null);
frame.setTitle("Matrix Code Emulator by Ricco");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.scroll();
}
}