I am at a loss here.
I can see any reason that why the following is happening :
public class UI extends javax.swing.JFrame {
.
.
.
.
377: private static JDialog dialog;
378:
379: static void conflict_dialog(){
380: dialog = new conflict(this, true,new File("C:\\Users\\Soumya\\Desktop\\a.sh"), 2242);
381: dialog.setVisible(send_mode);
.
.
}
}
Uncompilable source code – non-static variable this cannot be referenced from a static context at new_file_transfer.UI.conflict_dialog(UI.java:380)
any ideas on why I am getting this error will be very helpful
Here’s the problem:
You’re in a static method – what do you expect
thisto be? It could be appropriate to construct a newUIas per thinksteep’s answer – or you may want to use an existing reference from somewhere else. It’s hard to say for sure. When you wrote that code, what did you wantthisto refer to?(Note that to follow Java naming conventions, your
conflictclass should be renamed toConflict; your method should probably be renamed toshowConflictDialogand yoursend_modevariable should probably besendMode.)