[Solved] Easy mainFrame/Windows not working! JAVA [closed]

[ad_1] As long as Constructor remains commented out, not showing anything is correct behaviour. public static void main(String[] args) { startScreen a = new startScreen(); } Try it this way (and edit your post to include source) As MadProgrammer mentioned – you need to make the Frame visible to make all the Components within visible: … Read more

[Solved] Java about Array of object

[ad_1] if doesn’t cause the condition to be evaluated in a loop. You need to use a loop for that. while (x<3) { //changes made to to mydogs[x] are irrelevant to the execution of the loop x = x+1; } This loop will run continually until the condition x < 3 evaluates to false, which … Read more

[Solved] what will be the exact code of below vb code in java because i am not getting the same encrypted value

[ad_1] Below code is in java for 3DES encryption and decryption. please try with this code. I hope it will help you private static final String UNICODE_FORMAT = “UTF8”; public static final String DESEDE_ENCRYPTION_SCHEME = “DESede”; //”DESede/ECB/NoPadding”; private KeySpec ks; private SecretKeyFactory skf; private Cipher cipher; byte[] arrayBytes; private String myEncryptionKey; private String myEncryptionScheme; SecretKey … Read more

[Solved] Java list write in Excel [closed]

[ad_1] Use apache poi to play with xls files http://poi.apache.org/ Here is a good tutorial : http://www.avajava.com/tutorials/lessons/how-do-i-write-to-an-excel-file-using-poi.html package test; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.util.Date; import org.apache.poi.hssf.usermodel.HSSFCell; import org.apache.poi.hssf.usermodel.HSSFCellStyle; import org.apache.poi.hssf.usermodel.HSSFDataFormat; import org.apache.poi.hssf.usermodel.HSSFRow; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.util.HSSFColor; public class PoiWriteExcelFile { public static void main(String[] args) { try { FileOutputStream fileOut … Read more

[Solved] What is wrong with it?

[ad_1] The thread you create in main invokes MyThread#k() which goes into a wait. At that point, that thread will do nothing else until it is awakened or interrupted. But the only place in your code where it could possibly be awakened is the notify in MyThread#m(). Since nothing in your program calls that method, … Read more

[Solved] Thread.sleep vs Timers

[ad_1] Thread.sleep which stops all processing, so what if you had a loop inside it, and what if this loop was comparing identical objects? Would it keep creating a new instance of this loop?, and if it does what is the end result, say, if it was processing some heavy duty instructions in that loop? … Read more

[Solved] custom font in customAdapter

[ad_1] I used akhilesh0707 answer, but I changed it. public customList(Activity activity, List<itemsModel> itemsList) { this.activity = activity; this.itemsList = itemsList; inflater = activity.getLayoutInflater(); customFontBold = Typeface.createFromAsset(activity.getApplication().getAssets(), “fonts/Assistant-Bold.ttf”); } Thanks akhilesh0707. [ad_2] solved custom font in customAdapter

[Solved] how to Permanentaly remove data from stack once it has been pop out

[ad_1] public static void main(String args[]) { Stack stack = new Stack(); for (int i = 1; i <= 10; i++) stack.push(new Integer(i)); while (!stack.empty()) System.out.print(stack.pop() + ” “); System.out.println(” No element in stack”); } This works fine for me. [ad_2] solved how to Permanentaly remove data from stack once it has been pop out