Ho provato a inserire quel codice nel prg
ma mi dà quest'errorecodice:import javax.swing.*; public class ConversioniBinHexOct { public static void main (String args[]) { String bin,hex,oct,help; int t,i,quoz,resto; JTextArea outputTextArea = new JTextArea (); JScrollPane scroll = new JScrollPane(outputTextArea); outputTextArea.append ("Decimale Binario Esadecimale Ottale\n"); bin="";hex="";oct=""; resto=2; for (i=1; i<=256; i++) { help=""+i; outputTextArea.append(help+" "); t=i; while (t!=0) { quoz=t/2; resto=t%2; t=quoz; bin=resto+bin; } outputTextArea.append ("Bin "+bin+" "); bin=""; t=i; while (t!=0) { quoz=t/16; resto=t%16; t=quoz; if (resto>9) { switch (resto) { case 10: hex="A"+hex; break; case 11: hex="B"+hex; break; case 12: hex="C"+hex; break; case 13: hex="D"+hex; break; case 14: hex="E"+hex; break; case 15: hex="F"+hex; break; } } else hex=resto+hex; } outputTextArea.append ("Hex "+hex+" "); hex=""; t=i; while (t!=0) { quoz=t/8; resto=t%8; t=quoz; oct=resto+oct; } outputTextArea.append ("Oct "+oct); oct=""; outputTextArea.append ("\n"); } JScrollPane jsp = newJScrollPane(outputTextArea); getContentPane().add(jsp); JOptionPane.showMessageDialog(null,outputTextArea,"Conversioni",JOptionPane.INFORMATION_MESSAGE); System.exit(0); } }
codice:C:\java\bin>javac ConversioniBinHexOct.java ConversioniBinHexOct.java:66: cannot resolve symbol symbol : method newJScrollPane (javax.swing.JTextArea) location: class ConversioniBinHexOct JScrollPane jsp = newJScrollPane(outputTextArea); ^ ConversioniBinHexOct.java:67: cannot resolve symbol symbol : method getContentPane () location: class ConversioniBinHexOct getContentPane().add(jsp); ^ 2 errors C:\java\bin>
xchè? :master:



Rispondi quotando