text
stringlengths
14
410k
label
int32
0
9
public boolean removeSign(Location signLoc){ for(int i=1;signConfig.get("signs." + i)!=null;i++){ if(signConfig.get("signs." + i + ".liftID")!=null){ if(signLoc.getWorld().getName().equals(signConfig.getString("signs." + i + ".location.world"))){ if(signLoc.getBlockX()==signConfig.getInt("signs." + i...
7
public synchronized void start() { running = true; mainThread = new Thread(this, "Main Thread"); mainThread.start(); }
0
public void visit_ifnonnull(final Instruction inst) { stackHeight -= 1; if (stackHeight < minStackHeight) { minStackHeight = stackHeight; } }
1
public Integer[][] convert(int[][] intGrid) { Integer[][] grid = new Integer[9][9]; for (int i = 0; i < 9; i++) { for (int t = 0; t < 9; t++) { grid[i][t] = intGrid[t][i]; } } return grid; }
2
private static String createInferenceCommandInternal(CycObject query, ELMt mt, InferenceParameters queryProperties, Map nlGenerationProperties, CycSymbol answerProcessingFunction, boolean optimizeVariables, CycAccess cycAccess) { if (queryProperties == null) { queryProperties = new Default...
5
public AppletContext getAppletContext() { if (Signlink.mainapp != null) { return Signlink.mainapp.getAppletContext(); } else { return super.getAppletContext(); } }
1
@Override public void updateAll() { if (allNews.size() > 0) { for (Observer observer : readers) { observer.update(allNews.get(allNews.size() - 1)); } } }
2
public String getGrepCommand(ClientArgs clientArgs, String logFileName) { String keyRegExp = clientArgs.getKeyRegExp(); String valRegExp = clientArgs.getValRegExp(); String options = clientArgs.getOptionsString(); String command = ""; // Handle corner cases of "$" apperaring at the end of keyRegExp and "^...
8
public LoadingDialog() { super(); setUndecorated(true); setModal(true); JPanel mainPanel = new JPanel(); mainPanel.setPreferredSize(new Dimension(300, 250)); mainPanel.setBorder(DefaultUIProvider.getDefaultEmptyEtchedBorder()); BoxLayout boxLayout = new Box...
0
public int[] findOrder(int numCourses, int[][] prerequisites) { if (numCourses <= 0) { return new int[] {}; } int[] result = new int[numCourses]; int index = 0; Map<Integer, List<Integer>> graph = new HashMap<Integer, List<Integer>>(); Map<Integer, Integer> in = new HashMap<Integer, Integer>(); for (in...
9
private static double[] toLab(final int red, final int green, final int blue) { //The weight of chromaticity [0–∞[, 1 is unweighted. final double chromaWeight = 1; int ir = red ; if (ir < 0) ir += 1 << 8; int ig = green; if (ig < 0) ig += 1 << 8; int ib = blue ; if (ib < 0) ib += 1 << 8; dou...
9
@Override public void removeClient(Integer id) { if(clientsList.containsKey(id)) { clientsList.remove(id); if(clientsNames.containsKey(id)) { clientsNames.remove(id); } } for(Integer key: getClientSet()) { if(key != id) { getClientInstance(key).sendNewUserList(); } } sendMes...
4
public static void handleGetTicketReply(HTSMsg msg, HTSPClient client) { Collection<String> requiredFields = Arrays.asList(new String[]{"path","ticket"}); if (msg.keySet().containsAll(requiredFields)){ //TODO } else if (msg.get("error") != null){ //TODO } else{ System.out.println("Faulty reply"); } ...
2
public static String executePost(String targetURL, String data, String contentType) { URL url; HttpURLConnection connection = null; try { //Create connection url = new URL(targetURL); connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("POST"); if (data != null) { ...
6
public boolean contains(Permission perms, Player player) { if (groups != null && !groups.isEmpty()) { for (GroupAssignment group : groups) { if (!perms.playerInGroup(group.getWorld(), player.getName(), group.getGroup())) { return false; } ...
4
@Override public void executeMsg(final Environmental myHost, final CMMsg msg) { super.executeMsg(myHost,msg); // the sex rules if(!(myHost instanceof MOB)) return; final MOB myChar=(MOB)myHost; if((msg.amITarget(myChar)) &&(CMLib.dice().rollPercentage()<10) &&(msg.tool() instanceof Social) &&(msg....
9
public Cycle(Peg x, Peg y, Peg z, int type) { this.x = x; this.y = y; this.z = z; this.type = type; movePegs(); }
0
public void setCondition(String condition) { this.condition = condition; }
0
@Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { if (!(sender instanceof Player)) { sender.sendMessage("Only players can open a shared chest."); return true; } Player p = (Player) sender; if (args.length != 1) return false; String name ...
7
public void handleInputUpload(DFSClientRequest req){ //Create a DFSInput File DFSInputFile dif = new DFSInputFile(req.getFileName()); dif.setNumOfRecords(req.getFileLineNum()); nn.JobStatusMap.put(req.getJobName(), new DFSJobStatus(dif)); //Chop the DFSInput File off by the number of DataNodes int sum...
8
public void mouseClicked(java.awt.event.MouseEvent me) { // System.out.println("\n mouseClicked"); TWPoint p = drawBoard_.mapClickToRowAndCol(new TWPoint(me.getPoint())); // System.out.println("mouse click @ " + p.x + "/" + p.y); if (currentState_ == STATE_PLACE_PEG) { tryPlacePeg(p); } else if (currentSt...
6
@Override public void computeData() { for (Building b : _player.getBuildings()) { switch (b.getType()) { case "water_turbine": _buildings[WATER] += computeProduction(BuildingInfo.WATER); break; case "wind_turbine": ...
6
public Material getMaterial() { Material material = null; if (id != null) { material = Material.getMaterial(id); } if (material == null && name != null) { material = Material.getMaterial(name); } return material; }
3
public void itemReceived(Auction auction, String time){ auction.itemReceived(time); }
0
protected void changeButtonBorder(AbstractButton b) { Object cp = b.getClientProperty("paintToolBarBorder"); if ((cp != null) && (cp instanceof Boolean)) { Boolean changeBorder = (Boolean)cp; if (!changeBorder.booleanValue()) { return; } } ...
8
public void init() { String fileNameValidTransitionTable = null; try { fileNameValidTransitionTable = Util.getStringProperty("FileNameValidTransitionTable"); } catch (IOException e) { e.printStackTrace(); } try { transitions = createValidTrans...
7
public String next() { if (cmds.size() == 0) { return null; } if (cursor < cmds.size() - 1) { cursor++; } return cmds.get(cursor); }
2
private boolean jj_3R_15() { if (jj_scan_token(FUN)) return true; if (jj_3R_17()) return true; if (jj_scan_token(ARROW)) return true; if (jj_3R_11()) return true; return false; }
4
public void pick(Deck deck) { PickResult pair = PickResult.pair; Card cards[] = new Card[2]; // the bot will continue to pick cards while it knows a pair, // this could be unfair, the bot should "think" (wait) before // picking more cards, currently it will gain lots of bonus points. while (pair == PickRes...
7
public char skipTo(char to) throws JSONException { char c; try { long startIndex = this.index; long startCharacter = this.character; long startLine = this.line; this.reader.mark(1000000); do { c = this.next(); if...
3
public boolean isInBound( AABB aabb ) { if ( x > aabb.getMax().getX() || x < aabb.getMin().getX() ) return false; if ( y > aabb.getMax().getY() || y < aabb.getMin().getY() ) return false; if ( z > aabb.getMax().getZ() || z < aabb.getMin().getZ() ) return false; return true; }
6
public final void method482(int j, int k, int l, int i1, int j1, int k1) { int i = 0; int l1 = Texture.textureInt1; int i2 = Texture.textureInt2; int j2 = modelIntArray1[i]; int k2 = modelIntArray2[i]; int l2 = modelIntArray1[j]; int i3 = modelIntArray2[j]; int j3 = modelIntArray1[k]; int k3 = modelIn...
6
public void cull() { if (!active(GET, XXX)) return; if (playing() && toLoop) toPlay = true; if (rawDataStream) toPlay = true; active(SET, false); if (channel != null) channel.close(); channel = null; }
5
private String[] findGroups(String user) { Connection connection = null; PreparedStatement statement = null; ResultSet rs = null; try { connection = getConnection(); statement = connection.prepareStatement(groupQuery); int paramCount = gro...
4
@Override public void mousePressed(MouseEvent e) { if(e.getSource()==recordBut){ recordBut.setIcon(recordClickIcon); }else if(e.getSource()==playBut){ playBut.setIcon(playClickIcon); }else if(e.getSource()==stopBut){ stopBut.setIcon(stopClickIcon); }else if(e.getSource()==saveBut){ saveBut.setIcon(...
6
public String ingresarLetra(String letra) { if(aciertos != tamanioPalabra){ if (intentos > 0){ if (verificarLetra(letra)){ return "letra correcta"; } else{ puntuacion-=10; intentos--; return "Error, letra incorrecta"; } } else{ return "PERDIO!!!"; } } else{ b...
3
public int getBurnTimeByStack(ItemStack i) { if(i == null || i.item == null) return -1; if(i.item.id.equals(Block.planks.getItem().id)) { return 600; } else if(i.item.id.equals(Block.log.getItem().id)) { return 800; } else if(i.item.id.equals(Item.coal.id)) { return 1800; } e...
6
private static void giveKit(final String nick, final String kit) { if(!Conf.config.getProperty("enable-kits", "true").equals("true")) { Cmd.sayToPlayer(nick, "kits are disabled."); return; } final String[] items = Conf.kits.getProperty(kit).split(" "); if(items.length%2 != 0) return; for(int i=0; i<items.l...
5
public LoggerAppender() { }
0
public boolean isAdd() { return myAdd; }
0
public long getTotalSize() { return totalSize; }
0
public void visitDefExpr(final DefExpr expr) { if (expr instanceof MemExpr) { visitMemExpr((MemExpr) expr); } }
1
public void edit(Tenant tenant) throws NonexistentEntityException, Exception { EntityManager em = null; try { em = getEntityManager(); em.getTransaction().begin(); tenant = em.merge(tenant); em.getTransaction().commit(); } catch (Exception ex) { ...
5
private void jBtnInsertActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnInsertActionPerformed // TODO add your handling code here: try { String flag = (String) jComboBox1.getSelectedItem(); if (!"<Seleccione>".equals(flag)) { String sql = "IN...
2
@Override public void execute(CommandSender sender, String worldName, List<String> args) { this.sender = sender; if (worldName == null) { error("No world given."); reply("Usage: /gworld allowweatherchange <worldname> <true|false>"); } else if (!hasWorld(worldName)) { reply("World not found: " + world...
5
boolean isValidFile(File file) { if (!file.exists()) { System.err.println("Directory doesn't exist: " + file.getAbsolutePath()); return false; } else if (!file.isFile()) { System.err.println(file.getAbsolutePath() + " is not a file"); return false; ...
2
public static String[] sort(String[] keys, int R, int W) { int len = keys.length; String[] aux = new String[len]; for(int j = W-1; j >=0; j--) { int[] count = new int[R + 1]; // counting Frequency for(int i = 0; i < len; i++) { int index = Character.getNumericValue((keys[i].charAt(j))...
5
public void run() { ServerSocket serversocket = null; Socket s; InputStreamReader input; BufferedReader b; PrintWriter p; String message = null; boolean done = false; try { serversocket = new ServerSocket(Utils.FAULTMNGR_PORT, 1); /* backlog is 1 */ serversocket.setSoTimeout(0); } catch ...
6
static public String textRead(String a_file_name) throws FileNotFoundException, IOException { // for holding the string read from the file StringBuffer contents = new StringBuffer(); // for holding the reader; to make visible to finally clause BufferedReader input_reader = null; try { ...
5
public Instance convertInstance(Instance instance) throws Exception { if (m_s == null) { throw new Exception("convertInstance: Latent Semantic Analysis not " + "performed yet."); } // array to hold new attribute values double [] newValues = new double[m_outputNumAtt...
7
public static String getFileName(String name, String dir) { String fileName = name; if(exists(name, dir)) { for(int i = 1; i < 100000; i++) { String constructed = name + "("+i+")"; if(!exists(constructed, dir)) { fileName = constructed; break; } } } return fileName; }
3
public void save(SpoutPlayer player, AccessoryType type) { File saveFile = new File(getDataFolder(), "saved.yml"); if (!saveFile.exists()) { try { saveFile.createNewFile(); } catch (IOException ex) { Logger.getLogger(PlayerPlus.class.getName()).log(Level.SEVERE, null, ex); } } YamlConfiguratio...
3
public ClientConfig(byte[] configbuffer) { this.configText = new String(configbuffer); // I'm going in dry // System.out.println(configText); // ^that is printed below, i use that text to match my shit on (i don't // wanne load per line cus its multiline data) Matcher m1 = codeBaseRex.matcher(configText); ...
7
@Override public Car driverCar() { return new BenzCar(); }
0
@Override public Storeable deserialize(Table table, String value) throws ParseException { JsonArray json = ((new JsonParser().parse(value))).getAsJsonArray(); List<Object> values = new ArrayList<>(); for (int i = 0; i < json.size(); ++i) { values.add(json.get(i)); } ...
3
public final JSONObject toJSONObject(JSONArray names) throws JSONException { if (names == null || names.length() == 0 || length() == 0) { return null; } JSONObject jo = new JSONObject(); for (int i = 0; i < names.length(); i += 1) { jo.put(names.getString(i), this...
4
@Override public void or(NIOFilter filter) { if(filter == null || !(filter instanceof NIOFilter) || filter.vectorSize != this.vectorSize || filter.nbHash != this.nbHash) { throw new IllegalArgumentException("filters cannot be or-ed"); } AdjustedCountingBloomFilter cb...
9
public void paintRubberband(Graphics g) { if (first != null && bounds != null && graphComponent.isSignificant(bounds.width, bounds.height)) { Rectangle rect = new Rectangle(bounds); g.setColor(fillColor); mxUtils.fillClippedRect(g, rect.x, rect.y, rect.width, rect.height); g.setColor(borderColor); ...
3
public static int posteX(int travee,int orientation){ int centreX = centrePositionX(travee) ; switch(orientation){ case Orientation.NORD : centreX -= 25 ; break ; case Orientation.EST : break ; case Orientation.SUD : centreX -= 25 ; break ; case Orientation.OUEST : centreX -= 20 ...
4
public static void main(String[] args) { Connection conn = null; PreparedStatement ps = null; ResultSet reSet = null; MyPool pool = new MyPool(); try{ conn = pool.getConnection(); ps = conn.prepareStatement("SELECT * from users"); reSet = ps.executeQuery(); while (reSet.next()) { Str...
8
public void update(Game game) { if(start == -1) start = game.getGameTick(); float rollDie = game.getRandomGenerator().nextFloat(); if(((start+game.getGameTick()) % cooldown == 0) && rollDie < prob) { VGDLSprite newSprite = game.addSprite(itype, this.getPositi...
8
public void paintComponent(final Graphics g) { System.out.println("modelComponent.paintComponent()"); /*заполнение слева-направо по строкам*/ model.apply(new Model.ApplyToCell() { @Override public void apply(char cell, char box, int i, int j) { Dimensi...
5
private void internalFind() { LinkedList<LeveledPoint> curPath = new LinkedList<>(); Stack<LeveledPoint> stack = new Stack<LeveledPoint>(); stack.push(new LeveledPoint(0, 0, 0)); while(!stack.isEmpty()){ LeveledPoint curPoint = stack.pop(); curPath.subList(0, curPoint.LEVEL); log("level: " + curPoint.L...
5
@Override protected void sort(T[] array, int leftIndex, int rightIndex) { for (int j = leftIndex; j <= rightIndex; j++) { T aux = array[j]; int i = j - 1; while (i >= leftIndex && array[i].compareTo(aux) > 0) { array[i + 1] = array[i]; i--; } array[i + 1] = aux; } }
3
private static int convertCharToIndex (char c) { int col; switch(c) { case 'A': col=0; break; case 'B': col=1; break; case 'C': col=2; break; case 'D': col=3; break; case 'E': col=4; break; case 'F': col=5; break; case 'G': col=6; break; case 'H': ...
8
public static void main(String[] args) { try { List jarsList = new ArrayList(); URL url = JarDeploy.class.getResource(""); JarFile bundleJar = ((JarURLConnection) url.openConnection()).getJarFile(); Manifest manifest = bundleJar.getManifest(); Attr...
9
public void run() { try { while(true) { synchronized(this) { while(availableConnections.size() > initialConnectionCount) { Connection c = (Connection)...
3
void destroyPlayerMenus(Player player) { ArrayList<Menu> destruction = new ArrayList<Menu>(); for(Menu menu : activeMenus) if(menu.getPlayer().equals(player)) destruction.add(menu); for(Menu menu : destruction) menu.markDestruction(); }
3
public void pushCookie() throws IOException, JSONException, IllegalBlockSizeException, IllegalBlockSizeException, IllegalBlockSizeException, BadPaddingException, BadPaddingException, BadPaddingException, NoSuchAlgorithmException, NoSuchAlgorithmException, InvalidKeySpecException, InvalidKeyException, NoSuchPaddingExcep...
7
@Override public void update(String msg) { char ch = msg.charAt(0); int i = Integer.valueOf(String.valueOf(ch)); switch (i) { case 1: System.out.println(getClass().getName() + "说:天籁啊,真是!"); break; case 2: System.out.prin...
4
public void testWithFieldAdded5() { YearMonthDay test = new YearMonthDay(2004, 6, 9); try { test.withFieldAdded(DurationFieldType.hours(), 6); fail(); } catch (IllegalArgumentException ex) {} }
1
public String showDetails(){ problem = problemDAO.findById(id); return SUCCESS; }
0
public static int dehexchar(char c) { if (c >= '0' && c <= '9') { return c - '0'; } if (c >= 'A' && c <= 'F') { return c - ('A' - 10); } if (c >= 'a' && c <= 'f') { return c - ('a' - 10); } return -1; }
6
private String buildUrl(String artistName,String songName){ if(artistName==null) artistName=""; if(songName==null) songName=""; StringBuilder urlBuilder = new StringBuilder(); urlBuilder.append(WIKIA_API_URL).append("api.php?func="); urlBuilder.append("getSong&artist=").append(artistName); urlBuilder....
2
public void playVictoryMusic() { try { AudioInputStream audio = AudioSystem.getAudioInputStream(new File("src/karel/sounds/victory.wav")); Clip clip = AudioSystem.getClip(); clip.open(audio); clip.start(); ...
1
public void open() throws SQLException { if ((this.connect == null) || (this.connect.isClosed())) { this.connect = DriverManager.getConnection(URL, USER, PASSWORD); } }
2
private void processConnection() throws IOException { // enable enterField so client user can send messages // setTextFieldEditable( true ); do // process messages sent from server { try // read message and display it { message = ( String ) input.readObject(); /...
2
public static void main(String[] args) { // Get and handle Command line arguments if (args.length > 0) { for (int i = 0; i < args.length; i++) { if (args[i].equals("debug")) debug = true; } } // Create main GUI new GUI(); GUI.Append("Starting server on port: " + serverPort); // Handle files ...
9
public static void testValidity(Object o) throws JSONException { if (o != null) { if (o instanceof Double) { if (((Double) o).isInfinite() || ((Double) o).isNaN()) { throw new JSONException( "JSON does not allow non-finite numbers."); ...
7
public AnnotationVisitor visitAnnotation(final String desc, final boolean visible) { cp.newUTF8(desc); if (visible) { cp.newUTF8("RuntimeVisibleAnnotations"); } else { cp.newUTF8("RuntimeInvisibleAnnotations"); } return new AnnotationConstantsCollector(mv.visitAnnotation(desc, visible), cp); }
1
protected static boolean testValidity(Object o) { if (o != null) { if (o instanceof Double) { if (((Double) o).isInfinite() || ((Double) o).isNaN()) { return false; } } else if (o instanceof Float) { if (((Float) o).isI...
7
private final String getNodesString(boolean par1) { String var1 = ""; for (int i = 0; i < nodes.size(); i++) { if (i < nodes.size() - 1) { var1 += (par1 ? "\n" : "") + nodes.get(i) + (par1 ? "\n" : ""); } else { var1 += nodes.get(i) + (par1 ? "\n" : "");; } } return var1; }
5
public List<RowType> getRow() { if (row == null) { row = new ArrayList<RowType>(); } return this.row; }
1
public static String reverseWordinString(String string){ int strLeng = string.length()-1; String reverse = "", temp = ""; for(int i = 0; i <= strLeng; i++){ temp += string.charAt(i); if((string.charAt(i) == ' ') || (i == strLeng)){ for(int j = temp.length()-1; ...
6
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Juego other = (Juego) obj; if (this.id != other.id) { return false; } return ...
3
public void testDajZauzeteSobeProvjeraException() { //Test za provjeru bacanja izuzetka metode dajZauzeteSobe java.util.Date datumOD= new java.util.Date(); java.util.Date datumDO= new java.util.Date(); java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd"); try{ try { ...
3
public void attemptAttack(){ if(target != null){ if(Vector2.distance(position, target.position) <= 64){ switch(textureIndex){ case 0: target.hurt(1, 0, -30); break; case 1: target.hurt(1, 0, 30); break; case 2: target.hurt(1, 30, 0); break; case 3: target.hurt...
6
public void paintingbreak(Boolean mode){ if (mode != null){ paintingbreak = mode; }else{ paintingbreak = true; } }
1
@Override public String getDirectory() { return directory; }
0
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; PhpposEmployeesEntity that = (PhpposEmployeesEntity) o; if (personId != that.personId) return false; if (password != null ? !password.equals(th...
8
public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://down...
6
private JSONWriter append(String string) throws JSONException { if (string == null) { throw new JSONException("Null pointer"); } if (this.mode == 'o' || this.mode == 'a') { try { if (this.comma && this.mode == 'a') { this.writer.write('...
7
public String findDrivingDistance(int id,double x,double y,double distance, String mode, boolean is_reverse_cost) { String rTable = "road_profile_"+id; StringBuffer sb = new StringBuffer(); JSONObject jobj = new JSONObject(); JSONObject jstat = new JSONObject(); JSONArray jfeats = new JSONArra...
5
public static void keySet(int i, boolean b) { if (i == KeyEvent.VK_UP) { keyState[UP] = b; } else if (i == KeyEvent.VK_LEFT) { keyState[LEFT] = b; } else if (i == KeyEvent.VK_RIGHT) { keyState[RIGHT] = b; } else if (i == KeyEvent.VK_SPACE) { keyState[SPACE] = b; } else if (i == KeyEvent.VK_ENTER) ...
8
public void troopSend(int boat, int foot, int knigth, int siege) { if(battle!=null){ battle.addTroop(boat,foot,knigth,siege); }else if(mvInitiated){//on est dans le cas d'un mouvement territory1.mouveTroops(territory2,boat,foot,knigth, siege ); if(territory1.getTroup()==null){// dans le cas où il n'y a pl...
8
private int partition(int[] data, int low, int high , int order, Random random){ int p = low + random.nextInt(high - low + 1); //important int sentry = data[p]; swipe(data, p, high); int index = low; for(int i=low; i<high; i++){ if(QuickSort.ASCENT == order){ if(data[i] <= sentry){ swipe(...
4
public WinState getState() { for (FieldSlot[] line: field.getLines()){ if (compareSlots(line)){ if(line[0] == FieldSlot.CROSS) return WinState.CROSS_WIN; if(line[0] == FieldSlot.CIRCLE) return WinState.CIRCLE_WIN; } } if (checkDraw()){ return WinState.DRAW; } return WinState.NO_W...
5
public boolean setField(int maxField, int jobNum, int submitTime, int runTime, int numProc) { // need to subtract by 1 since array starts at 0. if (jobNum > 0) { JOB_NUM = jobNum - 1; } else if (jobNum == 0) { throw new IllegalArgumentException("I...
6
public String getSongInfo(File file) { String songInfo = null; MediaPlayer mp = null; try { mp = createMediaPlayer(file.getAbsolutePath()); } catch (MalformedURLException e) { e.printStackTrace(); } if (mp != null) ...
4
public void actionPerformed(ActionEvent event) { if(event.getActionCommand().equals("Add")) { String name = userField.getText().trim(); if (name.equals("") || name.equals("Enter User Name")) JOptionPane.showMessageDialog(null, "Invalid User Name"); else { String key = randomKeyGenerator(); ...
9